Skip to main content

Howto avoid automatic movement of huge label icons (they should be always centered)

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
3 replies [Last post]
gruelfin
Offline
Joined: 2010-03-11

Hello!

I have a huge Label icon, it will be bigger than some cellphone screens.

I want it to be centered anyways, it does not matter if its bigger than the borders of the screen.

The problem is that when the screen is smaller than the icon, the icon gets moved to the right, so that it is not centered anymore..

How can i avoid this?

Thanks in advance!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gruelfin
Offline
Joined: 2010-03-11

if important: the label is in a container with layeredlayout..

vprise
Offline
Joined: 2003-11-07

Don't use an icon.

Set the background style of the component to the image and set its alignment to centered.

gruelfin
Offline
Joined: 2010-03-11

if important: the label is in a container with layeredlayout..