|
Hi,
I'm trying to create a button that opens a new window for setting up a whole crapload of constants for an analysis program.
For this, I have a JButton. The actionPerformed-method activates another method in the master class, which creates a new JFrame. The JFrame contains a JTable which has it's own TableModel, also residing within the master class. The JTable reads it's data from an array, which is updated or not depending on the user's choice (save/cancel buttons in the new window). When the new window is closed, the JFrame is disposed() of.
The problem is that the first time the new JFrame becomes visible only after the 2nd click of the button. After that it opens with every click. But, any updates made to the editable JTable are not visible the very next time the new window is opened, but become visible after that. So, almost everything runs one click too late.
Maybe it's some kinda thread problem? Since I call the frame-creating-method from the actionPerformed-method, I suppose the control stays with the Event Dispatching Thread, but creating the table and the new frame shouldn't take much time, so I don't see how that would be a problem.
Any help would be much appreciated! Regards,
Gimzo
|