JMenuItem with checkbox - on mac
From: Maik Heller (Maik.Heller_at_antispam.address)
Date: 10/28/04
- Previous message: Willem M: "Re: SWT Tree construction performance"
- Next in thread: Maik Heller: "Re: JMenuItem with checkbox - on mac"
- Reply: Maik Heller: "Re: JMenuItem with checkbox - on mac"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 28 Oct 2004 13:15:06 +0200
Hello,
I want to place several kinds of JMenuItem s into a menu bar. All
instances e.g. MyCheckBoxMenuItem are derived from MyMenuItem which in
turn is derived from JMenuItem.
To simplify the example, the custom menu item is derived directly from
JMenuItem and actions are ignored...
public class MyCheckBoxMenuItem extends JMenuItem {
public MyCheckBoxMenuItem() {
super();
setModel(new JToggleButton.ToggleButtonModel());
}
public String getUIClassID() {
return "CheckBoxMenuItemUI"
}
}
So, the item should be rendered as a checkbox menu item (getUIClassID())
and the button state is managed by the model (setModel()). Everything's
fine ... on windows.
The problem is that the check state icon on mac is not rendered. As soon
as I derive the class from JCheckBoxMenuItem, the item is rendered
correctly.
Any hints?
- Previous message: Willem M: "Re: SWT Tree construction performance"
- Next in thread: Maik Heller: "Re: JMenuItem with checkbox - on mac"
- Reply: Maik Heller: "Re: JMenuItem with checkbox - on mac"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]