LexarG56

Generation

generate functionThu, 20 Jul 2023

JComboBox con 5 model en un ActionPerformed para un boton registrar

// el jComboBox String[] lista = {"Uno", "Dos", "Tres", "Cuatro", "Cinco"}; JComboBox combo = new JComboBox(lista); JButton button = new JButton("registrar"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String selected = (String)combo.getSelectedItem(); System.out.println(selected); } });

Questions about programming?Chat with your personal AI assistant