When i m clicking on next another frame is open but i want
to hide the previous frame...........but it is not
happening....still both frame are visible........how to
make one frame to hide.......please help me.......

Answer Posted / romesh nongthombam

The best way to do in such condition is used the Card layout
so that you can easily process next previous function.

If you want to hide the frame, you can use like this

JFrame f1 = new JFrame("Frame 1");
JFrame f2 = new JFrame("Frame 2");

to hide f1, call f1.setVisible(false);
to show f2, call f2.setVisible(true);

Is This Answer Correct ?    34 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sling swing?

534


What is an event and what are the models available for event handling?

543


Which layout does swing use by default?

496


What is java swing package?

511


What are the components of java swing?

524






What is import javax swing jframe?

551


Which method of the Component class is used to set the position and size of a component?

564


What is swing api?

525


What does javax swing do?

541


What is pane in swing?

530


What is swing control?

511


Can a class be it?s own event handler? Explain how to implement this?

538


What is java swing application?

530


What is swing gui?

504


What is the purpose of action interface in swing?

554