-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta
-
x86
-
generic
-
Verified
Name: jbT81659 Date: 02/01/2001
OS: All windows platforms
JDK: 1.4.0-Beta49
JtextArea is not editable by default under windows. No text can be typed
into JTextArea.
To reproduce bug:
1- Compile and run the following code.
2- Try to insert text into JTextArea.
3- Note that JtextArea is not editable and you can not insert Text into JtextArea
/* Copyright (c) Sun Microsystems 1999
$Header: /home/sun/src/JDK1.2/jTextArea.java,v 1.20 2000/03/30 14:59:14 isam Exp $
*/
import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.text.*;
public class jTextArea extends JApplet
{
public void init()
{
jTextArea1 jTextComponent2 = new jTextArea1();
getContentPane().add(jTextComponent2);
}
public static void main(String[] args)
{
JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
frame.setContentPane(new jTextArea1());
frame.pack();
frame.setVisible(true);
frame.addWindowListener( new WindowAdapter()
{
public void windowClosing( WindowEvent e)
{
System.exit(0);
}
});
}
}
class jTextArea1 extends JPanel
{
public jTextArea1()
{
JLabel l;
JPanel p;
JTextArea area;
JPanel panel = new JPanel();//new FlowLayout(FlowLayout.LEFT));
p = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
l = new JLabel("JTA1");
l.setVerticalAlignment(SwingConstants.BOTTOM);
area = new JTextArea(10,30);
area.setEditable(true);
area.setFont(new Font("Lucida Sans Regular", Font.PLAIN, 9));
area.setText("\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd");
area.setLineWrap(true);
p.add(l);
p.add(area);
//p.setPreferredSize(new Dimension(375,310));
panel.add(p);
//panel.setPreferredSize(new Dimension(400,400));
add(panel);
}
}
WorkAround:
======================================================================