0
I have a class that inherits from JFrame
and has a JComboBox comboBoxPorta = new JComboBox();
.
I would like to popular this combo with the serial ports. I have a function in another class to print this procedure.
public void popularComboPorta() {
String[] portNames = SerialPortList.getPortNames();
for (String portName : portNames) {
//System.out.println(portName);
JOptionPane.showMessageDialog(null, "Inicio Impressao" + portName);
}
Using existing examples, you have to create a function in the form class by returning to JComboBox
, but of error saying that the class is not solved.
It seems so simple but I’m standing by it.