-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.0, 2.6, 1.2.0, 1.2.1
-
generic, sparc
-
solaris_2.4, solaris_2.5.1, solaris_2.6
CheckboxMenuItem objects don't appear to generate action events,
which they should since MenuItems do.
------------------------
[Sheri Good 03/04/97]
Another report of this bug, an example has been provided:
Synopsis: CheckboxMenuItem does not generate an ActionEvent
Severity Impact: (internal)
Severity Functionality: (internal)
Priority: (internal)
Description: CheckboxMenuItem doesn't generate ActionEvents. Simple program
follows that demonstrates.
import java.awt.CheckboxMenuItem;
import java.awt.Frame;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class TestCheckboxMenu extends Frame implements ActionListener
{
MenuItem cMenuItem;
CheckboxMenuItem cCheckboxItem;
public static void main (String[] asArg)
{
new TestCheckboxMenu ();
}
public TestCheckboxMenu ()
{
super ("TestCheckboxMenu");
constructMenuBar();
setSize (200,200);
show();
}
private void constructMenuBar ()
{
MenuBar cMenuBar = new MenuBar ();
Menu cTestMenu = new Menu ("Test");
cTestMenu.add (cMenuItem = new MenuItem ("Normal menu item"));
cMenuItem.addActionListener (this);
cTestMenu.add (cCheckboxItem = new CheckboxMenuItem ("Checkbox menu item"));
cCheckboxItem.addActionListener (this);
cMenuBar.add (cTestMenu);
setMenuBar (cMenuBar);
}
public void actionPerformed (ActionEvent cEvent)
{
if (cEvent.getSource() == cMenuItem)
System.out.println ("Normal menu item selected");
else if (cEvent.getSource() == cCheckboxItem)
System.out.println ("Checkbox menu item selected");
}
}
company - Raptor Systems Inc. , email - ###@###.###
Work around:
Comments:
customer_rec: new
Company: other
Employee:Cleveland Brown
Release: jdk11
Hardware Version: i586
O/S version: win_nt_4.0
User Role: D
User Type: E
Sun Contact: (internal)
end_customer_rec:
BUG_END
which they should since MenuItems do.
------------------------
[Sheri Good 03/04/97]
Another report of this bug, an example has been provided:
Synopsis: CheckboxMenuItem does not generate an ActionEvent
Severity Impact: (internal)
Severity Functionality: (internal)
Priority: (internal)
Description: CheckboxMenuItem doesn't generate ActionEvents. Simple program
follows that demonstrates.
import java.awt.CheckboxMenuItem;
import java.awt.Frame;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class TestCheckboxMenu extends Frame implements ActionListener
{
MenuItem cMenuItem;
CheckboxMenuItem cCheckboxItem;
public static void main (String[] asArg)
{
new TestCheckboxMenu ();
}
public TestCheckboxMenu ()
{
super ("TestCheckboxMenu");
constructMenuBar();
setSize (200,200);
show();
}
private void constructMenuBar ()
{
MenuBar cMenuBar = new MenuBar ();
Menu cTestMenu = new Menu ("Test");
cTestMenu.add (cMenuItem = new MenuItem ("Normal menu item"));
cMenuItem.addActionListener (this);
cTestMenu.add (cCheckboxItem = new CheckboxMenuItem ("Checkbox menu item"));
cCheckboxItem.addActionListener (this);
cMenuBar.add (cTestMenu);
setMenuBar (cMenuBar);
}
public void actionPerformed (ActionEvent cEvent)
{
if (cEvent.getSource() == cMenuItem)
System.out.println ("Normal menu item selected");
else if (cEvent.getSource() == cCheckboxItem)
System.out.println ("Checkbox menu item selected");
}
}
company - Raptor Systems Inc. , email - ###@###.###
Work around:
Comments:
customer_rec: new
Company: other
Employee:Cleveland Brown
Release: jdk11
Hardware Version: i586
O/S version: win_nt_4.0
User Role: D
User Type: E
Sun Contact: (internal)
end_customer_rec:
BUG_END
- relates to
-
JDK-4106427 CheckboxMenuItem and JCheckBoxMenuItem should treat action events the same way.
- Resolved
-
JDK-4516632 CheckboxMenuItem (still) does not fire ActionEvents
- Closed
-
JDK-4554572 ActionEvents should not be generated by CheckboxMenuItems
- Closed