• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1451
  • Last Modified:

Swing: Disabling Minimize on a JFrame


Hi,

I am writing an application. I am creating a small JFrame for an About Popup...that appears in the Help menu.

I am able to disable the Maximize in the dialog...by using   setResizable(false);
But I am unable to disable the minimze.

Ideally i would prefer If neither the maximize or minimize appeared at all...but I want to keep the XP Dialog header if possible. I could have used JWindow instead of JFrame...but that leaves me without that dialog header....as does the  setUndecorated(true);  on JFrame.

Can anyone offer any ideas please?
0
ShamD
Asked:
ShamD
  • 4
  • 3
  • 3
  • +1
1 Solution
 
CEHJCommented:
Use a JDialog - it just has a close button
0
 
sciuriwareCommented:
... or a JWindow which has no buttons at all.

;JOOP!
0
 
objectsCommented:
you can just remove the button
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ShamDAuthor Commented:

CEHJ,

If I use a JDialog, and want to add a JButton to it, thats funtionality would be to close the dialog, What line of code would I need to put in the actionPerformed method do this?
0
 
sciuriwareCommented:
setVisible(false);

;JOOP!
0
 
sciuriwareCommented:
And don't worry: you can add as many buttons as you like.

;JOOP!
0
 
ShamDAuthor Commented:
If I just setVisible to false, The Dialog is still open.
From a memory point of view, would this be bad design.
Is there an actual way to close it off?
0
 
sciuriwareCommented:
.destroy();
0
 
CEHJCommented:
>>Is there an actual way to close it off?

dialog.dispose();
0
 
ShamDAuthor Commented:
Thanks for all you help guys.
0
 
CEHJCommented:
:-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now