i just wanted to knw how to switch between the frames with a button click there are three forms with next and previous buttons so when i click on next button it should go on next form and by clicking on previous button it should go on previous form so please help me how to do it....
You need to have 2 panels and not 2 frames (and not certainly with 2 main() methods which are 2 different programs).
Just have one frame, set the layout to CardLayout and add the panels one by one in the order you want them to appear. Then you can use the 'next()' and 'previous()' methods of the CardLayout to get the wizard behaviour.
That's because you're trying to create a new ActionListener(i). However, ActionListener is an interface and cannot be instantiated like that. You do know how to create an anonymous ActionListener as that's what you do just below that. Did you perhaps create an ActionListener implementation that you meant to instantiate instead?