I have made a tetris game on my own and am trying to have options in the menu where when clicked, will change the frame to that size such as small, medium, large. I am trying to do this on a frame and at first I tried setting the preferred method for each menu item respectively using Abstract Listeners but it didn't work. I can't think of how to go about resizing a window. any suggestions? Thanks!

Recommended Answers

You don't say what layout manager you are using, but you could resize the components in the window depending on which menu item is selected, then pack() the window so it fits the re-sized components.

Jump to Post

All 2 Replies

You don't say what layout manager you are using, but you could resize the components in the window depending on which menu item is selected, then pack() the window so it fits the re-sized components.

I'm sorry, I am using BorderLayout and I also figured it out :)
I used a method called setSize(Dimension);

Be a part of the DaniWeb community

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