java - How to create a scrollable JPopupMenu -


I am trying to create a JPopupMenu that has a scrollbar so that I can display a large number of items.

There are some implementations on the Web which are all of the problems:

  1. Correct (except for issues with isolation) , But if you scroll it highlighting and selection does not work anymore.

  2. One does not look like JPopupMenu (no L & F background or highlighting), but the addition works the fact that you You can not put JMNUITs in - instead you have to use some hacked buttons.

Before I try any of these or debug them, or write my own?

My suggestion should not be to use the popup menu if it is large

current Most of the OS user guidelines will also suggest. A menu that is going to be a nightmare to find something in the need to scroll to a big user, right?

Instead of a filterable list instead of a popup window / dialogue?

(For example, CTRL + O popup filterable tree in Eclipse, or CPU + eclipsed in space content assistant list)


Comments