Results 1 to 9 of 9
  1. #1
    Paul_White is offline Member
    Join Date
    Apr 2011
    Posts
    15
    Rep Power
    0

    Question Complex GUI 60 JComboBox + 40+ JTextBox

    Firstly let me once again thank the folks who have helped me before.

    I have (I thought for ease of making) created this as a Visual Class. This is the first visual class I have tried to make. And I needed to use somethign to allow me to place the items where I wanted them on the screen.
    I am using Eclipse Helios as my IDE. However it will not run. FYI it did not run before I put in quite so many boxes etc.
    I am new to Java and can debug if only I get a sensible error message from the IDE.

    I am very sorry for the long code here it is very repetitive. All I know is that it is something to do with the "main" bit at the bottom.

    If someone could please point me in the right direction and indicate what I should rem out or what needs to be added to just make it give me line errors (which I should be able to fix myself) I would be very grateful.

    Java Code:
    package Navigation;
    
    import java.awt.event.KeyEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.Event;
    import javax.swing.KeyStroke;
    import java.awt.Point;
    import javax.swing.JLabel;
    import javax.swing.JMenuItem;
    import javax.swing.JMenuBar;
    import javax.swing.JMenu;
    import javax.swing.JFrame;
    import javax.swing.JDialog;
    import javax.swing.JComboBox;
    import javax.swing.JDesktopPane;
    import javax.swing.SwingUtilities;
    
    import java.awt.Rectangle;
    import javax.swing.JTextField;
    
    public class GUI1 {
    	
    /*		get_country get_country = new get_country();{
    		  ((Object) get_country).getClass();
    		get_types get_types = new get_types();{
    		  ((Object) get_types).getClass();
    		get_list get_list = new get_list();{
    		  ((Object) get_list).getClass();
    */		  
    	private JFrame Navigation = null;
    	private JMenuBar jJMenuBar = null;
    	private JMenu fileMenu = null;
    	private JMenu helpMenu = null;
    	private JMenuItem exitMenuItem = null;
    	private JMenuItem aboutMenuItem = null;
    	private JMenuItem saveMenuItem = null;
    	private JDesktopPane jDesktopPane = null;
    	private JLabel L1 = null;
    	private JComboBox C1 = null;
    	private JComboBox C2 = null;
    	private JComboBox C3 = null;
    	private JComboBox C4 = null;
    	private JComboBox C5 = null;
    	private JComboBox C6 = null;
    	private JComboBox C7 = null;
    	private JComboBox C8 = null;
    	private JComboBox C9 = null;
    	private JComboBox C10 = null;
    	private JComboBox C11 = null;
    	private JComboBox C12 = null;
    	private JComboBox C13 = null;
    	private JComboBox C14 = null;
    	private JComboBox C15 = null;
    	private JComboBox C16 = null;
    	private JComboBox C17 = null;
    	private JComboBox C18 = null;
    	private JComboBox C19 = null;
    	private JComboBox C20 = null;
    	private JComboBox T1 = null;
    	private JComboBox T2 = null;
    	private JComboBox T3 = null;
    	private JComboBox T4 = null;
    	private JComboBox T5 = null;
    	private JComboBox T6 = null;
    	private JComboBox T7 = null;
    	private JComboBox T8 = null;
    	private JComboBox T9 = null;
    	private JComboBox T10 = null;
    	private JComboBox T11 = null;
    	private JComboBox T12 = null;
    	private JComboBox T13 = null;
    	private JComboBox T14 = null;
    	private JComboBox T15 = null;
    	private JComboBox T16 = null;
    	private JComboBox T17 = null;
    	private JComboBox T18 = null;
    	private JComboBox T19 = null;
    	private JComboBox T20 = null;
    	private JComboBox N1 = null;
    	private JComboBox N2 = null;
    	private JComboBox N3 = null;
    	private JComboBox N4 = null;
    	private JComboBox N5 = null;
    	private JComboBox N6 = null;
    	private JComboBox N7 = null;
    	private JComboBox N8 = null;
    	private JComboBox N9 = null;
    	private JComboBox N10 = null;
    	private JComboBox N11 = null;
    	private JComboBox N12 = null;
    	private JComboBox N13 = null;
    	private JComboBox N14 = null;
    	private JComboBox N15 = null;
    	private JComboBox N16 = null;
    	private JComboBox N17 = null;
    	private JComboBox N18 = null;
    	private JComboBox N19 = null;
    	private JComboBox N20 = null;
    	private JTextField H1 = null;
    	private JTextField H2 = null;
    	private JTextField H3 = null;
    	private JTextField H4 = null;
    	private JTextField H5 = null;
    	private JTextField H6 = null;
    	private JTextField H7 = null;
    	private JTextField H8 = null;
    	private JTextField H9 = null;
    	private JTextField H10 = null;
    	private JTextField H11 = null;
    	private JTextField H12 = null;
    	private JTextField H13 = null;
    	private JTextField H14 = null;
    	private JTextField H15 = null;
    	private JTextField H16 = null;
    	private JTextField H17 = null;
    	private JTextField H18 = null;
    	private JTextField H19 = null;
    	private JTextField H20 = null;
    	private JTextField D1 = null;
    	private JTextField D2 = null;
    	private JTextField D3 = null;
    	private JTextField D4 = null;
    	private JTextField D5 = null;
    	private JTextField D6 = null;
    	private JTextField D7 = null;
    	private JTextField D8 = null;
    	private JTextField D9 = null;
    	private JTextField D10 = null;
    	private JTextField D11 = null;
    	private JTextField D12 = null;
    	private JTextField D13 = null;
    	private JTextField D14 = null;
    	private JTextField D15 = null;
    	private JTextField D16 = null;
    	private JTextField D17 = null;
    	private JTextField D18 = null;
    	private JTextField D19 = null;
    	private JTextField D20 = null;
    	/**
    	 * This method initializes Navigation
    	 * 
    	 * @return javax.swing.JFrame
    	 */
    	private JFrame getNavigation() {
    		if (Navigation == null) {
    			Navigation = new JFrame();
    			Navigation.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    			Navigation.setJMenuBar(getJJMenuBar());
    			Navigation.setSize(1280, 1024);
    			Navigation.setContentPane(getJDesktopPane());
    			Navigation.setTitle("Navigation");
    		}
    		return Navigation;
    	}
    
    	/**
    	 * This method initializes jJMenuBar	
    	 * 	
    	 * @return javax.swing.JMenuBar	
    	 */
    	private JMenuBar getJJMenuBar() {
    		if (jJMenuBar == null) {
    			jJMenuBar = new JMenuBar();
    			jJMenuBar.add(getFileMenu());
    			jJMenuBar.add(getHelpMenu());
    		}
    		return jJMenuBar;
    	}
    
    	/**
    	 * This method initializes jMenu	
    	 * 	
    	 * @return javax.swing.JMenu	
    	 */
    	private JMenu getFileMenu() {
    		if (fileMenu == null) {
    			fileMenu = new JMenu();
    			fileMenu.setText("File");
    			fileMenu.add(getSaveMenuItem());
    			fileMenu.add(getExitMenuItem());
    		}
    		return fileMenu;
    	}
    
    	/**
    	 * This method initializes jMenu	
    	 * 	
    	 * @return javax.swing.JMenu	
    	 */
    	private JMenu getHelpMenu() {
    		if (helpMenu == null) {
    			helpMenu = new JMenu();
    			helpMenu.setText("Help");
    			helpMenu.add(getAboutMenuItem());
    		}
    		return helpMenu;
    	}
    
    	/**
    	 * This method initializes jMenuItem	
    	 * 	
    	 * @return javax.swing.JMenuItem	
    	 */
    	private JMenuItem getExitMenuItem() {
    		if (exitMenuItem == null) {
    			exitMenuItem = new JMenuItem();
    			exitMenuItem.setText("Exit");
    			exitMenuItem.addActionListener(new ActionListener() {
    				public void actionPerformed(ActionEvent e) {
    					System.exit(0);
    				}
    			});
    		}
    		return exitMenuItem;
    	}
    
    	/**
    	 * This method initializes jMenuItem	
    	 * 	
    	 * @return javax.swing.JMenuItem	
    	 */
    	private JMenuItem getAboutMenuItem() {
    		if (aboutMenuItem == null) {
    			aboutMenuItem = new JMenuItem();
    			aboutMenuItem.setText("About");
    			aboutMenuItem.addActionListener(new ActionListener() {
    				public void actionPerformed(ActionEvent e) {
    					JDialog aboutDialog = getAboutDialog();
    					aboutDialog.pack();
    					Point loc = getNavigation().getLocation();
    					loc.translate(20, 20);
    					aboutDialog.setLocation(loc);
    					aboutDialog.setVisible(true);
    				}
    			});
    		}
    		return aboutMenuItem;
    	}
    
    	protected JDialog getAboutDialog() {
    		return null;
    	}
    
    	/**
    	 * This method initializes jMenuItem	
    	 * 	
    	 * @return javax.swing.JMenuItem	
    	 */
    	private JMenuItem getSaveMenuItem() {
    		if (saveMenuItem == null) {
    			saveMenuItem = new JMenuItem();
    			saveMenuItem.setText("Save");
    			saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
    					Event.CTRL_MASK, true));
    		}
    		return saveMenuItem;
    	}
    
    	/**
    	 * This method initializes jDesktopPane	
    	 * 	
    	 * @return javax.swing.JDesktopPane	
    	 */
    	private JDesktopPane getJDesktopPane() {
    		if (jDesktopPane == null) {
    			L1 = new JLabel();
    			L1.setBounds(new Rectangle(0, 0, 1272, 20));
    			L1.setText("           Country / State                                 Type                                                                                           Name                                                                               Heading           Distance");
    			jDesktopPane = new JDesktopPane();
    			jDesktopPane.add(L1, null);
    			jDesktopPane.add(getC1(), null);
    			jDesktopPane.add(getC2(), null);
    			jDesktopPane.add(getC3(), null);
    			jDesktopPane.add(getC4(), null);
    			jDesktopPane.add(getC5(), null);
    			jDesktopPane.add(getC6(), null);
    			jDesktopPane.add(getC7(), null);
    			jDesktopPane.add(getC8(), null);
    			jDesktopPane.add(getC9(), null);
    			jDesktopPane.add(getC10(), null);
    			jDesktopPane.add(getC11(), null);
    			jDesktopPane.add(getC12(), null);
    			jDesktopPane.add(getC13(), null);
    			jDesktopPane.add(getC14(), null);
    			jDesktopPane.add(getC15(), null);
    			jDesktopPane.add(getC16(), null);
    			jDesktopPane.add(getC17(), null);
    			jDesktopPane.add(getC18(), null);
    			jDesktopPane.add(getC19(), null);
    			jDesktopPane.add(getC20(), null);
    			jDesktopPane.add(getT1(), null);
    			jDesktopPane.add(getT2(), null);
    			jDesktopPane.add(getT3(), null);
    			jDesktopPane.add(getT4(), null);
    			jDesktopPane.add(getT5(), null);
    			jDesktopPane.add(getT6(), null);
    			jDesktopPane.add(getT7(), null);
    			jDesktopPane.add(getT8(), null);
    			jDesktopPane.add(getT9(), null);
    			jDesktopPane.add(getT10(), null);
    			jDesktopPane.add(getT11(), null);
    			jDesktopPane.add(getT12(), null);
    			jDesktopPane.add(getT13(), null);
    			jDesktopPane.add(getT14(), null);
    			jDesktopPane.add(getT15(), null);
    			jDesktopPane.add(getT16(), null);
    			jDesktopPane.add(getT17(), null);
    			jDesktopPane.add(getT18(), null);
    			jDesktopPane.add(getT19(), null);
    			jDesktopPane.add(getT20(), null);
    			jDesktopPane.add(getN1(), null);
    			jDesktopPane.add(getN2(), null);
    			jDesktopPane.add(getN3(), null);
    			jDesktopPane.add(getN4(), null);
    			jDesktopPane.add(getN5(), null);
    			jDesktopPane.add(getN6(), null);
    			jDesktopPane.add(getN7(), null);
    			jDesktopPane.add(getN8(), null);
    			jDesktopPane.add(getN9(), null);
    			jDesktopPane.add(getN10(), null);
    			jDesktopPane.add(getN11(), null);
    			jDesktopPane.add(getN12(), null);
    			jDesktopPane.add(getN13(), null);
    			jDesktopPane.add(getN14(), null);
    			jDesktopPane.add(getN15(), null);
    			jDesktopPane.add(getN16(), null);
    			jDesktopPane.add(getN17(), null);
    			jDesktopPane.add(getN18(), null);
    			jDesktopPane.add(getN19(), null);
    			jDesktopPane.add(getN20(), null);			
    			jDesktopPane.add(getH1(), null);
    			jDesktopPane.add(getH2(), null);
    			jDesktopPane.add(getH3(), null);
    			jDesktopPane.add(getH4(), null);
    			jDesktopPane.add(getH5(), null);
    			jDesktopPane.add(getH6(), null);
    			jDesktopPane.add(getH7(), null);
    			jDesktopPane.add(getH8(), null);
    			jDesktopPane.add(getH9(), null);
    			jDesktopPane.add(getH10(), null);
    			jDesktopPane.add(getH11(), null);
    			jDesktopPane.add(getH12(), null);
    			jDesktopPane.add(getH13(), null);
    			jDesktopPane.add(getH14(), null);
    			jDesktopPane.add(getH15(), null);
    			jDesktopPane.add(getH16(), null);
    			jDesktopPane.add(getH17(), null);
    			jDesktopPane.add(getH18(), null);
    			jDesktopPane.add(getH19(), null);
    			jDesktopPane.add(getH20(), null);
    			jDesktopPane.add(getD1(), null);
    			jDesktopPane.add(getD2(), null);
    			jDesktopPane.add(getD3(), null);
    			jDesktopPane.add(getD4(), null);
    			jDesktopPane.add(getD5(), null);
    			jDesktopPane.add(getD6(), null);
    			jDesktopPane.add(getD7(), null);
    			jDesktopPane.add(getD8(), null);
    			jDesktopPane.add(getD9(), null);
    			jDesktopPane.add(getD10(), null);
    			jDesktopPane.add(getD11(), null);
    			jDesktopPane.add(getD12(), null);
    			jDesktopPane.add(getD13(), null);
    			jDesktopPane.add(getD14(), null);
    			jDesktopPane.add(getD15(), null);
    			jDesktopPane.add(getD16(), null);
    			jDesktopPane.add(getD17(), null);
    			jDesktopPane.add(getD18(), null);
    			jDesktopPane.add(getD19(), null);
    			jDesktopPane.add(getD20(), null);
    		}
    		return jDesktopPane;
    	}
    
    	/**
    	 * This method initializes C1	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC1() {
    		if (C1 == null) {
    			C1 = new JComboBox();
    			C1.setBounds(new Rectangle(5, 25, 150, 20));
    		}
    		return C1;
    	}
    
    	/**
    	 * This method initializes C2	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC2() {
    		if (C2 == null) {
    			C2 = new JComboBox();
    			C2.setBounds(new Rectangle(5, 50, 150, 20));
    		}
    		return C2;
    	}
    
    	/**
    	 * This method initializes C3	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC3() {
    		if (C3 == null) {
    			C3 = new JComboBox();
    			C3.setBounds(new Rectangle(5, 75, 150, 20));
    		}
    		return C3;
    	}
    
    	/**
    	 * This method initializes C4	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC4() {
    		if (C4 == null) {
    			C4 = new JComboBox();
    			C4.setBounds(new Rectangle(5, 100, 150, 20));
    		}
    		return C4;
    	}
    
    	/**
    	 * This method initializes C5	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC5() {
    		if (C5 == null) {
    			C5 = new JComboBox();
    			C5.setBounds(new Rectangle(5, 125, 150, 20));
    		}
    		return C5;
    	}
    
    	/**
    	 * This method initializes C6	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC6() {
    		if (C6 == null) {
    			C6 = new JComboBox();
    			C6.setBounds(new Rectangle(5, 150, 150, 20));
    		}
    		return C6;
    	}
    
    	/**
    	 * This method initializes C7	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC7() {
    		if (C7 == null) {
    			C7 = new JComboBox();
    			C7.setBounds(new Rectangle(5, 175, 150, 20));
    		}
    		return C7;
    	}
    
    	/**
    	 * This method initializes C8	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC8() {
    		if (C8 == null) {
    			C8 = new JComboBox();
    			C8.setBounds(new Rectangle(5, 200, 150, 20));
    		}
    		return C8;
    	}
    
    	/**
    	 * This method initializes C9	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC9() {
    		if (C9 == null) {
    			C9 = new JComboBox();
    			C9.setBounds(new Rectangle(5, 225, 150, 20));
    		}
    		return C9;
    	}
    
    	/**
    	 * This method initializes C10	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC10() {
    		if (C10 == null) {
    			C10 = new JComboBox();
    			C10.setBounds(new Rectangle(5, 250, 150, 20));
    		}
    		return C10;
    	}
    
    	/**
    	 * This method initializes C11	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC11() {
    		if (C11 == null) {
    			C11 = new JComboBox();
    			C11.setBounds(new Rectangle(5, 275, 150, 20));
    		}
    		return C11;
    	}
    
    	/**
    	 * This method initializes C12	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC12() {
    		if (C12 == null) {
    			C12 = new JComboBox();
    			C12.setBounds(new Rectangle(5, 300, 150, 20));
    		}
    		return C12;
    	}
    
    	/**
    	 * This method initializes C13	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC13() {
    		if (C13 == null) {
    			C13 = new JComboBox();
    			C13.setBounds(new Rectangle(5, 325, 150, 20));
    		}
    		return C13;
    	}
    
    	/**
    	 * This method initializes C14	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC14() {
    		if (C14 == null) {
    			C14 = new JComboBox();
    			C14.setBounds(new Rectangle(5, 350, 150, 20));
    		}
    		return C14;
    	}
    
    	/**
    	 * This method initializes C15	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC15() {
    		if (C15 == null) {
    			C15 = new JComboBox();
    			C15.setBounds(new Rectangle(5, 375, 150, 20));
    		}
    		return C15;
    	}
    
    	/**
    	 * This method initializes C16	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC16() {
    		if (C16 == null) {
    			C16 = new JComboBox();
    			C16.setBounds(new Rectangle(5, 400, 150, 20));
    		}
    		return C16;
    	}
    
    	/**
    	 * This method initializes C17	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC17() {
    		if (C17 == null) {
    			C17 = new JComboBox();
    			C17.setBounds(new Rectangle(5, 425, 150, 20));
    		}
    		return C17;
    	}
    
    	/**
    	 * This method initializes C18	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC18() {
    		if (C18 == null) {
    			C18 = new JComboBox();
    			C18.setBounds(new Rectangle(5, 450, 150, 20));
    		}
    		return C18;
    	}
    
    	/**
    	 * This method initializes C19	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC19() {
    		if (C19 == null) {
    			C19 = new JComboBox();
    			C19.setBounds(new Rectangle(5, 475, 150, 20));
    		}
    		return C19;
    	}
    
    	/**
    	 * This method initializes C20	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getC20() {
    		if (C20 == null) {
    			C20 = new JComboBox();
    			C20.setBounds(new Rectangle(5, 500, 150, 20));
    		}
    		return C20;
    	}
    
    	/**
    	 * This method initializes T1	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT1() {
    		if (T1 == null) {
    			T1 = new JComboBox();
    			T1.setBounds(new Rectangle(160, 25, 150, 20));
    		}
    		return T1;
    	}
    
    	/**
    	 * This method initializes T2	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT2() {
    		if (T2 == null) {
    			T2 = new JComboBox();
    			T2.setBounds(new Rectangle(160, 50, 150, 20));
    		}
    		return T2;
    	}
    
    	/**
    	 * This method initializes T3	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT3() {
    		if (T3 == null) {
    			T3 = new JComboBox();
    			T3.setBounds(new Rectangle(160, 75, 150, 20));
    		}
    		return T3;
    	}
    
    	/**
    	 * This method initializes T4	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT4() {
    		if (T4 == null) {
    			T4 = new JComboBox();
    			T4.setBounds(new Rectangle(160, 100, 150, 20));
    		}
    		return T4;
    	}
    
    	/**
    	 * This method initializes T5	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT5() {
    		if (T5 == null) {
    			T5 = new JComboBox();
    			T5.setBounds(new Rectangle(160, 125, 150, 20));
    		}
    		return T5;
    	}
    
    	/**
    	 * This method initializes T6	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT6() {
    		if (T6 == null) {
    			T6 = new JComboBox();
    			T6.setBounds(new Rectangle(160, 150, 150, 20));
    		}
    		return T6;
    	}
    
    	/**
    	 * This method initializes T61	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT7() {
    		if (T7 == null) {
    			T7 = new JComboBox();
    			T7.setBounds(new Rectangle(160, 175, 150, 20));
    		}
    		return T7;
    	}
    
    	/**
    	 * This method initializes T8	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT8() {
    		if (T8 == null) {
    			T8 = new JComboBox();
    			T8.setBounds(new Rectangle(160, 200, 150, 20));
    		}
    		return T8;
    	}
    
    	/**
    	 * This method initializes T9	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT9() {
    		if (T9 == null) {
    			T9 = new JComboBox();
    			T9.setBounds(new Rectangle(160, 225, 150, 20));
    		}
    		return T9;
    	}
    
    	/**
    	 * This method initializes T10	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT10() {
    		if (T10 == null) {
    			T10 = new JComboBox();
    			T10.setBounds(new Rectangle(160, 250, 150, 20));
    		}
    		return T10;
    	}
    
    	/**
    	 * This method initializes T11	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT11() {
    		if (T11 == null) {
    			T11 = new JComboBox();
    			T11.setBounds(new Rectangle(160, 275, 150, 20));
    		}
    		return T11;
    	}
    
    	/**
    	 * This method initializes T12	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT12() {
    		if (T12 == null) {
    			T12 = new JComboBox();
    			T12.setBounds(new Rectangle(160, 300, 150, 20));
    		}
    		return T12;
    	}
    
    	/**
    	 * This method initializes T13	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT13() {
    		if (T13 == null) {
    			T13 = new JComboBox();
    			T13.setBounds(new Rectangle(160, 325, 150, 20));
    		}
    		return T13;
    	}
    
    	/**
    	 * This method initializes T14	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT14() {
    		if (T14 == null) {
    			T14 = new JComboBox();
    			T14.setBounds(new Rectangle(160, 350, 150, 20));
    		}
    		return T14;
    	}
    
    	/**
    	 * This method initializes T15	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT15() {
    		if (T15 == null) {
    			T15 = new JComboBox();
    			T15.setBounds(new Rectangle(160, 375, 150, 20));
    		}
    		return T15;
    	}
    
    	/**
    	 * This method initializes T16	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT16() {
    		if (T16 == null) {
    			T16 = new JComboBox();
    			T16.setBounds(new Rectangle(160, 400, 150, 20));
    		}
    		return T16;
    	}
    
    	/**
    	 * This method initializes T17	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT17() {
    		if (T17 == null) {
    			T17 = new JComboBox();
    			T17.setBounds(new Rectangle(160, 425, 150, 20));
    		}
    		return T17;
    	}
    
    	/**
    	 * This method initializes T18	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT18() {
    		if (T18 == null) {
    			T18 = new JComboBox();
    			T18.setBounds(new Rectangle(160, 450, 150, 20));
    		}
    		return T18;
    	}
    
    	/**
    	 * This method initializes T19	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT19() {
    		if (T19 == null) {
    			T19 = new JComboBox();
    			T19.setBounds(new Rectangle(160, 475, 150, 20));
    		}
    		return T19;
    	}
    
    	/**
    	 * This method initializes T20	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getT20() {
    		if (T20 == null) {
    			T20 = new JComboBox();
    			T20.setBounds(new Rectangle(160, 500, 150, 20));
    		}
    		return T20;
    	}
    	/**
    	 * This method initializes N1	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN1() {
    		if (N1 == null) {
    			N1 = new JComboBox();
    			N1.setBounds(new Rectangle(315, 25, 450, 20));
    		}
    		return N1;
    	}
    
    	/**
    	 * This method initializes N2	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN2() {
    		if (N2 == null) {
    			N2 = new JComboBox();
    			N2.setBounds(new Rectangle(315, 50, 450, 20));
    		}
    		return N2;
    	}
    
    	/**
    	 * This method initializes N3	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN3() {
    		if (N3 == null) {
    			N3 = new JComboBox();
    			N3.setBounds(new Rectangle(315, 75, 450, 20));
    		}
    		return N3;
    	}
    
    	/**
    	 * This method initializes N4	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN4() {
    		if (N4 == null) {
    			N4 = new JComboBox();
    			N4.setBounds(new Rectangle(315, 100, 450, 20));
    		}
    		return N4;
    	}
    
    	/**
    	 * This method initializes N5	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN5() {
    		if (N5 == null) {
    			N5 = new JComboBox();
    			N5.setBounds(new Rectangle(315, 125, 450, 20));
    		}
    		return N5;
    	}
    
    	/**
    	 * This method initializes N6	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN6() {
    		if (N6 == null) {
    			N6 = new JComboBox();
    			N6.setBounds(new Rectangle(315, 150, 450, 20));
    		}
    		return N6;
    	}
    
    	/**
    	 * This method initializes N7	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN7() {
    		if (N7 == null) {
    			N7 = new JComboBox();
    			N7.setBounds(new Rectangle(315, 175, 450, 20));
    		}
    		return N7;
    	}
    
    	/**
    	 * This method initializes N8	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN8() {
    		if (N8 == null) {
    			N8 = new JComboBox();
    			N8.setBounds(new Rectangle(315, 200, 450, 20));
    		}
    		return N8;
    	}
    
    	/**
    	 * This method initializes N9	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN9() {
    		if (N9 == null) {
    			N9 = new JComboBox();
    			N9.setBounds(new Rectangle(315, 225, 450, 20));
    		}
    		return N9;
    	}
    
    	/**
    	 * This method initializes N10	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN10() {
    		if (N10 == null) {
    			N10 = new JComboBox();
    			N10.setBounds(new Rectangle(315, 250, 450, 20));
    		}
    		return N10;
    	}
    
    	/**
    	 * This method initializes N11	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN11() {
    		if (N11 == null) {
    			N11 = new JComboBox();
    			N11.setBounds(new Rectangle(315, 275, 450, 20));
    		}
    		return N11;
    	}
    
    	/**
    	 * This method initializes N12	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN12() {
    		if (N12 == null) {
    			N12 = new JComboBox();
    			N12.setBounds(new Rectangle(315, 300, 450, 20));
    		}
    		return N12;
    	}
    
    	/**
    	 * This method initializes N13	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN13() {
    		if (N13 == null) {
    			N13 = new JComboBox();
    			N13.setBounds(new Rectangle(315, 325, 450, 20));
    		}
    		return N13;
    	}
    
    	/**
    	 * This method initializes N14	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN14() {
    		if (N14 == null) {
    			N14 = new JComboBox();
    			N14.setBounds(new Rectangle(315, 350, 450, 20));
    		}
    		return N14;
    	}
    
    	/**
    	 * This method initializes N15	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN15() {
    		if (N15 == null) {
    			N15 = new JComboBox();
    			N15.setBounds(new Rectangle(315, 375, 450, 20));
    		}
    		return N15;
    	}
    
    	/**
    	 * This method initializes N16	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN16() {
    		if (N16 == null) {
    			N16 = new JComboBox();
    			N16.setBounds(new Rectangle(315, 400, 450, 20));
    		}
    		return N16;
    	}
    
    	/**
    	 * This method initializes N17	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN17() {
    		if (N17 == null) {
    			N17 = new JComboBox();
    			N17.setBounds(new Rectangle(315, 425, 450, 20));
    		}
    		return N17;
    	}
    
    	/**
    	 * This method initializes N18	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN18() {
    		if (N18 == null) {
    			N18 = new JComboBox();
    			N18.setBounds(new Rectangle(315, 450, 450, 20));
    		}
    		return N18;
    	}
    
    	/**
    	 * This method initializes N19	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN19() {
    		if (N19 == null) {
    			N19 = new JComboBox();
    			N19.setBounds(new Rectangle(315, 475, 450, 20));
    		}
    		return N19;
    	}
    
    	/**
    	 * This method initializes N20	
    	 * 	
    	 * @return javax.swing.JComboBox	
    	 */
    	private JComboBox getN20() {
    		if (N20 == null) {
    			N20 = new JComboBox();
    			N20.setBounds(new Rectangle(315, 500, 450, 20));
    		}
    		return N20;
    	}
    
    	/**
    	 * This method initializes H1	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH1() {
    		if (H1 == null) {
    			H1 = new JTextField();
    			H1.setBounds(new Rectangle(770, 25, 75, 20));
    		}
    		return H1;
    	}
    
    	/**
    	 * This method initializes H2	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH2() {
    		if (H2 == null) {
    			H2 = new JTextField();
    			H2.setBounds(new Rectangle(770, 50, 75, 20));
    		}
    		return H2;
    	}
    
    	/**
    	 * This method initializes H3	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD3() {
    		if (H3 == null) {
    			H3 = new JTextField();
    			H3.setBounds(new Rectangle(770, 75, 75, 20));
    		}
    		return H3;
    	}
    
    	/**
    	 * This method initializes H4	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH4() {
    		if (H4 == null) {
    			H4 = new JTextField();
    			H4.setBounds(new Rectangle(770, 100, 75, 20));
    		}
    		return H4;
    	}
    
    	/**
    	 * This method initializes H5	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH5() {
    		if (H5 == null) {
    			H5 = new JTextField();
    			H5.setBounds(new Rectangle(770, 125, 75, 20));
    		}
    		return H5;
    	}
    
    	/**
    	 * This method initializes H6	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH6() {
    		if (H6 == null) {
    			H6 = new JTextField();
    			H6.setBounds(new Rectangle(770, 150, 75, 20));
    		}
    		return H6;
    	}
    
    	/**
    	 * This method initializes H7	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH7() {
    		if (H7 == null) {
    			H7 = new JTextField();
    			H7.setBounds(new Rectangle(770, 175, 75, 20));
    		}
    		return H7;
    	}
    
    	/**
    	 * This method initializes H8	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH8() {
    		if (H8 == null) {
    			H8 = new JTextField();
    			H8.setBounds(new Rectangle(770, 200, 75, 20));
    		}
    		return H8;
    	}
    
    	/**
    	 * This method initializes H9	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH9() {
    		if (H9 == null) {
    			H9 = new JTextField();
    			H9.setBounds(new Rectangle(770, 225, 75, 20));
    		}
    		return H9;
    	}
    
    	/**
    	 * This method initializes H10	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH10() {
    		if (H10 == null) {
    			H10 = new JTextField();
    			H10.setBounds(new Rectangle(770, 250, 75, 20));
    		}
    		return H10;
    	}
    
    	/**
    	 * This method initializes H11	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH11() {
    		if (H11 == null) {
    			H11 = new JTextField();
    			H11.setBounds(new Rectangle(770, 275, 75, 20));
    		}
    		return H11;
    	}
    
    	/**
    	 * This method initializes H12	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH12() {
    		if (H12 == null) {
    			H12 = new JTextField();
    			H12.setBounds(new Rectangle(770, 300, 75, 20));
    		}
    		return H12;
    	}
    
    	/**
    	 * This method initializes H13	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH13() {
    		if (H13 == null) {
    			H13 = new JTextField();
    			H13.setBounds(new Rectangle(770, 325, 75, 20));
    		}
    		return H13;
    	}
    
    	/**
    	 * This method initializes H14	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH14() {
    		if (H14 == null) {
    			H14 = new JTextField();
    			H14.setBounds(new Rectangle(770, 350, 75, 20));
    		}
    		return H14;
    	}
    
    	/**
    	 * This method initializes H15	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH15() {
    		if (H15 == null) {
    			H15 = new JTextField();
    			H15.setBounds(new Rectangle(770, 375, 75, 20));
    		}
    		return H15;
    	}
    
    	/**
    	 * This method initializes H16	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH16() {
    		if (H16 == null) {
    			H16 = new JTextField();
    			H16.setBounds(new Rectangle(770, 400, 75, 20));
    		}
    		return H16;
    	}
    
    	/**
    	 * This method initializes H17	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH17() {
    		if (H17 == null) {
    			H17 = new JTextField();
    			H17.setBounds(new Rectangle(770, 425, 75, 20));
    		}
    		return H17;
    	}
    
    	/**
    	 * This method initializes H18	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH18() {
    		if (H18 == null) {
    			H18 = new JTextField();
    			H18.setBounds(new Rectangle(770, 450, 75, 20));
    		}
    		return H18;
    	}
    
    	/**
    	 * This method initializes H19	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH19() {
    		if (H19 == null) {
    			H19 = new JTextField();
    			H19.setBounds(new Rectangle(770, 475, 75, 20));
    		}
    		return H19;
    	}
    
    	/**
    	 * This method initializes H20	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH20() {
    		if (H20 == null) {
    			H20 = new JTextField();
    			H20.setBounds(new Rectangle(770, 500, 75, 20));
    		}
    		return H20;
    	}
    	
    	/**
    	 * This method initializes D1	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */	
    	private JTextField getD1() {
    		if (D1 == null) {
    			D1 = new JTextField();
    			D1.setBounds(new Rectangle(850, 25, 75, 20));
    		}
    		return D1;
    	}
    
    	/**
    	 * This method initializes D2	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD2() {
    		if (D2 == null) {
    			D2 = new JTextField();
    			D2.setBounds(new Rectangle(850, 50, 75, 20));
    		}
    		return D2;
    	}
    
    	/**
    	 * This method initializes D3	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getH3() {
    		if (D3 == null) {
    			D3 = new JTextField();
    			D3.setBounds(new Rectangle(850, 75, 75, 20));
    		}
    		return D3;
    	}
    
    	/**
    	 * This method initializes D4	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD4() {
    		if (D4 == null) {
    			D4 = new JTextField();
    			D4.setBounds(new Rectangle(850, 100, 75, 20));
    		}
    		return D4;
    	}
    
    	/**
    	 * This method initializes H5	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD5() {
    		if (D5 == null) {
    			D5 = new JTextField();
    			D5.setBounds(new Rectangle(850, 125, 75, 20));
    		}
    		return D5;
    	}
    
    	/**
    	 * This method initializes D6	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD6() {
    		if (D6 == null) {
    			D6 = new JTextField();
    			D6.setBounds(new Rectangle(850, 150, 75, 20));
    		}
    		return D6;
    	}
    
    	/**
    	 * This method initializes D7	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD7() {
    		if (D7 == null) {
    			D7 = new JTextField();
    			D7.setBounds(new Rectangle(850, 175, 75, 20));
    		}
    		return D7;
    	}
    
    	/**
    	 * This method initializes H8	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD8() {
    		if (D8 == null) {
    			D8 = new JTextField();
    			D8.setBounds(new Rectangle(850, 200, 75, 20));
    		}
    		return D8;
    	}
    
    	/**
    	 * This method initializes D9	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD9() {
    		if (D9 == null) {
    			D9 = new JTextField();
    			D9.setBounds(new Rectangle(850, 225, 75, 20));
    		}
    		return D9;
    	}
    
    	/**
    	 * This method initializes D10	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD10() {
    		if (D10 == null) {
    			D10 = new JTextField();
    			D10.setBounds(new Rectangle(850, 250, 75, 20));
    		}
    		return D10;
    	}
    
    	/**
    	 * This method initializes D11	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD11() {
    		if (D11 == null) {
    			D11 = new JTextField();
    			D11.setBounds(new Rectangle(850, 275, 75, 20));
    		}
    		return D11;
    	}
    
    	/**
    	 * This method initializes D12	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD12() {
    		if (D12 == null) {
    			D12 = new JTextField();
    			D12.setBounds(new Rectangle(850, 300, 75, 20));
    		}
    		return D12;
    	}
    
    	/**
    	 * This method initializes H13	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD13() {
    		if (D13 == null) {
    			D13 = new JTextField();
    			D13.setBounds(new Rectangle(850, 325, 75, 20));
    		}
    		return D13;
    	}
    
    	/**
    	 * This method initializes D14	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD14() {
    		if (D14 == null) {
    			D14 = new JTextField();
    			D14.setBounds(new Rectangle(850, 350, 75, 20));
    		}
    		return D14;
    	}
    
    	/**
    	 * This method initializes D15	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD15() {
    		if (D15 == null) {
    			D15 = new JTextField();
    			D15.setBounds(new Rectangle(850, 375, 75, 20));
    		}
    		return D15;
    	}
    
    	/**
    	 * This method initializes D16	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD16() {
    		if (D16 == null) {
    			D16 = new JTextField();
    			D16.setBounds(new Rectangle(850, 400, 75, 20));
    		}
    		return D16;
    	}
    
    	/**
    	 * This method initializes D17	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD17() {
    		if (D17 == null) {
    			D17 = new JTextField();
    			D17.setBounds(new Rectangle(850, 425, 75, 20));
    		}
    		return D17;
    	}
    
    	/**
    	 * This method initializes H18	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD18() {
    		if (D18 == null) {
    			D18 = new JTextField();
    			D18.setBounds(new Rectangle(850, 450, 75, 20));
    		}
    		return D18;
    	}
    
    	/**
    	 * This method initializes H19	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD19() {
    		if (D19 == null) {
    			D19 = new JTextField();
    			D19.setBounds(new Rectangle(850, 475, 75, 20));
    		}
    		return D19;
    	}
    
    	/**
    	 * This method initializes H20	
    	 * 	
    	 * @return javax.swing.JTextField	
    	 */
    	private JTextField getD20() {
    		if (D20 == null) {
    			D20 = new JTextField();
    			D20.setBounds(new Rectangle(850, 500, 75, 20));
    		}
    		return D20;
    	}
    	/**
    	 * Launches this application
    	 */
    	public static void main(String[] args) {
    		SwingUtilities.invokeLater(new Runnable() {
    			public void run() {
    				GUI1 application = new GUI1();
    				application.getNavigation().setVisible(true);
    				
    			}
    		});
    	}
    		
    }
    Last edited by Fubarable; 05-12-2011 at 04:48 PM. Reason: code tags added

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    That's a heck of a lot of code, and unformatted too making it difficult if not impossible to read. I will add code tags to help it be more readable but encourage you to read the link in my post that tells you how to do this yourself. You also need to post the actual error message, so we can see what your error message is and perhaps be able to translate it for you. Most importantly, perhaps you should tell us more exactly what you're trying to do from a user's perspective, not from a code perspective, because I suspect that you're eventually going to need to scrap all of that code and start over with a better design. A picture or diagram of the desired GUI might help too.

    Edit: on further review -- yep, scrap all that code. You want to view and interact with data in a tabular structure -- you want to use a JTable which will simplify and shorten (> 90%) your code immensely.
    Last edited by Fubarable; 05-12-2011 at 04:51 PM.

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    Can you edit your code and add the code tags around it keep the formatting?
    See: Java Forums - BB Code List

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    You want to view and interact with data in a tabular structure -- you want to use a JTable
    And whether or not you use a JTable, learn how to use layout managers and get rid of all that setBounds(...) garbage.
    Lesson: Laying Out Components Within a Container (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    Also, since you're programming GUIs, I would expect you to know about arrays, but you evidently don't.
    Arrays (The Java™ Tutorials > Learning the Java Language > Language Basics)

    db

  5. #5
    Paul_White is offline Member
    Join Date
    Apr 2011
    Posts
    15
    Rep Power
    0

    Default Thanks for the advice

    I take your point about tables but I was reading (I think in another thread) that JComboBoxes within tables were a bit of a no no. I will take what you say on board and start a GUI baes on a JTable and see how I get on.

    FYI

    I have quickly put together something in HTML so that I could take a screenshot and attach it to this reply. Please excuse the fact that I have not made it pretty but it shows the basic idea:

    The user needs to make three choices from dropdown lists:

    The first seaches the SQL database and returns the names of the tables. The results are input into the first JComoBox. These are the 50 US states the user may choose 1 only.

    Based on that choice a second query takes place and which returns a list of aviation related waypoints the user may then choose 1 only from this list.

    Based on both previous choices a third query takes place to provide a list of that particular waypoint type in that state.

    I need to do it this way as there are over 41,000 records in the database and this needs to be narrowed down before the result is displayed to the user in the third JComboBox.

    The process is repeated on row 2.
    My plan is then to call my calculation class to look at the two choices and calculate the distance between them and the compass track to follow to reach the destination.

    In my experimentation I have a class which is is calling the database and getting the desired result but for one choice only. This needs to be scaled up to about 20 rows each with the same three choices based on the same methods.

    This is the starting point for the main program which will look at all the other aspects of the flight.

    I have this fully working as an example in excel but I want to produce a program in Java which will do the same.

    I appreciate that this is probably not the best starting point in teaching yourself Java but given time I should (with some help) get to grips with this langauge and then hopefully be in a position like furable and richersoon to help others.
    Attached Thumbnails Attached Thumbnails Complex GUI 60 JComboBox + 40+ JTextBox-new-1.jpg  

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Paul_White View Post
    I take your point about tables but I was reading (I think in another thread) that JComboBoxes within tables were a bit of a no no. I will take what you say on board and start a GUI baes on a JTable and see how I get on.
    combo boxes can be used a the cell renderer for a table column, so this is definitely do-able, but will mean some more complexity to your program and more studying for you.

    I have quickly put together something in HTML so that I could take a screenshot and attach it to this reply. Please excuse the fact that I have not made it pretty but it shows the basic idea:

    The user needs to make three choices from dropdown lists:

    The first seaches the SQL database and returns the names of the tables. The results are input into the first JComoBox. These are the 50 US states the user may choose 1 only.

    Based on that choice a second query takes place and which returns a list of aviation related waypoints the user may then choose 1 only from this list.

    Based on both previous choices a third query takes place to provide a list of that particular waypoint type in that state.

    I need to do it this way as there are over 41,000 records in the database and this needs to be narrowed down before the result is displayed to the user in the third JComboBox.

    The process is repeated on row 2.
    My plan is then to call my calculation class to look at the two choices and calculate the distance between them and the compass track to follow to reach the destination.

    In my experimentation I have a class which is is calling the database and getting the desired result but for one choice only. This needs to be scaled up to about 20 rows each with the same three choices based on the same methods.

    This is the starting point for the main program which will look at all the other aspects of the flight.

    I have this fully working as an example in excel but I want to produce a program in Java which will do the same.

    I appreciate that this is probably not the best starting point in teaching yourself Java but given time I should (with some help) get to grips with this langauge and then hopefully be in a position like furable and richersoon to help others.
    Yeah, this is a big bite to chew. How much Java do you already know? Is this for an academic assignment or for work? If for work, will this be used only by you or by others as well (how bullet-proof and error-tolerant does it need to be)? You will also need to make sure that most all database access be done on a thread that is background to the main Swing thread, the EDT, and that most all Swing calls be made on the EDT, possibly by using a SwingWorker.

  7. #7
    Paul_White is offline Member
    Join Date
    Apr 2011
    Posts
    15
    Rep Power
    0

    Default

    This is a personal project.

    I am starting at zero java experience. I did do a little C about 10 years ago but this was a learning excersize and it did not go anywhere. This time I am going to teach myself Java not by reading a book as I did last time (which was a bit of a waste of time to be honest) and not by going to college which is how I learned assembler (the local college doesn't do Java) so I am doing a lot of reading articles on line to learn the bits I need and also looking at examples.

    The last time I wrote anything which was used commercially was in assember back when computers ran DOS but those days are now long gone and I need to get to grips with a modern language.

    I have chosen to try to produce something which would be useful to me in the process of my learning as it give me more incentive.

  8. #8
    Paul_White is offline Member
    Join Date
    Apr 2011
    Posts
    15
    Rep Power
    0

    Default

    Thank you all.

    I have found the problem. For some reason the problem was within the IDE. It could not find the files in the directories to run them.

    I couldn't even run HelloWorld!

    A reboot didn't help but creating another project and copying and pasting all the files there then deleting the old project both within the IDE and on HDD. Then re-creating the Project and copying back has fixed the problem and I can now run my GUI.

    Sorry for wasting everyones time on this one. You can probably understand that bein a newbie I automatically assumed I was the problem.

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Paul_White View Post
    Sorry for wasting everyones time on this one. You can probably understand that bein a newbie I automatically assumed I was the problem.
    I don't see any time being wasted here. You've got significant issues with the code you've posted that have been partially addressed by the forum members, regardless of your main problem.

Similar Threads

  1. Complex file input
    By JMaste in forum Advanced Java
    Replies: 4
    Last Post: 12-08-2010, 04:55 AM
  2. Replies: 2
    Last Post: 12-10-2009, 02:58 PM
  3. Jtextbox with dropdown list
    By vijay_s in forum AWT / Swing
    Replies: 1
    Last Post: 05-08-2008, 11:17 PM
  4. Jtextbox with dropdown list
    By vijay_s in forum AWT / Swing
    Replies: 3
    Last Post: 05-08-2008, 07:26 AM
  5. Complex Regular Expression HELP
    By hiklior in forum New To Java
    Replies: 1
    Last Post: 04-30-2008, 02:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •