java - Create a new ArrayList in Netbeans -
i'm new programming in netbeans
, keep simple possible, please.
so, right have 3 java files in same project: mainframe.java, edit.java , add.java.
in mainframe-window have 2 buttons edit , add-window. in add-window enter text in text field , press button add arraylist
, did this:
public static void main(string args[]) { list<string> hey = new arraylist<string>(); }
and button:
private void btnfortsattactionperformed(java.awt.event.actionevent evt) { //the variable name of text field "txfcreate" string text = txfcreate.gettext(); hey.add(text); //the problem here netbeans cannot find "hey" symbol }
next, in edit-window, have jlist
show content of arraylist
. have no idea know how code it:(
public class { list<string> hey; public static void main(string args[]) { hey = new arraylist<string>(); } private void btnfortsattactionperformed(java.awt.event.actionevent evt) { //the variable name of text field "txfcreate" string text = txfcreate.gettext(); hey.add(text); //the problem here netbeans cannot find "hey" symbol }
}
Comments
Post a Comment