Why won't my Java project run?
-
import java.awt.*; import java.awt.event.*; import java.text.*; import javax.swing.*; public class Project3 extends JFrame { private GUI GUIObject; private JButton numberAB, GUI; private JTextArea TextArea; private JTextField TextField; private JLabel numberinst; public Project3() { createUserInterface(); } private void createUserInterface() { Container contentPane = getContentPane(); contentPane.setLayout(null); numberinst = new JLabel(); numberinst.setText( "Type in the number you want to be extracted" ); numberinst.setBounds( 150, 0, 500, 100); numberinst.setFont( new Font( "", Font.PLAIN, 20)); numberinst.setVisible(false); contentPane.add( numberinst ); TextField = new JTextField(); TextField.setText( "" ); TextField.setBounds( 300, 100, 100, 50); TextField.setVisible(false); TextField.setFont( new Font( "", Font.PLAIN, 20)); contentPane.add( TextField ); TextArea = new JTextArea(); TextArea.setText( "" ); TextArea.setBounds( 50, 325, 600, 125); TextArea.setVisible(false); TextArea.setEditable(false); contentPane.add( TextArea ); numberAB = new JButton(); numberAB.setText( "Convert" ); numberAB.setBounds( 300, 200, 100, 40 ); numberAB.setVisible(false); contentPane.add( numberAB ); numberAB.addActionListener( new ActionListener() { public void actionPerformed ( ActionEvent event ) { numberConvertActionPerformed( event ); } } ); } private void numberJTextFieldKeyPressed( KeyEvent event ) { TextArea.setText(""); } private void numberConvertActionPerformed( ActionEvent event ) { int number = Integer.parseInt(TextField.getText()); if(number > 0 && number < 1000000) { int first = number / 100000; int second = number / 10000 - first * 10; int third = number / 1000 - first * 100 - second * 10; int fourth = number / 100 - first * 1000 - second * 100 - third * 10; int fifth = number / 10 - first * 10000 - second * 1000 - third * 100 - fourth * 10; int sixth = number - first * 100000 - second * 10000 - third * 1000 - fourth * 100 - fifth * 10; if( number > 99999) { switch(first) { case 1: TextArea.append("one hundred "); break; case 2: TextArea.append("two hundred "); break; case 3: TextArea.append("three hundred "); break; case 4: TextArea.append("four hundred "); break; case 5: TextArea.append("five hundred "); break; case 6: TextArea.append("six hundred "); break; case 7: TextArea.append("seven hundred "); break; case 8: TextArea.append("eight hundred "); break; case 9: TextArea.append("nine hundred "); break; } if(second< 20 && second>9) { switch(second) { case 10: TextArea.append("ten thousand "); break; case 11: TextArea.append("eleven thousand "); break; case 12: TextArea.append("twelve thousand "); break; case 13: TextArea.append("thirteen thousand "); break; case 14: TextArea.append("fourteen thousand "); break; case 15: TextArea.append("fifteen thousand "); break; case 16: TextArea.append("sixteen thousand "); break; case 17: TextArea.append("seventeen thousand "); break; case 18: TextArea.append("eighteen thousand "); break; case 19: TextArea.append("nineteen thousand "); break; } } else if(true) { switch(second) { case 0: TextArea.append("thousand"); break; case 2: TextArea.append("twenty "); break; case 3: TextArea.append("thirty "); break; case 4: TextArea.append("fourty "); break; case 5: TextArea.append("fifty "); break; case 6: TextArea.append("sixty "); break; case 7: TextArea.append("seventy "); break; case 8: TextArea.append("eighty "); break; case 9: TextArea.append("ninety "); break; } } switch(third) { case 0: TextArea.append(""); break; case 1: TextArea.append("one thousand "); break; case 2: TextArea.append("two thousand "); break; case 3: TextArea.append("three thousand "); break; case 4: TextArea.append("four thousand "); break; case 5: TextArea.append("five thousand "); break; case 6: TextArea.append("six thousand "); break; case 7: TextArea.append("seven thousand "); break; case 8: TextArea.append("eight thousand "); break; case 9: TextArea.append("nine thousand"); break; } switch(fourth) { case 1: TextArea.append("one hundred "); break; case 2: TextArea.append("two hundred "); break; case 3: TextArea.append("three hundred "); break; case 4: TextArea.append("four hundred "); break; case 5: TextArea.append("five hundred "); break; case 6: TextArea.append("six hundr
-
Answer:
Not all the devs have time to check ur code in this way. From now on in ur career as a developer, post the errors, just the line of the error, aditional details,etc. Regards...
Chuck Juday at Yahoo! Answers Visit the source
Related Q & A:
- Why won't my app run in the IOS simulator?Best solution by Stack Overflow
- Why won't my text wrap around the image?Best solution by Stack Overflow
- Why won't Tumblr video show on my Tumblr?Best solution by answers.yahoo.com
- Why won't my @media queries work?Best solution by stackoverflow.com
- Why doesn't a Nissan truck run smooth in overdrive?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.