-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
generic
-
generic
The code below needs the setBorder() method invocation on JTextArea.
But JTextFields do ont need it.
- eduardo
// JTextComponent comes with a border but JTextArea does not.
import com.sun.java.swing.*;
import com.sun.java.swing.border.LineBorder;
public class Test extends JPanel {
public static JFrame frame;
public static JTextArea t;
public static void main(String args[]) {
frame = new JFrame("Short");
Box topBox = Box.createVerticalBox();
Box box = Box.createHorizontalBox();
box.add(new JTextField("one", 10));
box.add(t = new JTextArea("two", 1, 10));
t.setBorder(LineBorder.createGrayLineBorder());
topBox.add(box);
frame.getContentPane().add("Center", topBox);
frame.pack();
frame.show();
}
}
But JTextFields do ont need it.
- eduardo
// JTextComponent comes with a border but JTextArea does not.
import com.sun.java.swing.*;
import com.sun.java.swing.border.LineBorder;
public class Test extends JPanel {
public static JFrame frame;
public static JTextArea t;
public static void main(String args[]) {
frame = new JFrame("Short");
Box topBox = Box.createVerticalBox();
Box box = Box.createHorizontalBox();
box.add(new JTextField("one", 10));
box.add(t = new JTextArea("two", 1, 10));
t.setBorder(LineBorder.createGrayLineBorder());
topBox.add(box);
frame.getContentPane().add("Center", topBox);
frame.pack();
frame.show();
}
}
- duplicates
-
JDK-4139076 No border on JTextArea in Windows and Motif L&F
- Closed
- relates to
-
JDK-4174849 JEditorPane ignores caption HTML tag while document model has correct element
- Closed