I put a System.out.println() to check both cases and it seems the jClicked never gets called when I made a menu Item, so I had to use ActionPerformed...

Right now it does not work correctly, maybe someone can give me advice..
I am connecting to a COM Port and I made a button to change to COM port # and update, but right now the number does not change when I click the button....

I tried making an oldValue and newValue but it doesn't seem to work out well....

Code:
public class ReadThread extends Thread 
{
    private boolean sw1;
    private boolean sw2;
    private boolean sw3;
    private boolean sw4;
    private String comValue = "COM1";
    private String newComValue;
    private String oldComValue;
    
   @Override
    public void run()
    {
        CommPortIdentifier portId1;      
        InputStream inputStream;
        SerialPort serialPort1;
        try
        {        
            portId1 = CommPortIdentifier.getPortIdentifier(comValue);
            serialPort1 = (SerialPort) portId1.open("ComControl", 2000);
            serialPort1.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
            
            inputStream = serialPort1.getInputStream();
            
            int x = inputStream.read();
            while(true)
            {
                if(x == 0)
                {
                    sw1 = true;
                }
                if(x == 1)
                {
                    sw1 = false;
                }
                if(x == 2)
                {
                    sw2 = true;
                }
                if(x == 3)
                {
                    sw2 = false;
                }
                if(x == 4)
                {
                    sw3 = true;
                }
                if(x == 5)
                {
                    sw3 = false;
                }
                if(x == 6)
                {
                    sw4 = true;
                }
                if(x == 7)
                {
                    sw4 = false;
                }
                x = inputStream.read();

                if(comValue.equalsIgnoreCase(newComValue) == false)
                {
                    portId1 = CommPortIdentifier.getPortIdentifier(newComValue);
                    serialPort1 = (SerialPort) portId1.open("ComControl", 2000);
                    serialPort1.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);

                    inputStream = serialPort1.getInputStream();

                    oldComValue = newComValue;
                }

                /*
                if(comValue.equalsIgnoreCase(oldComValue) == false)
                {
                    portId1 = CommPortIdentifier.getPortIdentifier(newComValue);        
                    serialPort1 = (SerialPort) portId1.open("ComControl", 2000);
                    serialPort1.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
            
                    inputStream = serialPort1.getInputStream();
                    oldComValue = newComValue;
                    System.out.println(newComValue);
                }
                 */
            }
        }catch(Exception e)
        {
            e.printStackTrace();
        }
    }
    
    public boolean getSW1()
    {
        return sw1;
    }
    
    public boolean getSW2()
    {
        return sw2;
    }
    
    public boolean getSW3()
    {
        return sw3;
    }
    
    public boolean getSW4()
    {
        return sw4;
    }
    
    public void setComPort(String COM)
    {
        oldComValue = comValue;
        newComValue = COM;
        comValue = newComValue;
    }
        /*
        oldComValue = comValue;
        newComValue = COM;
        comValue = newComValue;
         */
    public String getComPort()
    {
        return comValue;
    }
    
   
}
Code:
<*MAIN*>

private void jcom4MenuActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    rT.setComPort("COM4");
    System.out.println("COM4");
}

private void jcom3MenuActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    rT.setComPort("COM3");
    System.out.println("COM3");
}

private void jcom1MenuActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    rT.setComPort("COM1");
    System.out.println("COM1");
}