P
Peter06
Gast
hallo ich bin heute zu ersten mal mit der JComboBox konfrotiert. Ich habe eine JComboBox und einen JButton. ich möchte nun, dass der ausgewählte wert in der JComboBox in einem label ausgegeben wird, bzw. zuerstmal nur als System.out.print
Meine JComboBox:
Das actionPerformed für meinen Button b1 habe ich auch schon jetzt weis ich nur nicht wie ich im actionPerformed auf meine JCombox zugreifen kann.
gibt es da etwas änliches wie outList.getText()????
Meine JComboBox:
Code:
String[] outsStr = {" 0 ", " 1 ", " 2 ", " - "};
outList = new JComboBox(outsStr);
outList.setSelectedIndex(3);
outList.addActionListener(this);
outList.setLocation(150,265);
outList.setSize(80,20);
add(outList);
Das actionPerformed für meinen Button b1 habe ich auch schon jetzt weis ich nur nicht wie ich im actionPerformed auf meine JCombox zugreifen kann.
gibt es da etwas änliches wie outList.getText()????