Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6474075

Add dynamic layout option to JTree

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      There are times when having the editor in a JTree be layed out again when it has been invalidated. An example would be a text field that expands/contracts based on the amount of text in the editor. The current route of having to create this behavior is not obvious. I think a simple property like:
      setLayoutEditorOnValidation(boolean layout); would do the trick.

      JUSTIFICATION :
      It would make things simpler in situations where you have a dynamically resizing editor.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      easy simple clear way to have a dynamically resizing editor
      ACTUAL -
      editor size appears static

      ---------- BEGIN SOURCE ----------
      Run this test, start editing. See that the editor doesn't resize.
      import javax.swing.*;


      public class EditingJTree implements Runnable{

          public void run(){
              JTree jtree = new JTree();
              jtree.setEditable(true);
              JFrame jf = new JFrame();
              jf.add(jtree);
              jf.pack();
              jf.setVisible(true);
          }

          public static void main(String ... args){
              SwingUtilities.invokeLater(new EditingJTree());
          }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      build it yourself

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: