-
Enhancement
-
Resolution: Unresolved
-
P5
-
None
-
6
-
x86
-
solaris_10
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
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