How to call a custom jDialog

I am using NetBeans 5.5 and created a custom jDialog. I want to be

able to call the custom jDialog from another Form. The dialog I created

allows a user to set parameters for a template. The template saves

basic employee information to a text file for populating a time card.

When the template needs to be altered, the user would call the

template, which is the custom jDialog, to reset the template.

I thought I could just instantiate the custom jDialog class I created and

use a 'go()' method to bring up the templateChooser jDialog but

nothing seems to be working. Here is some sample code:

Here are sample code:

publicclass templateChooserextends javax.swing.JDialog{

/** Creates new form templateChooser */

public templateChooser(){

}//end template Chooser()

publicvoid go(){

initComponents();

templateAttributesEnabled(false);

jCmbxDutyDaysEnabled(false);

formLoadData_onDialogOpen();

}//end go

. . .

}//end of templateChooser

publicclass tcFormextends javax.swing.JFrame{

public tcForm(){

initComponents();

//jf.setVisible(true);

}//end constructor

privatevoid jMenuItem_OpenTemplateMouseClicked(java.awt.event.MouseEvent evt){

// TODO add your handling code here:

//call the template dialag box

templateChooser tc =new templateChooser();

tc.go();

}// end jMenuItem

...

}//end class

[2634 byte] By [SaipanMan2005a] at [2007-11-26 14:34:23]
# 1
Cross-Posted: http://forum.java.sun.com/thread.jspa?threadID=5122841&messageID=9431254#9431254
es5f2000a at 2007-7-8 2:30:32 > top of Java-index,Desktop,Core GUI APIs...
# 2
Your exactly right...I moved to the swing forum...it seemed better suited here. Any Ideas on the problem I had posted?
SaipanMan2005a at 2007-7-8 2:30:32 > top of Java-index,Desktop,Core GUI APIs...
# 3
I agree that the swing forum is the correct place to post. It wouldbe nice if you put a link in this thread so that people are all workingon the same instance of the problem.
es5f2000a at 2007-7-8 2:30:32 > top of Java-index,Desktop,Core GUI APIs...
# 4
you are right.... my apologies...
SaipanMan2005a at 2007-7-8 2:30:32 > top of Java-index,Desktop,Core GUI APIs...
# 5
1. Look at my reply in the other thread.2. You removed the tc.setVisible(true) line, so now the dialog will not show for sure...3. It's better to call go in the constructor.
Rodney_McKaya at 2007-7-8 2:30:32 > top of Java-index,Desktop,Core GUI APIs...
# 6

OK...I figured it out!!!

For all that our out there using NetBeans5.5. When using the MenuItem and selecting mouseclick as an event will not cause the desired action to occur. You have to select Action -> ActionPerformed for that menuItem. My menu Item now "fires" the event for my custom dialog to appear. Go figure...I would have thought that the event mouseClicked would be fine...I guess not.

SaipanMan2005a at 2007-7-8 2:30:32 > top of Java-index,Desktop,Core GUI APIs...