Hi.I would like to ask if an ActionListener can take a do-while loop.
I have this MenuFrame that the JButtons won't come out everytime I click it but it is running.
Everytime I remove the do-while loop the MenuFrame will come out with the JButtons.
Any suggestion on what shall I do?

Sounds like you may be running your loop on Swing's thread (eg in a listener method). When swing calls one of your methods it doesn't do anything else until your method returns.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.