Text in a JTextArea that is selected has a different background color.
When that text area loses focus, either because a button is pushed or
the window loses focus, the background color of the text area selection
reverts to the nonselected background color.
Very similar to 4244100
JDK 1.2.2 reference Solaris and 1.2.2 Win32, not happening with 1.2.1.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class TestSelect extends JFrame implements ActionListener {
JCheckBox ckbox;
JRadioButton radio;
JScrollPane panel;
JTextArea ta;
Container cp;
public TestSelect() {
super ("Test Select");
cp = getContentPane();
cp.setLayout (new GridLayout(2,2));
ckbox = new JCheckBox("check Box");
ckbox.addActionListener(this);
cp.add(ckbox);
radio = new JRadioButton("radio Button");
radio.addActionListener(this);
cp.add(radio);
ta = new JTextArea();
panel = new JScrollPane (ta);
cp.add(panel);
setSize(250, 200);
setVisible(true);
}
public void actionPerformed (ActionEvent evt) {
System.out.println (">>action " + evt);
}
public static void main (String[] args) {
new TestSelect();
}
}