0

Is there a way to remove the maximize button and leave the minimize button and close button without using JDialog. I already know you can set resizable to false like this:

frame = new JFrame();
frame.setResizable(false);
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

but I want to just get rid of the button. Is that possible at all?

apkisbossin
  • 336
  • 1
  • 3
  • 16
  • 2
    Why don't you want to use a JDialog? See also: http://stackoverflow.com/questions/2665355/how-do-i-remove-the-maximize-and-minimize-buttons-from-a-jframe – Kevin Workman Apr 09 '14 at 18:30
  • Because you cannot have the minimize button, I still want the minimize button and the close button but not the Maximize button – apkisbossin Apr 09 '14 at 19:38
  • 1
    This can't be done within Java – MadProgrammer Apr 10 '14 at 01:59
  • You can use JWindow and provide your own controls – PKopachevsky Apr 10 '14 at 06:09
  • It is possible to remove the Maximize button ( or Minimize or Close ) if your app meets specific OS and Look & Feel conditions. Are you looking for a cross-platform solution or a specific OS solution? Cross-platform solution is limited to Java (ie Swing) look and feel. In any case, operating outside of the standard JFrame & JDialog frame control set is not advisable but I understand sometimes there are specific needs. – Java42 Jun 04 '14 at 18:30
  • Well I was testing on Windows and Linux so Cross-platform solution. And I was trying to do it for looks but if it cannot be done, or if it looks worse than I just wont do it. – apkisbossin Jun 11 '14 at 13:49

0 Answers0