Basic JInternalFrame problem
Hi, I have a JInternalFrame that has to pass an Objectto its parent JDesktopPane.
How can I send that Object to the JDesktopPane when the ActionListener in the JInternalFrame executes?
I have no problem getting the Object when I instantiate the JInternalFrame, but I don磘 know how to get it after that.
I磀 appreciate your help a lot. Thank you very much.
# 2
I think I know what you're after:
call your JDesktopPane DesktopPane
, and your JInternalFrame InternalFrame
.
public class InternalFrame implements JInternalFrame{
private DesktopPane desktopPane;
public InternalFrame(DesktopPane dp){
super("name");
this.desktopPane = dp;
......... etc
when creating the JInternalFrame from the JDesktopPane,
InternalFrame internalFrame = new InternalFrame(this);
now providing you have a method in your deskop class that you can pass the object to, you can call something like
this.desktopPane.passObject(obj);
from anywhere in your JInternalFrame class.
AS