Skip to Main Content

Java SE (Java Platform, Standard Edition)

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!

Set position JLabel on JPanel

843805Aug 31 2006 — edited Aug 31 2006
Hi,

Is there some way to set position of label in some panel to 0 0. I used this

setPreferredSize(new Dimension(TableConst.getSquareWidth(), TableConst.getSquareHeight()));
setAlignmentX(0);
setAlignmentY(0);
jl = new JLabel();
setPreferredSize(new Dimension(TableConst.getSquareWidth(), TableConst.getSquareHeight()));
jl.setHorizontalAlignment(0);
jl.setVerticalAlignment(0);
jl.setLocation(new Point(0 , 0));

but nothing. When I use drawImage, it paints as I want (starting with (x , y) <=> (0 , 0)).

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2006
Added on Aug 31 2006
3 comments
263 views