-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.4.0
-
generic
-
solaris_2.6
###@###.### 2000-11-08
to reproduce bug:
1. set follow-mouse focus policy in CDE
2. compile and run program (see below)
3. place mouse pointer on frame
4. press any key
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class keytest extends Frame implements WindowListener {
private Label glc = null;
public static void main( String argv[] ) {
keytest d = new keytest();
d.setTitle( d.getName() );
d.startDemo();
}
public keytest() {
/**#start */
}
public Frame getFrame() {
return ( this );
}
public void startDemo() {
/** Set the layout of the frame */
setLayout( new BorderLayout() );
glc = new Label( "Testing" );
/** Add the Component into the window */
add( "Center", glc );
pack(); show();
/** Register the keyboard listener */
KeyListener kl = new KeyAdapter() {
public void keyPressed( KeyEvent evt ) {
System.err.println( "keyPressed :" + evt.getKeyChar() );
}
}
};
glc.addKeyListener( kl );
this.addWindowListener( this );
}
/** WindowListener methods */
public void windowActivated( WindowEvent evt ) {
}
public void windowClosed( WindowEvent evt ) {
}
public void windowClosing( WindowEvent evt ) {
dispose();
System.exit( 0 );
}
public void windowDeactivated( WindowEvent evt ) {
}
public void windowDeiconified( WindowEvent evt ) {
}
public void windowIconified( WindowEvent evt ) {
}
public void windowOpened( WindowEvent evt ) {
}
}
to reproduce bug:
1. set follow-mouse focus policy in CDE
2. compile and run program (see below)
3. place mouse pointer on frame
4. press any key
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class keytest extends Frame implements WindowListener {
private Label glc = null;
public static void main( String argv[] ) {
keytest d = new keytest();
d.setTitle( d.getName() );
d.startDemo();
}
public keytest() {
/**#start */
}
public Frame getFrame() {
return ( this );
}
public void startDemo() {
/** Set the layout of the frame */
setLayout( new BorderLayout() );
glc = new Label( "Testing" );
/** Add the Component into the window */
add( "Center", glc );
pack(); show();
/** Register the keyboard listener */
KeyListener kl = new KeyAdapter() {
public void keyPressed( KeyEvent evt ) {
System.err.println( "keyPressed :" + evt.getKeyChar() );
}
}
};
glc.addKeyListener( kl );
this.addWindowListener( this );
}
/** WindowListener methods */
public void windowActivated( WindowEvent evt ) {
}
public void windowClosed( WindowEvent evt ) {
}
public void windowClosing( WindowEvent evt ) {
dispose();
System.exit( 0 );
}
public void windowDeactivated( WindowEvent evt ) {
}
public void windowDeiconified( WindowEvent evt ) {
}
public void windowIconified( WindowEvent evt ) {
}
public void windowOpened( WindowEvent evt ) {
}
}