使用JFrame的setIconImages()方法的图标大小是多少? [英] Which icon sizes to use with a JFrame's setIconImages() method?

查看:663
本文介绍了使用JFrame的setIconImages()方法的图标大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道哪些图标大小与jFrame的setIconImages()(PLURAL)方法一起使用,以便我的应用程序图标在所有平台和所有上下文中都能很好地显示(例如,窗口图标,任务栏图标,alt-tab图标等等。)

Does anyone know which icon sizes to use with the setIconImages() (PLURAL) method for a jFrame so that my app icons display well on all platforms and in all contexts (e.g., window icon, taskbar icon, alt-tab icon, etc.)?

我发现了一个使用16px-by-16px和32px-by-32px图像的例子,但是我需要去任何一个更大?

I've found an example that uses a 16px-by-16px and a 32px-by-32px image, but do I need to go any bigger?

为了测试,我还尝试将64px和128px版本添加到传递给setIconImages()的List中,但这些似乎没有在我的Windows 7上使用机。但是,我无法在其他机器上轻松测试,所以我想知道是否有人知道我应该包括哪些尺寸?

To test, I have also tried adding 64px and 128px versions to the List passed to setIconImages(), but these do not seem to be used on my Windows 7 machine. However, I cannot test easily on other machines, so am wondering if anyone knows which sizes I should include?

推荐答案

根据API运行时从提供的列表中选择最合适的大小。我会提供 16x16 32x32 64x64 128x128 让JVM在运行时决定。

According to the API the runtime chooses the most appropriate size to use from the list supplied. I would supply 16x16, 32x32, 64x64 and 128x128 and let the JVM decide at runtime.


public void setIconImages 列表 <?扩展 图像 >图标)

设置图像序列显示为此窗口的图标。对getIconImages的后续调用将始终返回图标列表的副本。

Sets the sequence of images to be displayed as the icon for this window. Subsequent calls to getIconImages will always return a copy of the icons list.

取决于平台功能一个或多个不同尺寸的图像将用作窗口的图标。

Depending on the platform capabilities one or several images of different dimensions will be used as the window's icon.

扫描图标列表中的大多数图像适当的尺寸从一开始。如果列表包含多个相同大小的图像,则将使用第一个。

The icons list is scanned for the images of most appropriate dimensions from the beginning. If the list contains several images of the same size, the first will be used.

未指定图标的无主窗口使用platfrom-default图标。除非明确覆盖,否则可以从所有者继承拥有窗口的图标。将图标设置为空或空列表可恢复默认行为。

Ownerless windows with no icon specified use platfrom-default icon. The icon of an owned window may be inherited from the owner unless explicitly overridden. Setting the icon to null or empty list restores the default behavior.

注意:本机窗口系统可能使用不同尺寸的不同图像来表示窗口,具体取决于上下文(例如窗口装饰,窗口列表,任务栏等)。他们也可以只针对所有情境使用单个图像,或者根本不使用任何图像。

Note : Native windowing systems may use different images of differing dimensions to represent a window, depending on the context (e.g. window decoration, window list, taskbar, etc.). They could also use just a single image for all contexts or no image at all.

参数:

      icons - 要显示的图标图片列表。

     icons - the list of icon images to be displayed.

自:

      1.6

     1.6

另请参阅:

      getIconImages() setIconImage(Image)

     getIconImages(), setIconImage(Image)

这篇关于使用JFrame的setIconImages()方法的图标大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆