Swing Component Hierarchy and Overhead
Hi folks,
I'll try to present this as visually as I can, and then ask my question since the relevant code is long and spread across multiple classes/packages:
Say you have a component hierarchy like this:
JFrame
/\
/ \
JPanelJToolBar
/ \
/ \
JListJButton
And the JButton pops up a JFileChooser which returns a list of files, and you want to display the files in the JList, is there a lot of overhead associated with
creating a mutator in the JButton's class that "sets" the parent JFrame in the JButton?
For example:
private JFrame parent;
publicvoid setTopParent(JFrame parent)
{
this.parent = parent;
}
in order to gain access to the JFrame's children in a different branch of the component tree? Is there a best way to do this?
Thanks,
Joe
Message was edited by:
Joe_h
Edit: I had the component tree spaced so that it looks like a tree, but apparently Jive collapses all the whitespace.
Message was edited by:
Joe_h

