java - how to use many frame? -


well, have several jframes put them in different classes. jframe used start frame present list of buttons each 1 can start frame. if call frame using frame.setvisible (true). have frame on top of first. want know how open second , close first, if have example grateful

if want have many frames, can this:

firstly, not launch of frames @ once, launch 1 contains buttons. if corresponding button clicked, start method (the 1 launch frame) of corresponding frame should called. in frame buttons call

this.dispose();

to stop of frame's actions (including visibility , presence of icons in task bar).


here example:

private void buttonactionperformed(){ this.dispose(); otherframeclass.createwindow(); } 

just clarify in example method method called when button pressed , createwindow() method 1 launches next window


this work not elegant answer. refer the use of multiple jframes, good/bad practice?.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -