java - How to access an Existing JFrame Form? -
i'm having little problem accessing existing jframe form (i'm doing in netbeans way):
public class framea extends javax.swing.jframe { frameb b; //creates new jframe called b framea = this; //this jframe assigned variable string x; public framea() { initcomponents(); } private void btnclickme (java.awt.event.actionevent evt) { x = jtextfield1.gettext(); b = new frameb(); //creates new instance of frameb b.setvisible (true); //opens new jframe a.setvisible(false); //hides or closes current jframe } public string getme () { return x; //attempts value of x } } public class frameb extends javax.swing.jframe { framea = this.framea(); //calls existing jframe framea string clickie = a.getme(); //attempts x variable framea //assigns variable display on textarea jtextarea1.settext(clickie); public frameb() { initcomponents(); } }
i not sure doing wrong , little confused on how access existing jframe (framea here in case) current jframe (which frameb)
any appreciated! thanks!
Comments
Post a Comment