Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-10-31
5
Medium Priority
?
865 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 750 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

688 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