Window Manipulation (Java/Swing)

Elmo187

Limp Gawd
Joined
Jun 7, 2003
Messages
291
I'm in the process of designing a Battleship-type game for the final project of my Java course. I have a couple fairly basic questions about Swing that I can't seem to find the answers to.

1) How would you go about preventing the user from resizing a window?

2) How would you go about removing a specific window from the screen?(eg. A button on Window A opens a new window, then Window A is removed from the screen.)
 
1) try setResizable(false)

2) Depends on how you want it removed. You could use setVisible(false), or perhaps hide(). dispose() should also work.

All of these features are well documented
 
Back
Top