Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a JFrame from an JApplet with multiple components 1

Status
Not open for further replies.

rocknrisk

Programmer
May 14, 2002
43
GB
Hi all,

Please can you help with this "simple" problem. I need to open a JFrame from an JApplet with multiple components.

The code I have so far is:

JApplet:
In constructor:
jbtnAdd.addActionListener(this);

In method:
public void actionPerformed(ActionEvent ae) {
jbtnAdd.setEnabled(false);
new ShiftSwapForm("Create New Shift Swap", jbtnAdd);
}

JFrame:
Field:
private JButton launch;

Constructor:
public ShiftSwapForm(String title, JButton launch) {
super(title);
this.launch = launch;
}


public void actionPerformed(ActionEvent ae) {
dispose();
launch.setEnabled(true);
}

OK. I have no idea what I'm doing wrong. The button in the applet gets disabled but the frame does not appear. This works in a very simple example but not in my application. I must be overlooking something very simple.

Thank you in advance for any help.

Clinton [love]

"The important thing is not to stop questioning." - Albert Einstein
 

ShiftSwapForm ssf = new ShiftSwapForm("Create New Shift Swap", jbtnAdd);
ssf.setVisible(true);


See if that works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top