Solved

Disable the Window close button on JFrame

Posted on 2003-10-30
4
798 Views
Last Modified: 2012-05-04
How to disable the Window close button (the top right corner x button) on JFrame, I would like to close application from menu.
0
Comment
Question by:ahTri
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
jimmack earned 50 total points
ID: 9654516
JFrame myFrame = new JFrame("A Frame");

myFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
0
 

Author Comment

by:ahTri
ID: 9654544
Cool, that's partly work now, however the button is not disable, so user still can click it, and they will question "why it's not closed when I click on the button?"
0
 

Author Comment

by:ahTri
ID: 9654581
I got it work out, thanks
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9654587
:-)
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java.io.BufferedReader   readLine()  //returns the entire file ? 4 73
Cipher Configuration on Apache HTTPD 4 63
Java Loop 6 62
hibernate insert example 13 29
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

803 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