• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JDiaog window remain always on top

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a JDialog window which remain always on top even if I select the previous window.

what is the change i need to do so that the JDialog window goes in back when i select parent window?
Or do i need to use something else than JDialog?

Thanks!
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pinks M wrote:Hi,

I have a JDialog window which remain always on top even if I select the previous window.

what is the change i need to do so that the JDialog window goes in back when i select parent window?
Or do i need to use something else than JDialog?

Thanks!



Just use dialog.setModal(false);
 
Priya Lavti
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, I am doing the same.
But even then the dialog appears on top of parent window after selecting the parent window.

The JDiaog window is still shown on top of parent window but is inactive state (i.e. not selected/focused). It hinders the view of parent window when doing any operation on parent window.

 
santhosh varala kumar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Priya Lavti wrote:yes, I am doing the same.
But even then the dialog appears on top of parent window after selecting the parent window.

The JDiaog window is still shown on top of parent window but is inactive state (i.e. not selected/focused). It hinders the view of parent window when doing any operation on parent window.



provide the code
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do not use a modal JDialog.
Also declare a separate JFrame to bind to the JDialog.
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

JDialog is by default always non-modal ... if not explicitly specified otherwise:
- via constructor --> boolean flag
- or via method call setModal(boolean)


Regards,
Rok
 
Samuel March
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could just pop a new JFrame and that will.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I have the same problem.if i set modality it makes my application inactive.please suggest me
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic