I have created in my Java Swing application a main window with a JButton. I have added to this button an event listener class (implementing the ActionListener interface) which, every time the button is clicked, launches a “pop-up” window.
The method works fine when the button is clicked, except when the button is clicked for the first time, as it does nothing. Does anyone know the reason behind such behaviour?
I have created in my Java Swing application a main window with a JButton.
Share
A simpler way is perhaps to provide an
AbstractAction. You could try the approach outlined below. (It shows a popup-window when the button is clicked.)