public void setInvis(){ jpWillkommen.setVisible(false); jpXXX.setVisible(false); jpYYY.setVisible(false); jpZZZ.setVisible(false); } public void ComboBoxInhalteZeigen(String comboName){ setInvis(); if (comboName.equals("Willkommen")){jpWillkommen.setVisible(true);} else if (comboName.equals("XXX")){jpXXX.setVisible(true);} else if (comboName.equals("YYY")){jpYYY.setVisible(true);} else if (comboName.equals("ZZZ")){jpZZZ.setVisible(true);} } public JComboBox ComboBox() { JComboBox comboList; String[] comboStrings = {"Willkommen","----------","xxx", "YYY","ZZZ"}; comboList = new JComboBox(comboStrings); comboList.setBounds(5,235, 200, 20); comboList.setSelectedIndex(0); comboList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String comboName = (String)cb.getSelectedItem(); ComboBoxInhalteZeigen(comboName); } }); return comboList;}