I have the following Java
Code which adds a JRadioButton
to a JPanel
and handles its mouse click event
JRadioButton offline = new JRadioButton();
offline.setText("Offline Mode");
modePanel.add(offline);
modePanel.setLayout(new GridLayout(2,1));
offline.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
offlineClicked(evt);
}
});
The function offlineClicked
takes roughly around 1 min to be executed completely.
And until its execution is completed no other actions performed are handled.
All actions performed thereafter seem to go to a Eventqueue and handled FIFO when the offlineClicked
has completed execution.
Due to this the UI seems to have gone into a hung state.
What can be done to make swing handle events concurrently and not wait till the last is executed completely.