Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

adding popup ?  RSS feed

 
jack morton
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
 
Michael Dunn
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.
 
Rob Spoor
Sheriff
Posts: 21044
85
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
 
Maneesh Godbole
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!