DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login
Java
IT Tags

When i click the Jbutton in the first JFrame the JFrame should close and open the other JFrame and vice versa

By: rekha singh | 19 Apr 2010 6:28 pm

Hi,

I created two JFrame, the two JFrame have a JButton on them, what i want is that when i click the Jbutton in the first JFrame the JFrame should close and open the other JFrame and vice versa. please i need someone to help me it is urgent. thank u all.

 

Comments

It's not that difficult!

I believe you know how to work with actiionListener. Under the actionListener for each button, create an object of the other JFrame class. Then followed by a call to System.exit(0);

I hope you got that.
By: rekha singh | 19 Apr 2010

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move