Salve ragazz, ho un problema. Vorrei realizzare utilizzando l'interfaccia grafica java una cosa del genere:

Una tabella che prende i dati dal database, (la tabella l'ho creata e i dati dal database sono corretti);

sotto la tabella delle text box in cui posso inserire dei valori per formulare delle query

il risultato che ottengo è la tabella che mostra una sola riga e le text sotto mi potete aiutare a sistemarla???

mostro un po di codice

codice:
public class GridBagLayoutDemo {
	static Database db;
    final static boolean shouldFill = true;
    final static boolean shouldWeightX = true;
    final static boolean RIGHT_TO_LEFT = false;
    JTextArea output;
    JScrollPane scrollPane;
    static JFrame frame;
    public static Component addComponentsToPane(Container pane) {
        if (RIGHT_TO_LEFT) {
            pane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
        }
        JScrollPane jScrollPane1,jScrollPane2;
        JLabel labelSpazio;
        JLabel labelCodiceLocalita;
        final JTextField textCodiceLocalita ;
        JLabel labelOraPartenze;
        final JTextField textOraPartenze;
        JLabel labelCodice1Nota;
        final JTextField textCodice1Nota;
        JLabel labelCodice2Nota;
        final JTextField textCodice2Nota;
        JLabel labelOraArrivoDa;
        final JTextField textOraArrivoDa;
        JLabel labelOraPartenzaPer;
        final JTextField textOraPartenzaPer;
        JLabel labelCodice1NotaBis;
        final JTextField textCodice1NotaBis;
        JLabel labelCodice2NotaBis;
        final JTextField textCodice2NotaBis;
        JLabel labelOraArrivoPer;
        final JTextField textOraArrivoPer;
        JButton buttonInserisci;
        
	pane.setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	if (shouldFill) {
	//natural height, maximum width
	c.fill = GridBagConstraints.HORIZONTAL;
	}
	
	inizializzaDatabase();
	//devo aggiungere una tabella
	Vector v = db.eseguiQuery( "SELECT * FROM archiviopartenzeferiali  ;" );
	Vector vettore = new Vector();
    
    vettore.add(new String("CODICE LOCALITA"));
    vettore.add(new String("ORA PARTENZA"));
    vettore.add(new String("NOTA"));
    vettore.add(new String("NOTA BIS"));
    vettore.add(new String("ORA ARRIVO"));
    vettore.add(new String("ORA PARTENZA PER"));
    vettore.add(new String("NOTA"));
    vettore.add(new String("NOTA BIS"));
    
    JTable table = new JTable(v, vettore);
    System.out.println("Sono qui");
    jScrollPane1 = new javax.swing.JScrollPane();
    System.out.println("Sono qui");
    jScrollPane1.setName("jScrollPane1");
    System.out.println("Sono qui");
    jScrollPane1.setViewportView(table);
    System.out.println("Sono qui");
   JPanel panel = new JPanel();
 
   panel.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);

	c.gridx = 0;
	c.gridy = 0;
	pane.add(panel, c);
    
	labelCodiceLocalita = new JLabel("Codice Località: ");
	if (shouldWeightX) {
	c.weightx = 0.5;
	}
	c.fill = GridBagConstraints.HORIZONTAL;
	c.gridx = 0;
	c.gridy = 0;
	pane.add(labelCodiceLocalita, c);
	
	
	textCodiceLocalita = new JTextField();
	if (shouldWeightX) {
	c.weightx = 0.5;
	}
	c.fill = GridBagConstraints.HORIZONTAL;
	c.gridx = 0;
	c.gridy = 1;
	pane.add(textCodiceLocalita, c);

	labelOraPartenze = new JLabel("Ora Partenza: ");
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 20;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 2;
	pane.add(labelOraPartenze, c);
	
	textOraPartenze = new JTextField();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 1;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 3;
	pane.add(textOraPartenze, c);
	
	labelCodice1Nota = new JLabel("Codice 1 nota");
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 20;
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 4;
	pane.add(labelCodice1Nota, c);

	textCodice1Nota = new JTextField();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 1;
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 5;
	pane.add(textCodice1Nota, c);

	labelCodice2Nota = new JLabel("Codice 2 Nota: ");
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 20;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 6;
	pane.add(labelCodice2Nota, c);

	textCodice2Nota = new JTextField();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 1;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 7;
	pane.add(textCodice2Nota, c);
	
	labelOraArrivoDa = new JLabel("Ora arrivo da: ");
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 20;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 8;
	pane.add(labelOraArrivoDa, c);

	textOraArrivoDa = new JTextField();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 1;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 9;
	pane.add(textOraArrivoDa, c);
	
	labelOraPartenzaPer = new JLabel("Ora partenza per: ");
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 20;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 10;
	pane.add(labelOraPartenzaPer, c);

	textOraPartenzaPer = new JTextField();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 1;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 11;
	pane.add(textOraPartenzaPer, c);
	
	labelCodice1NotaBis = new JLabel("Codice 1° nota bis: ");
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 20;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 12;
	pane.add(labelCodice1NotaBis, c);

	textCodice1NotaBis = new JTextField();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 1;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 13;
	pane.add(textCodice1NotaBis, c);
	
	labelCodice2NotaBis = new JLabel("Codice 2° nota bis: ");
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 20;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 14;
	pane.add(labelCodice2NotaBis, c);

	textCodice2NotaBis = new JTextField();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 1;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 15;
	pane.add(textCodice2NotaBis, c);
	
	labelOraArrivoPer = new JLabel("Ora Arrivo per: ");
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 20;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 16;
	pane.add(labelOraArrivoPer, c);

	textOraArrivoPer = new JTextField();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 1;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 17;
	pane.add(textOraArrivoPer, c);
	
	//creo uno spazio
	labelSpazio = new JLabel("");
	
	c.fill = GridBagConstraints.HORIZONTAL;
	c.ipady = 10;      //make this component tall
	c.weightx = 0.0;
	c.gridwidth = 3;

	c.gridx = 0;
	c.gridy = 18;
	pane.add(labelSpazio, c);
	
	buttonInserisci = new JButton();
	buttonInserisci.setText("Salva");
	c.fill = GridBagConstraints.VERTICAL;
	c.ipady = 10;      //make this component tall
	c.weightx = 0.0;
	c.gridheight = 10;
	c.gridwidth = 3;
	c.gridx = 0;
	c.gridy = 19;
	pane.add(buttonInserisci, c);
	
	buttonInserisci.addActionListener( new ActionListener() {
        public void actionPerformed( ActionEvent e ) {
            
        	int codiceLocalita = Integer.parseInt(textCodiceLocalita.getText());
        	
            String oraPartenza = textOraPartenze.getText();
            int codice1Nota = Integer.parseInt(textCodice1Nota.getText());
            int codice2Nota = Integer.parseInt(textCodice2Nota.getText());
            String oraArrivoDa = textOraArrivoDa.getText();
            String oraPartenzaPer = textOraPartenzaPer.getText();
            int codice1NotaBis = Integer.parseInt(textCodice1NotaBis.getText());
            int codice2NotaBis = Integer.parseInt(textCodice2NotaBis.getText());
            String oraArrivoPer = textOraArrivoPer.getText();
            
          
             db.eseguiAggiornamento("INSERT INTO archiviopartenzeferiali VALUES ('"+codiceLocalita+"', '"+oraPartenza+"', '"+codice1Nota+"', '"+codice2Nota+"', '"+oraArrivoDa+"', '"+oraPartenzaPer+"', '"+codice1NotaBis+"', '"+codice2NotaBis+"', '"+oraArrivoPer+"') ;");
           
            System.out.println("Ho eseguito la query");
        }//fine actionperdormed

		
		
    });//fine actionlistener
	/*questo blocco di codice serve per fragare il prog
	 * 
	 */
	JTextField textOraArrivoper2 = new JTextField();
	textOraArrivoper2.setVisible(false);
	return textOraArrivoper2;
	
    }
il layout è il seguente



altra domanda, sarebbe possibile visualizzare le text più strette?

la tabella in questo layout mosra una solo riga di dati in realtà le righe che contiene ne sono 10 se cancello la label di sotto viene mostrata anche la seconda riga e così via

mi potete aiutare???