I suspect that I have some components in the wrong place in the program I am working on, but am not sure. The only compile code error I get right now is "class, interface, or enum expected" at line 80.
Could someone take a look and see why I get the above error -- and comments are welcome about other errors you may spot.
CODE
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/* FrameDemo.java requires no other files. */
public class FrameDemo3 extends JFrame
{
public static void main(String[] args)
{
DataOutputStream output;//Per text, p. 8.13, declare output stream
}
/**
* Create the GUI.
*/
private static void createAndShowGUI()
{ //Create and set up the window.
JFrame frame = new JFrame("Week 3 Program (PRG/421) - CM");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//JLabel emptyLabel = new JLabel("Carole McMillen");
//emptyLabel.setPreferredSize(new Dimension(100, 150));
//frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
JPanel firstRow = new JPanel();
//Display the window.
frame.setSize(400, 400); //This sets the frame size.
frame.setLocationRelativeTo(null); //This sets the frame location to the center of the screen.
frame.setVisible(true); //This means you can see the frame.
}
//}//*************************
private void initializeComponent()
{
JPanel first = new JPanel();
jLabel2 amt = new JLabel();
jLabel3 amtfield = new JLabel();
jLabel4 tlabel = new JLabel();
jLabel5 ttext = new JLabel();
jCheckBox1 ask = new JCheckBox();
jTextField1 t1 = new JTextField();
jTextField2 t2 = new JTextField();
jTextArea1 t3 = new JTextArea();
jComboBox1 box1 = new JComboBox();
jComboBox2 box2 = new JComboBox();
contentPane getinfo = (JPanel)this.getContentPane();
jLabel2.setText(" Loan Term (Yrs):");
jLabel3.setText(" Enter a loan amount (no commas or $ please):");
jLabel4.setText(" Interest Rate (%):");
jLabel5.setText(" Monthly Payment on this loan is: ");
jCheckBox1.setText(" Click here to see an amortization of your chosen loan.");
jCheckBox1.setSelected(true);
jCheckBox1.addItemListener(new ItemListener()
{
public void itemStateChanged(ItemEvent e)
{
jCheckBox1_itemStateChanged(e);
}
});
}
//*******************
public static void main(String[] args)
{
createAndShowGUI();
}
}
}
}
Thanks!