Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

Window - JDialog Question

Hey all,
I am translating a C++ program to Java and have come across a pickle.  I need to have a window (or Jdialog or JFrame) that does have a title bar, is external to the applet, but is NOT maximizable/minimizable. That is, it does NOT have the [], or 'X' in the top right of the window at all.  Any ideas on how to do this in Java?  Should I go with a JDialog and hide the X and [] or with a JWindow and try to add a title bar?


Rob
0
robin_at_mri
Asked:
robin_at_mri
  • 3
  • 3
  • 2
  • +4
1 Solution
 
antonsigurCommented:
What about this constructor:
JDialog(Frame owner, String title). This one has title, right?
0
 
robin_at_mriAuthor Commented:
It has the title, but it also has the 'X' and '[]' buttons at the far right of the title bar.


Rob
0
 
robin_at_mriAuthor Commented:
Well the 'X' anyways.  Trying to figure out how to get rid of that 'X' that closes the JDialog.


Rob
0
Independent Software Vendors: 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!

 
antonsigurCommented:
Ok, you could:
       JDialog d = new JDialog(this, "The title", true);
       d.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);

Now the dialog won't close, even if the buttom is pressed, however, the buttom is still here..
0
 
robin_at_mriAuthor Commented:
Yeah I already have that setup.  The only good way to do it is to create it without the X button and without the icon.  I am surprised that Java doesn't have some upper level container that looks like that.


Rob
0
 
antonsigurCommented:
I think you can't remove the buttom.... hmm... I have never seen a Java frame with no buttom on it....
0
 
sct75Commented:
You'd better go with JWindow or Window at start point and try to add a tool bar in, because there seems no way to turn off "X" or "[]" on JDialog or JFrame.

When using JWindow or Window, you could grab its rootPane and set a BorderLayout and put the ToolBar to the North of it.

Good luck.
0
 
shji1Commented:
You can try and use the setUndecorated(false) method.
Make sure you do that before you display the dialog or frame.
--
0
 
sct75Commented:
We once used Window as superclass to create a splash screen look screen at startup. So I pretty sure descendents of Window would work. Adding toolbar like general components to a Window container should be fairly easy then.
0
 
CleanupPingCommented:
robin_at_mri:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
girionisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQed and points NOT refunded.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0
 
YensidModCommented:
This question is PAQed  and no points refunded (of 35).

YensidMod
Community Support Moderator
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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