?
Solved

Window - JDialog Question

Posted on 2003-03-13
12
Medium Priority
?
449 Views
Last Modified: 2012-08-13
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
Comment
Question by:robin_at_mri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +4
12 Comments
 
LVL 2

Expert Comment

by:antonsigur
ID: 8131207
What about this constructor:
JDialog(Frame owner, String title). This one has title, right?
0
 

Author Comment

by:robin_at_mri
ID: 8131240
It has the title, but it also has the 'X' and '[]' buttons at the far right of the title bar.


Rob
0
 

Author Comment

by:robin_at_mri
ID: 8131253
Well the 'X' anyways.  Trying to figure out how to get rid of that 'X' that closes the JDialog.


Rob
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Expert Comment

by:antonsigur
ID: 8131339
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
 

Author Comment

by:robin_at_mri
ID: 8131376
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
 
LVL 2

Expert Comment

by:antonsigur
ID: 8131393
I think you can't remove the buttom.... hmm... I have never seen a Java frame with no buttom on it....
0
 
LVL 1

Expert Comment

by:sct75
ID: 8132517
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
 
LVL 1

Expert Comment

by:shji1
ID: 8132696
You can try and use the setUndecorated(false) method.
Make sure you do that before you display the dialog or frame.
--
0
 
LVL 1

Expert Comment

by:sct75
ID: 8132752
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
 

Expert Comment

by:CleanupPing
ID: 9058706
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
 
LVL 35

Expert Comment

by:girionis
ID: 9762732
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
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9814213
This question is PAQed  and no points refunded (of 35).

YensidMod
Community Support Moderator
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question