简体   繁体   中英

How to change the size of JFrame icon

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);

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 .

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 Fee l especially some of Substance 's themes can do that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM