aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Change Property on label... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Change Property on label..." Watch "Change Property on label..." New topic
Author

Change Property on label...

nikos sokaf
Ranch Hand

Joined: May 01, 2004
Posts: 57
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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.


GenRocket - Experts at Building Test Data
nikos sokaf
Ranch Hand

Joined: May 01, 2004
Posts: 57
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

Joined: Jul 11, 2001
Posts: 15299
    
    6

nikos sokaf
Ranch Hand

Joined: May 01, 2004
Posts: 57
Hello Gregg!!!

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

Best Regards,
nikos sokaf.
 
Consider Paul's rocket mass heater.
 
subject: Change Property on label...