• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Tab Key in JApplet and JtextField

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I have been struggling with this for a couple of weeks off and on. I asked a similar question 2 weeks ago in the Applet forum and got little to no help. So here goes in the Swing forum:
I have a JApplet with some JTextFields. I am running JDK1.4.1_01 on XP and JRE 1.4.1_01 in IE 6.0.
The tab keys do not work in traversing to the next component. I even went as far as disabling the key traversal and writing my own KeyEvent to handle the tab key. I can't even get it to recognize the fact that I am hitting the tab key. I have a simple Print statement to tell me when I hit TAB and nothing ever prints.
When this is in an Application Form, it works perfectly.
Does anyone know if this is a Bug and if there is a work around? I really need the tab to work.
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
tab at TextFeild dosnt work . its works on TextArea .. if u pressed tab then it will select next button or next event...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which is exactly what I want it to do, but it doesn't.
Thought I made that clear in my post.
Thanks for the reply though.
[ January 10, 2003: Message edited by: Gregg Bolinger ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I have narrowed the problem down to an actual bug in the JVM. Here is a link to it:
Bug Database
According to them, this issue has been fixed. But it hasn't. Also, on a related bug, they say it works fine in j2sdk1.4.2. Must be nice to be able to install a JDK release that isn't available yet and say everything is fixed. That doesn't help people that need it to work now.
The solution is you have to setTraversableCycleRoot(true) on the JApplet root container. Then you have to setFocusable(true) on every component you need to tab to. This is a workaround and does work.
However, there is still a problem. When creating my own KeyListener I was trying to capture the Tab KeyEvent.VK_TAB. This still doesn't work. In doing this, I noticed that hitting ENTER, SPACE, and TAB all give the same KeyEvent Integer of 0 for some reason. So they are not registering themselves correctly or something.
Anyway, just wanted to give an update as to the information I have found our regarding this problem.
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic