java - How to make two separate frames disappear to make way for another one? -


i have 3 frames, let's call them frame welcome, frame main, frame sub. they're in separate classes.

frame welcome has button makes frame main visible when clicked.

frame main has button makes sub pop when clicked (sort of dialog box yeah has graphical design figured out put in separate frame, though i'm considering jpanel i'm not sure how that: how make pop when it's in jpanel, possibly setvisible havent tried yet might try later), there button in frame sub when clicked, should make frame main , frame sub invisible , display frame welcome instead.

at moment, have code making sub disappear , make welcome appear, can't figure out how make main invisible too.

public void actionperformed (actionevent e) { if (e.getsource() == btn) { framewelcome fw = new framewelcome(); setvisible(false); fw.setvisible(true); } } 

this makes frame sub invisible , frame welcome visible, how make frame main invisible (sub sort of inside main, because it's displayed when button clicked in main)? isn't code i'm not sure parts post yeah


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -