Skip to main content

Switching JPanels with JButtons

No replies
jkiernan99
Offline
Joined: 2013-09-11
Points: 0

I have a Java Project that I am working on but need some help with my jbuttons. I first made the project with jframes but that was a huge mistake. So, I switched to jpanels. I tried doing what I was doing with my jframes on the action listener because it worked but now it doesn't. The code was "btnStartGame.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnStartGameActionPerformed(evt);
Question q = new Question();
q.setVisible(true);
}"
I will put the full code of the jpanels and the main jrame in a pastebin.

MainMenu: http://pastebin.com/xk51PKh9
Question: http://pastebin.com/5qDhjSBp