Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Positioning JLabels

807601Feb 18 2008 — edited Feb 19 2008
Hey,

I'm trying to learn Swing applications and I've run into a bit of trouble positioning my "Hello World" label on the screen. I've created a JFrame that is 640x480 in size and I want to move my label to a specific x,y within the frame. I've tried using setLocation and setBounds with no luck. The label stays stuck vertically centered on the left side of the screen. How do I move this label around?

Mike
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 18 2008
Added on Feb 18 2008
2 comments
3,022 views