| | |
| | | for (int i=0; i < container.getComponentCount(); i++) |
| | | { |
| | | Component comp = container.getComponent(i); |
| | | if ((comp instanceof AbstractButton) || |
| | | (comp instanceof JTextComponent) || |
| | | (comp instanceof JList) || |
| | | (comp instanceof JComboBox) || |
| | | (comp instanceof JTable)) |
| | | if (comp instanceof AbstractButton || |
| | | comp instanceof JTextComponent || |
| | | comp instanceof JList || |
| | | comp instanceof JComboBox || |
| | | comp instanceof JTable) |
| | | { |
| | | comp.addFocusListener(focusListener); |
| | | } |
| | | else if ((comp instanceof JPanel) || (comp instanceof JScrollPane) |
| | | || (comp instanceof JViewport)) |
| | | else if (comp instanceof JPanel || comp instanceof JScrollPane |
| | | || comp instanceof JViewport) |
| | | { |
| | | addFocusListener(focusListener, (Container)comp); |
| | | } |
| | |
| | | { |
| | | lastComponentWithFocus = panel.getPreferredFocusComponent(); |
| | | } |
| | | if (visible && (lastComponentWithFocus != null) && |
| | | lastComponentWithFocus.isVisible()) |
| | | if (visible && lastComponentWithFocus != null && lastComponentWithFocus.isVisible()) |
| | | { |
| | | if (lastComponentWithFocus == null) |
| | | { |