Click to See Complete Forum and Search --> : ImageIcon


September 23rd, 1999, 01:56 PM
I am using a JLabel with icon for a background in an application with JDesktopPane; It works fine but the icon is too small for the screen and I need to size it before it becomes part of the JLabel. This cannot be tiled since it is a map.

Does anyone know of a clever way that I can size it to fit screen size? Resizing help also

unicman
September 25th, 1999, 04:16 AM
I don't know how to scale a ImageIcon. But there is a method in 'Image' class called, 'getScaledInstance'. Using this method u might be able to resize the image. ImageIcon provides method for retrieving image object called 'getImage'.

If u don't get any other solution, u can try combination of above methods for resizing ImageIcon.

- UnicMan
http://members.tripod.com/unicman