Arjit
Arjit

Reputation: 565

How do pass an event to other object?

I have a textBox and when the An keyevent is done i want my menu to get highlighted So i am looking for event passing from the textfield to the menu. So, is there any way to that ?

Thanks in Advance :)

Upvotes: 0

Views: 99

Answers (2)

dantuch
dantuch

Reputation: 9293

maybe it's "bad way", but try to make your menu class, extending old one, and add there some public method (with your highlighting logic) invoked by action listener in text filed

Upvotes: 0

lobster1234
lobster1234

Reputation: 7779

You can add a KeyListener to the textBox, and in keyPressed method you can implement the logic to manipulate the menu based on the criteria.

Upvotes: 2

Related Questions