Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

urgent please help

 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JDialog box which requests the user for username and password. This JDialog is on top of a JFrame. My problem is if I go to resize the JFrame or click on it, it (the JDialog) disappears. Once I move the JFrame or close I realize the JDialog is under. How do I maintain the Jdialog on top. Please can someone help.
I have tried using setNextFocusableComponent() and nothing seems to work.




 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you setting the parent to null? You have to specify what the Dialog sits on top of.
Does that make sense?
Hope so.

------------------
Happy Coding,
Gregg Bolinger
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDialog - use this constructor
public JDialog(Dialog owner,
boolean modal)
Creates a modal or non-modal dialog without a title and with the specified owner dialog.
Parameters:
owner - the Dialog from which the dialog is displayed
modal - true for a modal dialog, false for one that allows others windows to be active at the same time
hope this helps
Durga

Originally posted by john mattucci:
I have a JDialog box which requests the user for username and password. This JDialog is on top of a JFrame. My problem is if I go to resize the JFrame or click on it, it (the JDialog) disappears. Once I move the JFrame or close I realize the JDialog is under. How do I maintain the Jdialog on top. Please can someone help.
I have tried using setNextFocusableComponent() and nothing seems to work.




 
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic