Sbucareer's Posts
Nairaland Forum › Sbucareer's Profile › Sbucareer's Posts
1 2 3 4 5 6 7 8 9 10 (of 38 pages)
[size=1pt] Just want to share this piece of code with Java enthusiast. It is about Desktop programming. Mind you this code is not compiled or tested. It was typed directly onto the forum message editor. If it doesn't compile when you copy and paste it, you would need to debug it. package Phone; import javax.swing.UIManager; import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.event.*; import javax.swing.text.*; public class MobilePhoneApplication extends JPanel{ private JPanel mainPanel; private JPanel display; private JPanel keyPads; private JPanel keyControls; private JTextArea textArea; private JButton call; private JButton end; private ActionListener listener; private DocumentListener docuListen; private Document jDocument; public MobilePhoneApplication (ActionListener listener, DocumentListener docuListen){ try{ UIManager.setLookAndFeel ( UIManager.getSystemLookAndFeelClassName() ); }catch(Exception e ){ }//End try this.listener = listener; this.docuListen = docuListen; mainPanel = new JPanel(); display = new JPanel(); keyPads = keyPads(); keyControls = new JPanel(); keyControls.setLayout ( new FlowLayout( ) ); call = new JButton( "Call" ;end = new JButton ( "End" ); keyControls.add ( call ); keyControls.add ( end ); display.setLayout ( new GridLayout (1, 1)); textArea = new JTextArea(); textArea.setEditable ( false ); textArea.getDocument().addDocumentListener (docuListen); textArea.setForeground ( new Color (255, 50 , 10 )); textArea.setFont ( new Font ("Dialog", Font.BOLD, 34 )); textArea.setLineWrap(true); display.add ( textArea ); mainPanel.setLayout( new GridLayout(3, 1) ); mainPanel.add ( display ); mainPanel.add ( keyControls ); mainPanel.add ( keyPads ); call.setActionCommand ( "Call" ); end.setActionCommand ("End" ); call.addActionListener (listener); end.addActionListener ( listener ); this.add( mainPanel ); }//End MobilePhoneApplication Constructor private JPanel keyPads (){ String values[] = {"1", "ABC2", "DEF3", "GHI4", "JKL5", "MNO6", "PQRS7", "TUV8", "WXYZ9", "*", "0+", "#" }; JPanel toReturn = new JPanel(); toReturn.setLayout (new GridLayout(4, 3)); JButton keys[] = new JButton[values.length]; for ( int index1 = 0; index1 < keys.length; index1++ ){ keys[index1] = new JButton ( values[index1] ); }//End for for (int index = 0; index < values.length; index++){ //keys[index].setText( values[index] ); keys[index].setActionCommand(values[index]); keys[index].addActionListener(this.listener); toReturn.add(keys[index]); }//End for return toReturn; }//End keyPads method public JTextArea getTextArea (){ return textArea; }//End getTextArea public void show(String string ){ if ( textArea.getText().length() != 9 ){ textArea.setText( textArea.getText()+string ); } }//End show public void defaultMenu ( boolean set){ call.setEnabled ( set ); end.setEnabled ( set ); }//End defaultMenu //Test if the TextArea has any test public boolean hasChar(){ jDocument = textArea.getDocument(); return ( jDocument.getLength() != 0 ); }//End hasChar public void clear (){ String text = textArea.getText(); text = null; textArea.setText (text ); }//End clear }//End MobilePhoneApplication I am continually updating this code [/size] |
Welcome [flash=425,344]http://sudoku.math.com" type=application/x-shockwave-flash" width="425" height="344"[/flash] |
As if this air crash was not enough diabolical dilemma and this has to happen |
javaprince, how are you? Hope you are getting on with your Java? Kudos to your elbows |
Alex, your question is somewhat unsettling. You should never ask in a public forum about product key or serial keys. If you loose your product key contact the vendor for assistance. Otherwise, if you bend on illegal keys then, google torrents for help and beware of trojan horse PS Lucky was mocking with you. You better check your sense of humour! |
The only cure is Time. |
Please I am scouting for information regarding good secondary schools in Nigeria, particularly Lagos state. Please if you know any information about schools, which may including their tuition fees, location, website and league table of the school could you be kind enough to share it, thanks |
Ogejoy and chisimdi, thanks again for your insight to this knotty Igbo soup. Thanks again particulary to chisimdi for that Oha Soup more grace to your elbow. Chukwu gozie unu. |
chisimdi could you be kind enough post how to cook Ugha soup or Egusi, thanks? |
Ogejoy and chisimdi thank you very much for that information. More of that Recommendation to orisebawo suggestion 1. Presidential Restaurant - Old Kent Rd 2. 8O5 Restaurant - Old Kent Rd |
Now, see as you disgrace yourself, moomu. Maybe you need plastic surgery b4 your monkey face can allow you to say common hello to a woman, animal. You should be given polonium-210 so you can die gracefully, idiot. |
engineerd: don't mind amber, some people just like to comment on matters that don't concern them, just cause they feel they can. I appreciate u leila, for u to come on Nairaland to ask for cooking help just so your husband is pleased with u shows u are a woman of virtue , Indeed your mom taught u well, so do u have any sister, age ranging between 23 and 26 ROTFLMFAO!!!! ![]() |
Method-Man oky!!! chia daa! Sorry Engineerd, more grease to your elbow. ![]() |
Leilah, at least he has brother that he goes to and eats his akpu and loilo with whatever soup. Ask him to get his brother to teach you to make whatever food he wants. Also, he should not really complain, if food and fufu was so most of his interest in a woman, believe me he would not have married you unless he has a hidden agenda, which I believe he doesn't with the help of God |
Engineered, how can she marry you? She is in the UK and you are at Onitisha? |
Why do you need to reinvent the wheel? Use Outlook Express to access any known email server on Earth. As long as you know the email server config, I don’t see why Outlook cannot retrieve your emails. About marking read and unread attributes, log into your original email facade and go to setting and configure your server to allow program to retrieve emails and leave the original email in the server. Unless there is another requirement you are trying to achieve without our direct knowledge, Outlook will be sufficient for your task. Details of email server config 1. You must know your SMTP i.e. smtp.domain.com 2. You must know your POP/IMAP/POP3 i.e. pop.domain.com 3. You must also know the ports for your SMTP and POP Remember, SMTP is used in sending email out of your software i.e. Outlook, whilst POP/IMAP/POP3 etc, are used for receiving email and using pop need a username and passwd settings I just remembered, you can tell Outlook to leave original email in the server |
kanirip, thanks for that last post. You said your mind at least. Incase anyone happens to work for cscsnigerialtd, your problem is cluster. Your Information Technology is not deployed very well and perhaps listen to Kanirip and get proper software developer to tweak the system. Don't feel bad. Even in the UK, their critical software system is designed by Indians and maintain by Britons. You can use the same concept. By maintaining other people software you can learn a lot for yourself. |
Otigba boys!!! Igbakiri igba boys - I de salute |
Soon be back got to do something righ now |
Javaprince as you said that your strength is Desktop, Don't bother with above API, concentrate on Swing API and JSwing API Remember, JSwing or Swing and AWT are not for Web application development, they are for Desktop development |
x |
Do you mean submit forms like this <HTML> <HED><TITLE>Submit Page</TITLE> </HEAD> <!-- The body of the form is cleared within the body of HTML --> <BODY> <DIV ALIGN=CENTER> <FORM ACTION="MAILTO:SBUCAREER@HTOMAIL.COM" METHOD=POST NAME="SubmitForm"> <TABLE BORDER=0> <TR> <TD ALIGN=LEFT>Firstname</TD> <TD ALIGN=LEFT><INPUT TYPE=text NAME=firstname></TD> <TD ALIGN=LEFT>Lastname</TD> <TD ALIGN=LEFT><INPUT TYPE=text NAME=lastname></TD> </TR> <TR> <TD ALIGN=LEFT>Email</TD> <TD ALIGN=LEFT><INPUT TYPE=text NAME=email></TD> </TR> <TR> <TD></TD> </TR> <TR> <TD></TD> </TR> <TR> <TD></TD> </TR> <TR> <TD></TD> </TR> <TD ALIGN=LEFT>Comments</TD> <TD ALIGN=LEFT><textarea rows="10" cols="30" WRAP=PHYSICAL></textarea> ></TD> </TR> <TR> <TD><INPUT TYPE=submit VALUE=Submit></TD> </TR> </TABLE> </FORM> </DIV> </BODY> </HTML> In the ACTION tag you can put your PHP/PERL/JSP/SERVLET/ASP etc. there. If your question was to design a program that will do the same thing as the default HTML mailto, tell us the language you wan it in |
What do you mean by HTML form handler? In what language? |
My best writers would be: 1. John Perkins 2. Samantha Power 3. Rodney Walter African writers 1. Wole Soyinka 2. Chimamanda Ngozi Adichie |
[size=24pt] Don't send anymore emails to me I do not have the emanuals any longer, sorry! [/size] |
You can also visit these links for additional reading list: 1. Codinghorror 2. cr.yp.to |
No logica, I just want to be clear |
Thanks for the clarification, but what is the difference between C and C++? |
I hope this helps you with the rest of the assignment. Incase you want to get a particularly person from the Vector list, do this for (int index = 0; index < list.size(); index++){ if (list.elementAt(index) instanceof person.getTelephone() ) Do something } Remember person will be the instance of the object you are looking for in the list. Not very efficient but you can come up with clever algorithm You can add another method in Person class for enquiry i.e, private String getTelephone(String tele){ if ( this.telephoneNumber == tele ) return this.telephoneNumber; }//End getTelephoneNumber |
;
