aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Problems in Focus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problems in Focus" Watch "Problems in Focus" New topic
Author

Problems in Focus

Shane Roylance
Ranch Hand

Joined: Aug 29, 2001
Posts: 72
I have many and varied questions about focus management in java 1.4, if anyone could direct me to a great source of information on that subject I would appreciate it.
One specific question I have has to do with KeyListeners. In 1.3 I was able to add a key listener to a JFrame which may have various other objects, lets say it has a scroll pane which includes a text area. When the frame had focus (one of the components held the focus) key events would fall through to the key listener on the frame. I could set up a key listener on a component that may consume some key events which would then not get to the listener on the frame, etc. In 1.4 this does not work, key events seem to be only visible to the actual component that has focus. Is that the way it really is, or am I missing something??
TIA
Shane
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Moving to Swing/AWT


"JavaRanch, where the deer and the Certified play" - David O'Meara
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

There looks to be a good reference to the new 1.4 Focus API here (It's a PDF from JavaOne 2001). I haven't used any of it yet, but there seem to be lots of complaints about things working differently in the Java Bug Database.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems in Focus
 
Similar Threads
Focus Lost throws error
implementing "Enter" short cut key
Setting Focus in a DeleteKeyListener
KeyListener() is sometimes deaf
Keys for JButtons