I have a frame (called from the main window) with button, on click it run a cycle, in console i see: 1 2 3 4 5
The frame is closed by setDefaultCloseOperation (JFrame.DISPOSE_ON_CLOSE);
If I close the frame, and reopen it again, when click on the button in the console displays
1 2 3 4 5 1 2 3 4 5
the output is duplicate and so will increase each time when I re-open the frame (up to a complete restart of the program).
Please help! How to close the frame (without closing the program) without duplicate. Thank!