5

我想添加一个ImageIcon或与 aJInternalFrame的标题栏相当的,这样 [x] 图标是最东的,可图标的图标是最东的第二个,自定义图标是最东的第三个。这是可行的吗?

4

3 回答 3

0

这对我有用:

ImageIcon icon = new ImageIcon(ClassLoader.getSystemResource("Iconos/icono.png"));
this.setFrameIcon(icon);
于 2016-10-13T16:10:15.200 回答
-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
}
于 2011-08-05T23:58:34.153 回答
-1

for get for parent frame : // parent 是容器 jDesktopPane -> parent = new JFrame ()

this.setFrameIcon(new javax.swing.ImageIcon(this.parent.getIconImage()));
于 2017-01-30T21:27:55.507 回答