< prev index next >
src/demo/share/jfc/SwingSet2/DirectionPanel.java
Print this page
*** 90,102 ****
public String getSelection() {
return group.getSelection().getActionCommand();
}
public void setSelection( String selection ) {
! Enumeration e = group.getElements();
while( e.hasMoreElements() ) {
! JRadioButton b = (JRadioButton)e.nextElement();
if( b.getActionCommand().equals(selection) ) {
b.setSelected(true);
}
}
}
--- 90,102 ----
public String getSelection() {
return group.getSelection().getActionCommand();
}
public void setSelection( String selection ) {
! Enumeration<AbstractButton> e = group.getElements();
while( e.hasMoreElements() ) {
! AbstractButton b = e.nextElement();
if( b.getActionCommand().equals(selection) ) {
b.setSelected(true);
}
}
}
*** 145,158 ****
setSelectedIcon(downIcon);
setActionCommand(direction);
getAccessibleContext().setAccessibleName(direction);
getAccessibleContext().setAccessibleDescription(description);
setSelected(selected);
! }
!
! public boolean isFocusTraversable() {
! return false;
}
public void setBorder(Border b) {
}
}
--- 145,155 ----
setSelectedIcon(downIcon);
setActionCommand(direction);
getAccessibleContext().setAccessibleName(direction);
getAccessibleContext().setAccessibleDescription(description);
setSelected(selected);
! setFocusable(false);
}
public void setBorder(Border b) {
}
}
< prev index next >