Mahdi_Nine Mahdi_Nine - 1 year ago 49
Java Question

How can I remove just the Maximize button from a JFrame?

I have a JFrame and want to remove the maximize button from that.

I wrote the code below, but it removed maximize, minimize, and close from my

JFrame
.

JFrame frame = new JFrame();
frame.add(kart);
frame.setUndecorated(true);
frame.setVisible(true);
frame.setSize(400, 400);


I want to only remove the maximize button from the
JFrame
.

sjr sjr
Answer Source

Make it not resizable:

frame.setResizable(false);

You will still have the minimize and close buttons.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download