Solved

How to remove the "X" closing button from a JDialog box?

Posted on 2003-10-31
5
723 Views
Last Modified: 2007-12-19
How to remove the "X" closing button from a JDialog box?
i don't want to just disable the closing action writing my own event handlers.
I don't want the 'X' button to be seen at all.
0
Comment
Question by:sharath_kulal
[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
  • 4
5 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 9656438
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9656446
Something like:

dlg.setUndecorated( true );
dlg.getRootPane().setWindowDecorationStyle ( JRootPane. PLAIN_DIALOG );
0
 
LVL 1

Author Comment

by:sharath_kulal
ID: 9656593
But i want the title bar to be displayed
0
 
LVL 35

Accepted Solution

by:
TimYates earned 250 total points
ID: 9656623
That should show the title dialog..

    JDialog dlg = new JDialog( new Frame(), true ) ;
    dlg.setUndecorated( true );
    dlg.getRootPane().setWindowDecorationStyle( JRootPane.PLAIN_DIALOG );
    dlg.setTitle( "Test Dialog" );
    dlg.setSize( new Dimension( 320, 200 ) ) ;
    dlg.show() ;

Shows the title bar...but no close button...

0
 
LVL 35

Expert Comment

by:TimYates
ID: 9656624
you mean the system title bar?

You can't get rid of the system close button...that's put there by the system...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

734 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