JTextField was initialized properly. I have that directly after declaring the class.
here is all the code if it helps anyone...
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import Doug;
public class Dmath extends javax.swing.JFrame implements ActionListener {
String num3[];
JButton mult = new JButton("*"

;
JButton div = new JButton("/"

;
JLabel num2 = new JLabel("Second Number: "

;
JTextField text2 = new JTextField(3);
JLabel num1 = new JLabel("First Number: "

;
JTextField text1 = new JTextField(3);
JTextField text3 = new JTextField(15);
JButton add = new JButton("+"

;
JButton subt = new JButton("-"

;
public Dmath(){
initComponents();
pack();
}
private void initComponents(){
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
}
);
}
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit(0);
}
public static void main(String[] args){
Dmath mainWindow = new Dmath();
mainWindow.addParams(mainWindow);
mainWindow.show(false);
mainWindow.resize(150, 200);
mainWindow.show(true);
}
public void addParams(Dmath mnWin){
FlowLayout fl = new FlowLayout();
mnWin.getContentPane().setLayout(fl);
add.addActionListener(this);
subt.addActionListener(this);
mult.addActionListener(this);
div.addActionListener(this);
mnWin.getContentPane().add(num1);
mnWin.getContentPane().add(text1);
mnWin.getContentPane().add(num2);
mnWin.getContentPane().add(text2);
mnWin.getContentPane().add(add);
mnWin.getContentPane().add(subt);
mnWin.getContentPane().add(mult);
mnWin.getContentPane().add(div);
mnWin.getContentPane().add(text3);
}
public void actionPerformed(java.awt.event.ActionEvent p1) {
Object src = p1.getSource();
Doug dg;
if (src.equals(add)){
dg = new Doug();
num3[0] = text1.getText();
num3[1] = text1.getText();
try {
dg.GetSumInts(num3);
text3.setText(String.valueOf(dg.SumOf()));
}
catch (Exception e) {
System.out.println("Error: BAD MAN!!"

;
System.exit(0);
}
}
else if (src.equals(subt)){
dg = new subt();
}
}
}
Its just a simple calculator program, and I know its not very pretty, but any suggestions would be helpful.
thanks