Hi, I am learning Java and i am staring with GUI and i want to make a short game with three Jframes that link to each other. that when the button on the first Jframe is pressed it will take you to the next panel that will say what you have chosen and then go to the third page to show the winner. Please help, i do not know how to switch between Jframes.
Well first of all, you can only design one of the JFrames at a time in WindowBuilder.
Second of all, take a look at JFrame.setDefaultCloseOperation() and swing.WindowConstants. Then decide if you want to have your JFrames HIDE_ON_CLOSE or DISPOSE_ON_CLOSE. Then setup your buttons with listeners which will close the current JFrame and open the next one.
Eric Clayberg Messages: 970 Registered: July 2009 Location: Boston, MA
As Michael said, you can use WindowBuilder to create your JFrames (one per class). The logic you use to tie your JFrames together is up to you and there are many ways that you could do it. Michael's suggestions are good. In general, however, this forum is not the correct place to ask Swing how-to questions.