2

How to change the size of JFrame icon?

JFrame f = new JFrame("Test");
Image icon = Toolkit.getDefaultToolkit().getImage("icons/logo.png");
// icon.setPreferredWidth()...
f.setIconImage(icon);
Eng.Fouad
  • 115,165
  • 71
  • 313
  • 417
Klausos Klausos
  • 15,308
  • 51
  • 135
  • 217

2 Answers2

6

Frame icons are set according to a size decided by the OS.

  • If you supply icons of various sizes, Windows will use the smaller one for the frame icon, and the larger one as the image to include in the window shown when the user types alt tab to change between apps.
  • OS X shows no frame icon at all.

See also: Sizes of frame icons used in Swing.

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
2

Top Level Containers came from Native OS, from current used theme, then not possible to increase numbers of available pixels,

some dirty hack are possible to wrote in case that you setSystemLookAndFeel, including caption, Font type&size or background, simple don't do that this way,

possible only by implements Custom Look and Feel especially some of Substance's themes can do that

Community
  • 1
  • 1
mKorbel
  • 109,525
  • 20
  • 134
  • 319