File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes Modal JDialog not always on top Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "Modal JDialog not always on top" Watch "Modal JDialog not always on top" New topic
Author

Modal JDialog not always on top

Jason Moore
Greenhorn

Joined: Sep 11, 2001
Posts: 10
How do you make a modal JDialog remain on top when you switch between applications. I've noticed this works JOptionPane, but it doesn't work with JDialog. Also, if you Alt-Tab between windows this problem does not occur, only when you switch between windows by clicking the icons on the taskbar. WindowsNT, JDK 1.3.1
Gregg Bolinger
Sheriff

Joined: Jul 11, 2001
Posts: 15040

you can't set the parent window to null, so instead of JDialog.showMessageDialog(null, "fjdskajf") you would have JDialog.showMessageDialog(yourparentWindow, "fjdlsajlf")


------------------
Happy Coding,
Gregg Bolinger


My Blog | DZone Articles
 
 
subject: Modal JDialog not always on top
 
Threads others viewed
JDialog questions
Annoying quirk with JDialog on Windows 7
Creating modal in JInternalFrame
Close Dialog Box(Urgent!)
modal dialog always on top
IntelliJ Java IDE