• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pressing Tab key in IE with latest JRE version

 
stan Fish
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,



I have question about typing "TAB" key in Java Applet in internet explorer with JRE 1.05_08 or above.
When I type any key other than "TAB", the function, processEvent, will be called 3 times to process keyPressed, keyTyped and keyReleased. However, when I type "TAB" key, processEvent is only called once to process keyTyped and the focus goes outside the applet.

Is there any way that the focus won't get lost when typing the "TAB" key?

Note that this problem only happens in IE browser with JRE 1.05_08 or above. It works well in Firefox and netscape with any JRE version and works well in IE with JRE 1.05_06 and below.


The following is my code:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class KeyEventDemo extends Applet implements KeyListener, FocusListener {
public KeyEventDemo() {
super();
addKeyListener(this);
addFocusListener(this);
}
public void keyTyped(KeyEvent e) {
System.out.println("KEY TYPED: e="+e);
}
public void keyPressed(KeyEvent e) {
System.out.println("KEY PRESSED: e="+e);
}
public void keyReleased(KeyEvent e) {
System.out.println("KEY RELEASED: e="+e);
}
public boolean keyDown(Event e, int key) {
System.out.println("keyDown: e="+e);
return false;
}
public boolean keyUp(Event e, int key) {
System.out.println("keyUp: e="+e);
return false;
}
public void processEvent(AWTEvent e) {
System.out.println("processEvent : e="+e);
}
public void focusGained(FocusEvent e){System.out.println("FocusGained");}
public void focusLost(FocusEvent e){System.out.println("FocusLost");}
public void paint ( Graphics g ){
this.setBackground ( Color.blue );
}
public boolean isFocusTraversable() {
return true;
}
public boolean getFocusTraversalKeysEnabled() {
return false;
}
}


Thanks very much!
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcomt to JavaRanch.

There seem to be bugs in the Java Plugin that affect this - check the Java Bug database for #6463913 and #6456655.
 
stan Fish
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much for your information.
I have checked the Java bug database, it looks like #6463913 pretty match my problem. However, when I can't reproduce his problem. May be he already has a fix on it. I am wondering how he fixed it. Does anyone know any way to contact the bug writer? Thanks!!



Originally posted by Ulf Dittmer:
Welcomt to JavaRanch.

There seem to be bugs in the Java Plugin that affect this - check the Java Bug database for #6463913 and #6456655.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic