Re: JButton to open new Page
Why are you declaring a new JButton inside your ActionListener? You should be comparing the source to the JButtons to which you add the ActionListener. Alternatively, you could just add a different ActionListener to each JButton and not worry about the source.
Re: JButton to open new Page
Netbeans gives me an error of cannot find symbol for item5, and suggest making a local variable. I am planning on putting new actionlisteners for each button. (See lines 51 and 52.) Then I was using "if" to call the proper button in the actionperformed method. (Not sure, but I hope that answers your question and helps in answering mine.)
Re: JButton to open new Page
You shouldn't just go with what your IDE suggests. This is actually one of the downsides to using an IDE as a beginner- in this case, your IDE was completely wrong about what to do. I really suggest using a simple editor and the command prompt until you really understand what the compiler errors mean.
Get rid of the item5 declared inside your ActionListener. The error you'll see then is simply telling you that it can't "see" any variable named item5. It can't see item5 because item5 is declared inside another method.
Re: JButton to open new Page
I did as you said and it won't let run the program. Is my actionperformed method correct?
Re: JButton to open new Page
I wouldn't expect it to run the program, as you have a compiler error you have to resolve. I've told you the cause of the error, and I've given you one solution to your problem. Another solution is to make sure you declare your variables in the proper scope- if you need to use a variable outside of a method (rather, inside multiple methods), don't declare the variable inside a single method.
The basic tutorials, which should be your first stop, go over this: Declaring Member Variables (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
Re: JButton to open new Page
Thank you for your help Kevin, I will do all of these things shortly. I appreciate your help very much!