I have actually been working on a solution similar to this one, although the problem seems to be when this scrolling menu is used as an item in a popup menu. I have a popup menu with 3 items, one of which is another menu (the scrolling menu), so I should be able to mouse over that and display the scrolling list of items. It works until I want to press the scroll bar. The popup menu thinks that I have clicked on another component and hides itself. Do you see what I'm saying and have any thoughts on how to get around this?
Joined: Jan 14, 2004
The popup menu thinks that I have clicked on another component and hides itself. Do you see what I'm saying and have any thoughts on how to get around this? Yes, I ran into the same problem. You may have to write some plaf code to get around this. I'd start with both JMenu and BasicMenuUI and look for the behavior that you want to modify. You can often extend the class and override/modify a few things to get what you want. The behavior seems complex so I would guess that it wouldn't be productive to replicate everything in your custom component. You never know...
Joined: Oct 09, 2006
In the meantime, I think I've found a hack to this solution. I use a second popup menu that is not actually an item in the first and just trick the menu to show that second popup menu (a BasicComboPopup) when the mouse is in the appropriate location. Seems to be doing the trick for the most part. I appreciate the help.