《Java 2 图形设计卷Ⅱ- SWING》第10章 菜单和工具条
"eagle: " + eagleItem.getState() + ", " +
"ladybug: " + ladybugItem.getState());
}
}
}
}
System.out.println("change event fired");
}
};
class AnItemListener implements ItemListener {
public void itemStateChanged(ItemEvent e) {
JMenuItem item = (JMenuItem) e.getSource();
String s = getItemDescription(item);
else
s += " deselected";
add(newItem);
newItems.addElement(newItem);
}
public void removeLastItem() {
if(newItems.size() == 0)
System.out.println("Nothing to remove!");
else {
JMenuItem removeMe =
(JMenuItem)newItems.lastElement();
menubar.getMenuCount() +
" menus");
System.out.println();
System.out.println(nextMenu);
mb.getComponentCount());
System.out.println("first component: " +
(mb.getComponentAtIndex(0)).getClass().getName());
static private ResourceBundle resources;
};
ImageIcon[] icons = {
new ImageIcon("new.gif"),
new ImageIcon("open.gif"),
new ImageIcon("cut.gif"),
new ImageIcon("copy.gif"),
new ImageIcon("paste.gif")
};
10.10.4位置固定的工具提示
?略
10.10.5 JToolBar属性
??略
10.10.6 JMenuBar事件
??略
10.10.7 JMenuBar类总结
??略
10.10.8 AWT兼容
??略
?
?
?