Hi,
I have a couple of questions about JPanel->JFrame communication:
1. I am opening a JFrame inside an ActionListener on a JButton inside a JPanel. Can I communicate with the JPanel from the JFrame via getParent() or some other method?
2. I am opening serveral JPanels inside a JFrame. Can I communicate with this JFrame via getParent() or other method?
3. In a situation with a JFrame with a primary JPanel (JFrame->JPanel), when I call JPanel.getParent(), I receive another JPanel, and it looks like a reference to the calling JPanel. Why don't I receive a reference to the JFrame? Is there a way to obtain this reference?
4. Is there a better way to open a new window than as described in #1? I basically have a main window (JFrame->>JPanel), that needs to allow the opening of another complex window to edit certain properties (JFrame->>JPanel). Given the way I am doing it (opening new JFrame from ActionLister) it looks like I will have to pass a reference to the original JPanel that contains the open button.
...Mike
I have a couple of questions about JPanel->JFrame communication:
1. I am opening a JFrame inside an ActionListener on a JButton inside a JPanel. Can I communicate with the JPanel from the JFrame via getParent() or some other method?
2. I am opening serveral JPanels inside a JFrame. Can I communicate with this JFrame via getParent() or other method?
3. In a situation with a JFrame with a primary JPanel (JFrame->JPanel), when I call JPanel.getParent(), I receive another JPanel, and it looks like a reference to the calling JPanel. Why don't I receive a reference to the JFrame? Is there a way to obtain this reference?
4. Is there a better way to open a new window than as described in #1? I basically have a main window (JFrame->>JPanel), that needs to allow the opening of another complex window to edit certain properties (JFrame->>JPanel). Given the way I am doing it (opening new JFrame from ActionLister) it looks like I will have to pass a reference to the original JPanel that contains the open button.
...Mike