Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4273908

Selection not shown when focus lost

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 1.2.2
    • client-libs
    • None
    • unknown
    • solaris_2.6

      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();
       }
      }

            duke J. Duke
            mhosanee Matt Hosanee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: