I basically am trying to write a piece a piece of code for an application that will list all the open frames in the program, and if you click one, it is selected and brought to the top of the program. I have a menu bar, and I want to be able to select a Menu from it, and then have that menu drop down and list all the open frames.
The problem is I have to gather the open frames whenever I click the menu, and so I have to dynamically create buttons, corresponding to an arbitrary amount of frames which might be open.
Getting a list of the components is not difficult, and creating buttons doesn't seem to be. I just go through a for loop of all the open components, creating buttons, within a mouse listener. But it won't let me insert these buttons into the menu unless the menu is final (which it can't be since it should be dynamic).