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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDialog ques: 1

Status
Not open for further replies.

kohinoor2007

Programmer
Mar 21, 2007
69
DE
Hi Guys,

I have created a custom dialog which derives from the JDialog & have put some labels,radibuttons & an okay button.

MyDialog extendsJDialog{

public MyDialog(JFrame owner,String title,boolean modal){
super(owner,title,modal);

}

Now,Iam creating this custom dialog from a different class, say xyz.

JFrame f = (JFrame)SwingUtilities.getAncestorOfClass(JFrame.class,getParent());
testDlg = new MyDialog(f,"test",true);

No when the user presses the "okay" button in the custom dialog,want the dialog to close & return to the parent class from where it is called...

Is that possible with custom dialogs ......

Thanks...
 
Should be. You use the show() method to bring it up, and the hide() method to remove it again.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top