java - How to pass value from JInternalFrame to JDialog -
i want know how pass value string jinternalframe
jdialog
. jdialog
child form , jinternalframe
parent form. if can please show me simple example.
here code , want pass id productdetails addquantity , tried use static it's not working
public class productdetails extends javax.swing.jinternalframe { string id; public productdetails() throws exception { initcomponents(); } //this button go jdialog private void btnaddquantityactionperformed(java.awt.event.actionevent evt) { id = txtid.gettext(); addquantity aq = new addquantity(null, true); aq.setlocationrelativeto(aq); aq.setvisible(true); } } public class addquantity extends javax.swing.jdialog { productdetails pd; public addquantity(java.awt.frame parent, boolean modal) { super(parent, modal); initcomponents(); //i use showmessage show result show me nothing joptionpane.showmessagedialog(this, pd.id); txtcurrentid.settext(pd.id); } }
well according me there no specific method u can 1 thing declare data static , u can access static thing dialog box too. u can show there :)
other thing make method input parameters dialog.
Comments
Post a Comment