• Post Reply Bookmark Topic Watch Topic
  • New Topic

adding popup ?  RSS feed

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I tried the following code to display popup under TextField when button is clicked

my problem is the popup doesn't appear under the TextField !
howto resolve this problem ?

Thank alls
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for x and y you would need to add in the parent frame's getX and getY,
also the frame's insets top and left. you may also have to include the x,y
of any containers that sit between the textfield and the frame.
 
Sheriff
Posts: 21330
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, if the control is visible and displayable, call getLocationOnScreen.

The problem with getX() and getY() is, as Michael mentioned, it is the location within its parents. You would have to add getX() and getY() of all parent components until you hit a Window (including frame and dialog).

getLocationOnScreen will do just that for you - unless it's not visible.
 
jack morton
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you gays , I tried with getLocationOnScreen and it's working
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by jack morton:
Thank you gays ...



I am almost quite sure this is a typo
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!