public FocusBorder(Component comp) {
      this.comp = comp;

      comp.addFocusListener(this);

      // This is the best guess for a L&F specific color
      focusColor = UIManager.getColor("TabbedPane.focus");
    }
示例#2
0
 /** {@inheritDoc} */
 @Override
 protected void installListeners(JScrollPane c) {
   super.installListeners(c);
   c.addPropertyChangeListener(this);
   if (UIManager.getBoolean("ScrollPane.useChildTextComponentFocus")) {
     viewportViewFocusHandler = new ViewportViewFocusHandler();
     c.getViewport().addContainerListener(viewportViewFocusHandler);
     Component view = c.getViewport().getView();
     if (view instanceof JTextComponent) {
       view.addFocusListener(viewportViewFocusHandler);
     }
   }
 }