In Java applications multiple selections are possible in TextArea and TextField
components.
0. The problem is quite easy to reproduce with the following example:
% more SelBug.java
import java.awt.*;
import java.awt.event.*;
public class SelBug extends Frame {
public static void main(String args []) {
Frame f = new Frame();
TextField tf1 = new TextField(20);
TextField tf2 = new TextField(20);
TextArea ta = new TextArea();
f.addWindowListener( new WindowAdapter()
{ public void windowClosing( WindowEvent e )
{ System.exit(0);
}
} );
f.setLayout(new BorderLayout());
f.add("North", tf1);
f.add("Center", tf2);
f.add("South", ta);
f.setSize(300, 300);
f.show();
}
}
1. Compile and run example:
% javac SelBug.java
% java SelBug
2. Type in some text in upper TextField, select the text with double-clicking
to the text and transfer the focus out of the TextField by pressing the TAB
key. The selection in the TextField remains.
3. Type in some text in the middle TextField, select the text with
double-clicking to the text and transfer the focus out of the TextField by
pressing the TAB key. The selection in the TextField remains, too.
4. Type in some text in the TextArea, select the text with double-clicking to
the text and transfer the focus out of the TextField by double-clicking to
one of the TextFields.
Now, there are 3 selections in 3 different components.