I have an output class receiving an array from an input class. The array is then changed into labels in the output class. I have an error in the main method of my output class. It might have something to deal with the connection between the input class. What should I have put in my main method of the output class to fix the error?
Code of input:
int[]output = new int[4];
output[0] = addObj.getSumA();
output[1] = addObj.getSumB();
output[2] = addObj.getSumC();
output[3] = addObj.getSumD();
Output outputObj = new Output(output);
Code of Output Class:
public class Output extends JFrame implements ActionListener
{
private JLabel numberA;
private JLabel numberB;
private JLabel numberC;
private JLabel numberD;
private Box numberBox;
private Box numberBox2;
public Output(int output[])
{
super("Output Frame");
this.setBounds(430,300,600,450);
this.getContentPane().setBackground(Color.PINK);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.setLayout(new BorderLayout());
this.numberA = new JLabel(Integer.toString(output[0]));
this.numberB = new JLabel(Integer.toString(output[1]));
this.numberC = new JLabel(Integer.toString(output[2]));
this.numberD = new JLabel(Integer.toString(output[3]));
numberBox = Box.createVerticalBox();
numberBox.add(numberA);
numberBox.add(numberC);
numberBox2 = Box.createVerticalBox();
numberBox2.add(numberB);
numberBox2.add(numberD);
this.setVisible(true);
}
public static void main (String[] args)
{
Output outputObj = new Output(int[]);
}
Keep in mind this is gui. The error is in the line above. int[] isn't the correct thing to enter, but I don't know what is.