fireTableDataChanged() java

Advertisements Why does my model update the JTable view even if I do not call the fireTableDataChanged() ? Is this normal behaviour? @Override public void updateGUI(GUIUpdateEvent obj) { System.out.println("updategui"); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { data[i][j] = obj.getBoard()[i][j].getCurrentPawnOnField().getChessIcon(); } } //fireTableDataChanged();… Read More fireTableDataChanged() java

Java update Label automatically every time an MQTT message arrives

Advertisements I am getting MQTT messages using a Java program and I am using Java swing to represent data. The problem is that I have to click a button to update jlabel in order to get new values. I am trying to do this automatically every time I get a new message. import org.eclipse.paho.client.mqttv3.MqttException; import… Read More Java update Label automatically every time an MQTT message arrives

else if statement java gui wont execute

Advertisements I have been trying to make a java GUI distance converter. My else if statement won’t execute, only the first if statement execute. Does anyone know why i wont executed? Below is my coding and the output. import javax.swing.*; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.*; public class DistanceCalculator implements ActionListener { private JFrame frame;… Read More else if statement java gui wont execute

How to check the state of a dynamically generated JCheckBox in an action listener

Advertisements I have created dynamic JChekboxes that is linked to a file. I want to see which ones are checked via an action listener. I have tried getSource(), I have tried getState() none of them are working… for (int f = 0; f < numberCheckBox[0]; f++) { String line1 = tableLines[f].toString().trim(); String[] dataRow1 = line1.split("/");… Read More How to check the state of a dynamically generated JCheckBox in an action listener