Package javax.swing

Examples of javax.swing.JScrollPane.addFocusListener()


         }
         @Override public Object do_root() { return Browsable.this; }
      };
      tree.setBorder(new EmptyBorder(3,3,3,3));
      final JScrollPane scr = new JScrollPane(tree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
      scr.addFocusListener(new FocusListener() {
         public void focusGained(FocusEvent e) { tree.requestFocusInWindow(); }
         public void focusLost(FocusEvent e) { }
      });
      final JFrame x = new JFrame("Parse Tree");
      x.setLayout(new BorderLayout());
View Full Code Here


      if (frame!=null) frame.setTitle(makeVizTitle());
      switch (currentMode) {
         case Tree: {
            final VizTree t = new VizTree(myState.getOriginalInstance().originalA4, makeVizTitle(), fontSize);
            final JScrollPane scroll = OurUtil.scrollpane(t, Color.BLACK, Color.WHITE, new OurBorder(true, false, true, false));
            scroll.addFocusListener(new FocusListener() {
               public final void focusGained(FocusEvent e) { t.requestFocusInWindow(); }
               public final void focusLost(FocusEvent e) { }
            });
            content = scroll;
            break;
View Full Code Here

    JScrollPane sp = new JScrollPane(textArea);
    sp.setBorder(SimpleBorder.getStandardBorder());

    // Special focus listener on the scroll pane, that will immidiatly delegate the focus
    // to the text area when the scroll pane receives the focus.
    sp.addFocusListener(new FocusDelegator());

    Dimension size = determineSize(textArea);
    sp.setPreferredSize(size);

    component = sp;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.