/** Demonstration of a bug in focus with the AWT on Linux and Java.
 **
 ** Creates a Frame with a Choice and a TextArea. Every other time the
 ** Choice box is selected, the text area loses the ability to take
 ** focus. To demonstrate this, type some text into the text area,
 ** then select something from the Choice. Type into the text area
 ** again, then select something from the Choice again. The text area
 ** is now locked, and cannot be typed into.
 **
 ** Removing focus and restoring it to the Java app allows the text
 ** area to be used again, but it re-locks every second time the
 ** Choice is selected.
 **
 ** Bug verified with WindowMaker and fvwm2,
 ** Blackdown JDK 1.1.7_v3 and 1.2_pre2
 **
 ** Nelson Minar <[EMAIL PROTECTED]> and Tucker Sylvestro <[EMAIL PROTECTED]>
 ** Mon Jul 19 18:51:14 EDT 1999
 **/

import java.awt.*;

public class FocusBug extends Frame {
    Choice c = null;
    TextArea t = null;

    public FocusBug() {
        c = new Choice();
        c.addItem("Item 1");
        c.addItem("Item 2");
        add(c);

        t = new TextArea();
        t.setEditable(true);
        add(t);
        
        pack();
        setVisible(true);
    }

    public static void main(String args[]) {
        Test f = new Test();
        f.setLayout(new FlowLayout());
    }
}


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to