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 the function of abstractaction class?

584


How to create a swing gui in java?

526


How to change button color in java swing?

517


What is jfc swing in java?

522


How to perform action on button in java swing?

502






What is an on stage swing?

543


What is swing and awt in java?

513


What are swings?

515


What are the swing components?

498


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

562


Why swing is used in java?

535


Explain the difference between awt and swt.

547


What is import javax swing in java?

507


Why should any swing call back implementation execute quickly?

578


What are the benefits if Swing over AWT?

594