Thread View: aus.computers.java
1 messages
1 total messages
Started by Paul Murray
Fri, 11 May 2001 13:39
I am finding managing focus and verifying fields on a form to be a major hassle.
Author: Paul Murray
Date: Fri, 11 May 2001 13:39
Date: Fri, 11 May 2001 13:39
39 lines
3168 bytes
3168 bytes
I am finding managing focus and verifying fields on a form to be a major hassle. We have a form - ok? A JPanel. It has a client code textfield (tC), and two other textfields each with a button (tA and tB, and bA and Bb). If the user types anything into tA, then tries to move the focus elsewhere, then tA must be freified and must grab the focus back ... *UNLESS* they have clicked bA, becuase bA pops up a picklist. I could stick an inputverifier on tA and tB, but I'd have to tell bA and Bb to ignore input verifiers. But that's no good, because they must not ignore *each other's* verifiers, only their own. There are a score of problems like this. Basically, we need to catch "they are moving focus from component X to component Y - is this ok?", and there seems to be no place to catch it. InputVerifier only half works, becuae it wont tell you where the focus is going *to*. We have our own focus manager, but that handles only keystrokes, not mouse clicks. Plus, there's the BasicButtonUIListener bug with respect to input verifiers, but that's another issue. I don't want to slap FocusEventListeners on each component - although it's a solution, I suppose. I could make one FocusEventListener for the form and recursively apply it to all components that catch focus. Of course, you have to use reflection to determine what components do that, because there is no FocusEvenSource interface. I have so many different *bits* to do the things that the users expect. I have a AWTEventListener to catch double-clicks before JTextField consumes them. I have a FocusManager to catch tab keys on certain components and generate ActionPerformed events instead. And interfaces to go with them, that the forms implement. Isn't there something simpler? -------------------------------------------------------------- http://www.users.bigpond.com/pmurray ICQ: 26066755
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads