This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
if (e.equals ("button1"))
StudentProfileGui itemloader=new StudentProfileGui();
if (e.equals ("button2"))
StudentProfileEditGui itemload=new StudentProfileEditGui();
thats what im using at the min... where the underline it it says void is an invalid type for the action actionPerformed and the other is missing syntax ( )
Joined: Jun 09, 2003
> if (e.equals ("button1"))
this is just totally wrong.
'e' is an actionEvent, so cannot be equal to a button
button1 is probably the variable name for the button,
so should not be enclosed in quotes.
what you probably want is
It looks like you are attempting to switch back and forth between frames,
so you'd probably be better off using a single frame and having the contentPane
set up as a CardLayout (which contains multiple panels, only one panel showing at a time),
then using a JMenu to switch between panels.
Joined: Dec 14, 2011
thanks so much for all your help, i managed to sort it earlier! got a new question now but will start a new topic