diff --git a/projects/samskivert/src/java/com/samskivert/swing/ComboButtonBox.java b/projects/samskivert/src/java/com/samskivert/swing/ComboButtonBox.java index a88c910e..849dfdec 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/ComboButtonBox.java +++ b/projects/samskivert/src/java/com/samskivert/swing/ComboButtonBox.java @@ -1,5 +1,5 @@ // -// $Id: ComboButtonBox.java,v 1.2 2002/03/10 05:27:35 mdb Exp $ +// $Id: ComboButtonBox.java,v 1.3 2002/03/10 20:28:56 mdb Exp $ package com.samskivert.swing; @@ -90,6 +90,17 @@ public class ComboButtonBox extends JPanel addButtons(0, _model.getSize()); } + // documentation inherited + public void setEnabled (boolean enabled) + { + super.setEnabled(enabled); + + int ccount = getComponentCount(); + for (int i = 0; i < ccount; i++) { + getComponent(i).setEnabled(enabled); + } + } + /** * Returns the model in use by the button box. */ @@ -229,6 +240,11 @@ public class ComboButtonBox extends JPanel // documentation inherited from interface public void mousePressed (MouseEvent e) { + // ignore if we're not enabled + if (!isEnabled()) { + return; + } + // keep track of the selected button _selectedButton = (JLabel)e.getSource(); // if the selected button is already selected, ignore the click