Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / September 2004

Tip: Looking for answers? Try searching our database.

setLocation and setVisible for JDialog

Thread view: 
antoine - 02 Sep 2004 02:39 GMT
hello,

I have a problem with a JDialog that I'm trying to have appear on top
of a Frame.

I'm clicking a cell in JTable inside my JFrame, and I want the dialog
to appear right below this cell.

I'm computing the correct point of location for the JDialog, but I
witness a strange behavior:

- when I call "setLocation" before "setVisible", then the JDialog
appears in the middle of the screen (just like if there has not been
any "setLocation")

- when I call "setVisible" before "setLocation", the dialog appears,
THEN is moved to it's correct location. this is very fast, but it still
can be seen (like a flash), and is not very nice...

I'm surprised there's no "setVisible" method where I could specify
exactly WHERE to display my dialog...

any idea ?

thanks
Morten Alver - 03 Sep 2004 11:30 GMT
> - when I call "setLocation" before "setVisible", then the JDialog
> appears in the middle of the screen (just like if there has not been
> any "setLocation")

Have you tried with show() instead of setVisible() ? I don't know what
the differences are, but setting the location before showing the dialog
should work.

--
Morten
ak - 03 Sep 2004 16:05 GMT
> I have a problem with a JDialog that I'm trying to have appear on top
> of a Frame.
[quoted text clipped - 15 lines]
> I'm surprised there's no "setVisible" method where I could specify
> exactly WHERE to display my dialog...

Post your code.

Signature

Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.