Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding position of a component on a panel and NOT with respect to Frame  RSS feed

 
Dic scott
Greenhorn
Posts: 17
Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,
Consider a scenario. I have a frame on which I have a Panel. say I place a label in the panel, how do I know what is the position of the label with respect to the panel and not frame. Usually label.getX() will give me its position on the frame and not panel. How do I get around this issue. Its very urgent

 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually label.getX() will give me its position on the frame and not panel.


No, the getX() method returns the postition relative to the panel.

If you think you still have a problem then post your SSCCE that demonstrates the problem.
 
Dic scott
Greenhorn
Posts: 17
Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right. Thanks!
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dic scott wrote:Its very urgent

Please EaseUp. There is no such thing as "urgent" around here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!