Results 1 to 1 of 1
Thread: Icon sizes
- 12-01-2013, 01:04 PM #1
I noticed that my app's icon in the native alt-tab window switcher was a badly scaled-down version of the icon I had supplied. Then I learned about Window#setIconImages(...). I created some icons of alternating black and white 1-pixel lines so it's evident if they've been scaled down (the icon becomes gray). The code below solved my problem with the window switcher; it uses the 32x32 icon at its native size (I can tell by counting the lines). But the icon in my task bar is still scaled down, even though it's 16x16 (I measured in a screenshot) and I have supplied a 16x16 icon. I'm guessing my task bar is obtaining a larger icon and scaling it down, so there's probably nothing I can do about it. Right? Or am I doing something wrong in my use of setIconImages(...)?
ImageIcon icon16 = new ImageIcon(getClass().getResource("/lines16.png")); ImageIcon icon24 = new ImageIcon(getClass().getResource("/lines24.png")); ImageIcon icon32 = new ImageIcon(getClass().getResource("/lines32.png")); List<Image> icons = new LinkedList<Image>(); icons.add(icon16.getImage()); icons.add(icon24.getImage()); icons.add(icon32.getImage()); mainWindow.setIconImages(icons);Get in the habit of using standard Java naming conventions!
- By kkid in forum AWT / SwingReplies: 6Last Post: 02-01-2013, 07:09 PM
- By Bagzli in forum New To JavaReplies: 2Last Post: 07-01-2011, 05:24 PM
- By sarah jain in forum AWT / SwingReplies: 8Last Post: 02-22-2011, 05:08 AM
- By Basit in forum Java AppletsReplies: 2Last Post: 08-12-2009, 06:48 PM