Your Question:
I know how to add the combobox and textfield to the panel but At the moment it doesn't even print out the test to the console.
Answer:
Store the reference of
JcomboBox
some where and then check the source inActionListener
.
do in this way:
final JComboBox comboBox = new JComboBox(onderdelenBox());
onderdelenGebruikt.add(comboBox);
comboBox.addActionListener(MyFrame.this);
Your ActionListener
will look like this.
if( eventSource == comboBox ){
System.out.println("test");
}