Is it possible to "unselect" a JMenu/JMenuItem?
I have a JMenu and JMenuItem, and an AWT TextArea below, in my case the AWT TextArea does things the Swing version cannot so I need it, but when I make a menu selection the TextArea will be drawn on top of the expanded JMenu/JMenuItem until the operation is finished and then it'll go away.
So what I'm hoping to do is that once the JMenuItem is selected, and its operation starts, I could do an "unselect" action on the JMenu/JMenuItem, so it would "go away" early to avoid the visual problem of the TextArea on top of the menu.
Is that possible?
I've tried to do a [JMenu].setSelected(false); and the same for the JMenuItem and that doesn't seem to work.
This is on a Swing app running on Windows.
Yes, I know I shouldn't try to mix Swing and AWT components, but in my case the AWT TextArea does things that the Swing version couldn't.
Or, if it's not possible to "unselect" it, a way to force the JMenu/JMenuItem to appear properly above the TextArea?
Thanks!
https://stackoverflow.com/questions/65741997/can-you-unselect-a-jmenu-jmenuitem January 16, 2021 at 02:52AM
没有评论:
发表评论