JInternalFrame向标题栏添加图标

问题描述 投票:4回答:3

我想添加一个ImageIcon或类似于JInternalFrame的标题栏,使得[x]图标位于最东侧,可图标图标位于第二个最东侧,自定义图标位于第三个最东侧。这可行吗?

java swing icons jinternalframe
3个回答
0
投票

这对我有用:

ImageIcon icon = new ImageIcon(ClassLoader.getSystemResource("Iconos/icono.png"));
this.setFrameIcon(icon);

-1
投票
JInternalFrame jInternalFrame1 = new JInternalFrame("Test Internal Frame",false,false,false,false);

try {
  URL url = new URL("images/icon.gif");
  ImageIcon icon = new ImageIcon(url);
  jInternalFrame1.setFrameIcon(icon);
} 
catch (MalformedURLException ex) 
{
   //whatever you want to put here
}

-1
投票

for parent for parent frame:// parent is container jDesktopPane - > parent = new JFrame()

this.setFrameIcon(new javax.swing.ImageIcon(this.parent.getIconImage()));
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.