Maria Lopez
Maria Lopez

Reputation: 61

jframe does not fit on the window

I was wondering how to set a JFrame to open up full screen in netbeans. I currently do this

Code:

this.setExtendedState(JFrame.MAXIMIZED_BOTH);

But some components in my frame end up off the screen. Its not working too well at all. I would like the components to all scale down so that on screens with lower resolutions the frame still fits all its parts in. enter image description here

Upvotes: 2

Views: 809

Answers (1)

eboix
eboix

Reputation: 5133

If your components don't show up on the JFrame, maybe you can try:

frame.pack();

And if you really want to go Full Screen, you can use:

frame.setUndecorated(true);

I hope this works.

Upvotes: 2

Related Questions