Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change Property on label...

 
nikos sokaf
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,

I'm trying to change the position property of a label on runtime with no success.

The user is pressing a button but the label isn't moving...

How can i do that?

Thanks in advice!
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried? You'll need to remove the component from it's parent container and add it back at the new location. Then make sure you repaint the parent container so that you see the changes.
 
nikos sokaf
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Gregg and thank you for your help!

I have a form, a label and a button.The label XY position is on 100,100.When the user presses the button i want the XY position of the lebel to be 200,200 and the label appear to that position.Is it easy?
You mean to call the .repaint method on parent to the button action (Pressed)?

Thanks again!!
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
nikos sokaf
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Gregg!!!

Thank you for your time!Your code is very simple and understandable!!!
Thanks again!

Best Regards,
nikos sokaf.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic