JMenuItem elements resulting from a query and that seems like a table

Hello everyone! I created a script that opens a popup below the clicked row (JMenuItem) …
I would like to know basically two things:

  1. Can the items displayed in the popup be the result of a query?
  2. Is it possible to add rows and columns to the popup in the photo?

  1. Yes, but be careful running queries - they can take an indeterminate amount of time, so running them via scripting is a good way to lock up the event dispatch thread. You should probably run your query in a custom property or something similar, then filter the results with a script.
  2. Not really, or at least not easily. To render a table-like structure, you’re probably going to need to literally create a table, which means you’re entirely outside the expected behavior of JMenuItems. It’ll entirely involve your own custom scripting, and you’ll need to import your own swing objects to render.
1 Like

I solved it in this way … It seems to work fine! Now my doubt is if I can add a working button (JButton) inside the table. Could you give me a working script of a JButton on table?