<Swing Dev> Unable to view focus in Non-Editable Text Area

Sean Chou zhouyx at linux.vnet.ibm.com
Fri Apr 1 02:23:17 UTC 2011


Hi,
   I find that if a TextArea is set to un-editable on linux system, the
customer will be
unable to view the focus when the TextArea gets focused(eg. clicked). On
windows, the cursor is blinking when the un-editable TextArea get the focus.
So linux users may get confused when trying to move the focus to the
TextArea
because no visible feedback is given.

   I think it will be better if TextArea behaves the same as it is on
windows.
Here is a simple testcase:

import java.awt.TextArea;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;

public class NonEditable {
public static void main(String[] str) {
JFrame jf = new JFrame();
JButton jb = new JButton("click");
JPanel jp = new JPanel();
jf.setSize(200, 200);
JTextArea jt = new JTextArea(3, 3);
jf.getContentPane().add(jp);
jp.add(jb);
jp.add(jt);
jf.setVisible(true);
jt.setText("hello how r u");
jt.setEditable(false);
TextArea ta = new TextArea(6, 10);
ta.setText("Rajesh kumar");
ta.setEditable(false);
jp.add(ta);
}
}


-- 
Best Regards,
Sean Chou
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110401/8ae3474e/attachment.html>


More information about the swing-dev mailing list