java - how to open frame2 from another frame1 by clicking button on frame1 in net beans -
i have created 2 frames in project in net beans named library.java , newcustomer.java , have button in library den code go newcustomer clicking button("new customer") in library??
inside library.java create method lets
`public void addactionlistnenerstocomponents();`
which call in library constructor(just suggestion.. depend on implementation). inside can have action listeners. scenario can like
jbutton newcustomerbutton = new jbutton("add customer"); newcustomerbutton.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { newcustomer newcustomerframe = new newcustomer(); newcustomerframe.setvisible(true); } });
Comments
Post a Comment