• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Dialogs lose focus when minimizing and restoring the application

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a problem as below:
Dialog(s) lose focus when minimizing and restoring the application and therefore fall behind the main application window. The user is required to find and close the dialog(s)
before continuing with any other operation.
This occures when the user clicks the Show Desktop icon in the task bar. Restore the application by clicking on the application icon in the task bar.
Observe: The dialog has fallen behind the main application window. Must presee Alt + Tab keys to restore focus on the dialog.
Anybody knows how to solve such a problem? Thanks anyway.
Jeff
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you minimize the App with a Dialog window open? When my dialogs open, I can't do anything until I lose the Dialog. That includes minimizing any part of my App.
Also, are you using AWT or SWING.
------------------
Happy Coding,
Gregg Bolinger
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, sorry about that last replay. I just figured out what you meant. Sorry about that. I am looking into it though.

------------------
Happy Coding,
Gregg Bolinger
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Have you used "null" as the parameter for
showSaveDialog(Component parent)/ showOpenDialog(Component parent) function.
If so then replace null with the main JFrame class instance (assuming your main class is a JFrame).
It should work..
Bye

Originally posted by Jeff Chang:
Hi,
I have a problem as below:
Dialog(s) lose focus when minimizing and restoring the application and therefore fall behind the main application window. The user is required to find and close the dialog(s)
before continuing with any other operation.
This occures when the user clicks the Show Desktop icon in the task bar. Restore the application by clicking on the application icon in the task bar.
Observe: The dialog has fallen behind the main application window. Must presee Alt + Tab keys to restore focus on the dialog.
Anybody knows how to solve such a problem? Thanks anyway.
Jeff


 
Greenhorn
Posts: 20
MyEclipse IDE Windows XP Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I just had the same problem with somebody's code, I inheritted. The way I solved it was that when the dialog was opened, the dialog is a class extending from JDialog and the previous programmer was instantiating with the constructor taking JFrame as a parameter. The frame object was a new object for some reason. That's why dialog had no connection with your main application window.
You have to give "this" instead of a new JFrame. Provided your main application window is a JFrame.
 
Dima Riabin
Greenhorn
Posts: 20
MyEclipse IDE Windows XP Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Govind Kurup wrote:Hello,
Have you used "null" as the parameter for
showSaveDialog(Component parent)/ showOpenDialog(Component parent) function.
If so then replace null with the main JFrame class instance (assuming your main class is a JFrame).
It should work..



Thanks. That was exactly what it was. There was null passed as a parent parameter....
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!