I was developing fixed-size Swing application, but now I need to allow user to switch to fullscreen mode. I don’t want to allow custom resizing of JFrame for not refactoring all components’ sizes and staff – only fullscreen. So that in fullscreen mode I’ll need to resize 1 jTabbedPane and move few other components.
How can I do this?
I was developing fixed-size Swing application, but now I need to allow user to
Share
The simplest way is to use a layout manager that allows for resizing.
Otherwise, you add a ComponentListener to the JFrame. Write the
componentResizedmethod so that any attempt to resize the JFrame resets the original size.Unless your audience for this application is limited, different users have different full screen sizes.