This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes setDefaultCloseOperation on a JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "setDefaultCloseOperation on a JFrame" Watch "setDefaultCloseOperation on a JFrame" New topic

setDefaultCloseOperation on a JFrame

ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
I have the following section of code. I've gotten this before and solved it by having my class extend JFrame. This time I don't want to do that...
Here is the fragment

When the above code tries to compile, I get the error:
Cannot resolve symbol EXIT_ON_CLOSE.
Anyone know whats up?

Ryan Headley<br /><a href="" target="_blank" rel="nofollow"></a>
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
I believe that EXIT_ON_CLOSE is a static member of JFrame. Therefore, if you do NOT extend JFrame, you probably need to use the fully qualified name, i.e., JFrame.EXIT_ON_CLOSE.
Hope this helps.
ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
Thanx Steph...i can call ya "Steph" can't i??
That worked great...thanx a billion! Can't believe I didn't figure that out.
I agree. Here's the link:
subject: setDefaultCloseOperation on a JFrame
It's not a secret anymore!