This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Mac closes multiple windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Mac closes multiple windows" Watch "Mac closes multiple windows" New topic
Author

Mac closes multiple windows

Pres Brawner
Ranch Hand

Joined: Jan 18, 2001
Posts: 92
In Win OS based systems my code works. In Mac it fails. The system behavior is this: The base window is a JFrame. It has floating above it a JDialog. An error displays (JOptionPane).
User behavior: The user hits: ESC
Observered behavior (mac only): Both the JOptionPane error window, and the JDialog content window close.
Desired behavior: Only the JOptionPane window should close.
My code: Can't give you line by line, but the idea is that I have a KeyListener for the entire JDialog window. It catches all keyPressed. I have an event.consume(); in the keyPressed.
I put a System.out.println statement in the KeyPressed method. It only displays once suggesting that the keyPressed only gets processed once.
Is the super() method closing both windows?
Thanks everyone,
Pres
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Mac closes multiple windows
 
Similar Threads
JOptionPane behavior
problem with JDialog
Mac Java runtime, JDialog getting stuck behind parent JDialog
partial display of JOptionPane
Calling JDialog from JDialog - Urgent please...