2

I have an ImageIcon that I used for a button to open this skillsFrame. This size of the image is 100x100px. As you can see in the screenshot if I just put the image it is too large(which is expected).

My question is about how to scale the image to 16x16(or whatever the default size is) so that I don't need to manually create a smaller sized version(for multiple reasons).

  1. In case they make windows bigger in the future
  2. Multiple operating system support
  3. I'm sure I don't need to go on naming more...

    skillsFrame = new JInternalFrame("Skills", true, true, false, false);

    skillsFrame.setFrameIcon(new ImageIcon("images/gui/button_skills.png"));

And now for the image... the bar at the tops is the buttons to click to open the various JInternalFrames.

[IMG]http://img443.imageshack.us/img443/4310/67719353.png[/IMG]

mKorbel
  • 109,525
  • 20
  • 134
  • 319
KisnardOnline
  • 653
  • 4
  • 16
  • 42

1 Answers1

2

how to scale the image to 16x16(or whatever the default size is)

you have look at Image getScaledInstance(int width, int height, int hints)

mKorbel
  • 109,525
  • 20
  • 134
  • 319