Okay, I just can figure this out. I'm fairly new to Java but not programming on the whole. Am I missing something obvious here?
Code:
package dmpanel;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class MainPanel extends JPanel implements ActionListener {
public static void main(String args[]){
}
MainPanel() {
createAndShowGUI casg = new createAndShowGUI();
JTextField d20 = new JTextField();
}
void createAndShowGUI() {
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame("DMPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addPanelsToPane(frame.getContentPane());
frame.pack();
frame.setVisible(true);
}
public void actionPerformed(ActionEvent evt) {
}
}
I know the code is kind of a mess but i'm just playing around trying to make a dnd DM's panel. (I also didn't include a fair number of methods that don't matter).
The compiler complains it cannot find createAndShowGUI when I try to initialize it in the contstructor (or if I try and do it in the main method it complains too). Help please!