combobox
Hi
wel basically i have to make a task (for school) with 5 TextFields , 1 combobox and 1 button
if you press on that button then the data should get under it
i have got two problems how to get a selected item out of an combobox and how to get the data under it
if someone could help me
thanks
this is what i have already done
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
class TekstvakEnKnopPaneel extends JPanel {
private JTextField tekstvak1,tekstvak2,tekstvak3,tekstvak4,tekstvak5;
private JButton knop;
private JComboBox box;
public TekstvakEnKnopPaneel() {
tekstvak1 = new JTextField (20);
tekstvak1.setText ("Name");
tekstvak2 = new JTextField (20)
tekstvak2.setText ("Voornaam");
tekstvak3 = new JTextField (30);
tekstvak3.setText ("Adres");
tekstvak4 = new JTextField (4);
tekstvak4.setText ("Postcode");
tekstvak5 = new JTextField (20);
tekstvak5.setText ("Plaats");
JComboBox box = new JComboBox();
String[] item = { "Mevrouw", "Mijnheer"};
box = new JComboBox(item);
ActionListener handler = new Handler();
knop = new JButton ("Klik hier");
knop.addActionListener(handler);
add( tekstvak1 );
add( tekstvak2 );
add( tekstvak3 );
add( tekstvak4 );
add( tekstvak5 );
add( knop );
add( box);
}
class Handler implements ActionListener {
public void actionPerformed( ActionEvent e ) {
if(e.getSource() == knop);
}
}
}

