开发者

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 highligh开发者_运维百科ted So i am looking for event passing from the textfield to the menu. So, is there any way to that ?

Thanks in Advance :)


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜