Component c;
for(int i=0; i<cont.getComponentCount(); i++) {
c = cont.getComponent(i);
if(c == null || !c.isVisible()) {
continue;
}
if(c instanceof AbstractButton
&& ((AbstractButton)c).getMnemonic() != '\0") {
c.repaint();
continue;
} else if(c instanceof JLabel
&& ((JLabel)c).getDisplayedMnemonic() != '\0") {
c.repaint();
continue;
}
if(c instanceof Container) {
repaintMnemonicsInContainer((Container)c);
}
}