How to disable the F4 Key Event?

Hi Guys,

I have written my own FocusManager which allows me to traverse through disabled components. If a user presses the F4 key while the focus is in a disabled JComboBox, the popup becomes activated. Is there any way deactivate the F4 keystroke?

I have tried:

event.consume();

combobox.setPopupVisible(false);

combobox.hidePopup();

I also read that F4 is a low-level event maintained by Windows. Is this true? Is there no alternative?

-Sri :)

[508 byte] By [yreddy1] at [2007-9-26 3:35:24]
# 1

To anyone who may be interested:

I have tried all available solutions:

1. hidePopup()

2. setPopupVisible(false)

3. unregistering the F4 key event

4. catching the F4 key event and snubbing it

I have had no luck with the above solutions. It leads me to believe that F4 key is registered under the windows environment and it is a low-level event.

-Sri :)

yreddy1 at 2007-6-29 12:05:44 > top of Java-index,Archived Forums,Swing...
# 2

Sorry, I'm not able to answer your question, but I'm having a similar problem,

so I was wondering if you ever found a solution. I have a Swing GUI screen

that allows the page up key to take you off the screen when you press it.

Could you explain to me how you set up your code to consume your event.

Any help would be appreciated. Thx.

cpete at 2007-6-29 12:05:44 > top of Java-index,Archived Forums,Swing...
# 3

I'm having the same problem. I have a JComboBox and whenever it has focus and the F4 key is pressed, the popup comes up.

I've checked the Swing documentation and F4 is not listed in the 'Swing Component Keystroke Assignment' list. It should have no effect on a JComboBox.

Anybody have any ideas?

ragnor at 2007-6-29 12:05:44 > top of Java-index,Archived Forums,Swing...