How to scale an image in WindowBuilder? [message #1022199] |
Thu, 21 March 2013 09:26  |
Eclipse User |
|
|
|
Hey guys, I've started learning Java in Eclipse, and I couldn't find any forum answers or documentation about rescaling an image in Window Builder. It's quite daunting seeing as I'm new to programming, so I may have overlooked something.
I've put an image on the frame, but I want to scale the image 'image_1.png' to 200%.
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setIcon(new ImageIcon(builder.class.getResource("/resources/image_1.png")));
lblNewLabel.setBounds(10, 7, 122, 22);
Is this also how I correctly should add an image to my window builder (Using a label?).
Thanks!
|
|
|
Re: How to scale an image in WindowBuilder? [message #1022725 is a reply to message #1022199] |
Fri, 22 March 2013 08:31  |
Eclipse User |
|
|
|
WindowBuilder does not offer any sort of image scaling function.
That capability would be dependent on the widget you use. As far as I know, the standard Swing JLabel does not offer that feature, so you would need to find a widget that does or scale the image yourself before applying it to the JLabel.
|
|
|
Powered by
FUDForum. Page generated in 0.03066 seconds