FULL PRODUCT VERSION :
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
On Linux, when the TextArea instance is set to non-editable, it does not show a caret when it is focused. This will confuse users. On windows, the focus is visible.
This is reported to java.awt.TextArea .
// I reported http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7119745 , but it was closed, so I update the description and testcase a little and report it again. This problem is definitely NOT swing.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the testcase with jdk7.
2. Press tab to move the focus to TextArea
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
When Focus goes to TextArea, it should be visible.
ACTUAL -
The focus is not visible.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.TextArea;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class OJDK103 {
public static void main(String[] str) {
JFrame jf = new JFrame();
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton jb = new JButton("click");
JPanel jp = new JPanel();
jf.setSize(200, 200);
jf.getContentPane().add(jp);
jp.add(jb);
TextArea ta = new TextArea(6, 10);
ta.setText("Text Area");
ta.setEditable(false);
jp.add(ta);
jf.setVisible(true);
}
}
---------- END SOURCE ----------