Ok this is the code I have so far.
I just havn't got a clue what the code should be for the calculate button(jButton1). I'm sure there are some clever people out there who do.
package untitled3;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class Frame1 extends JFrame {
JPanel contentPane;
XYLayout xYLayout1 = new XYLayout();
JTextArea jTextArea1 = new JTextArea();
JTextArea jTextArea2 = new JTextArea();
JTextArea jTextArea3 = new JTextArea();
JTextField jTextField1 = new JTextField();
JTextField jTextField2 = new JTextField();
JTextField jTextField3 = new JTextField();
JButton jButton1 = new JButton();
JTextArea jTextArea4 = new JTextArea();
JLabel jLabel1 = new JLabel();
/**Construct the frame*/
public Frame1() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
/**Component initialization*/
private void jbInit() throws Exception {
//setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]")));
contentPane = (JPanel) this.getContentPane();
jTextArea1.setBackground(SystemColor.control);
jTextArea1.setBorder(BorderFactory.createEtchedBorder());
jTextArea1.setText("Enter Your Loan Amount Here:");
contentPane.setLayout(xYLayout1);
this.setSize(new Dimension(450, 400));
this.setTitle("Frame Title");
jTextArea2.setBackground(SystemColor.control);
jTextArea2.setBorder(BorderFactory.createEtchedBorder());
jTextArea2.setText("The Amount of Interest(APR%)");
jTextArea3.setBackground(SystemColor.control);
jTextArea3.setBorder(BorderFactory.createEtchedBorder());
jTextArea3.setText("Enter The Loan Time (years)");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jTextField1_actionPerformed(e);
}
});
jTextField2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jTextField2_actionPerformed(e);
}
});
jTextField3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jTextField3_actionPerformed(e);
}
});
jButton1.setText("Calculate");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
jTextArea4.setBackground(SystemColor.control);
jTextArea4.setBorder(BorderFactory.createEtchedBorder());
jTextArea4.setText("The Monthly Payment Is");
jLabel1.setBorder(BorderFactory.createEtchedBorder());
jLabel1.setText("jLabel1");
contentPane.add(jTextArea1, new XYConstraints(11, 17, 213, 42));
contentPane.add(jTextField1, new XYConstraints(226, 17, 153, 41));
contentPane.add(jTextArea2, new XYConstraints(11, 74, 214, 45));
contentPane.add(jTextArea3, new XYConstraints(10, 139, 213, 47));
contentPane.add(jTextField3, new XYConstraints(229, 140, 154, 45));
contentPane.add(jButton1, new XYConstraints(100, 197, 171, 40));
contentPane.add(jTextArea4, new XYConstraints(8, 249, 199, 41));
contentPane.add(jLabel1, new XYConstraints(217, 247, 172, 42));
contentPane.add(jTextField2, new XYConstraints(230, 74, 153, 43));
}
/**Overridden so we can exit when window is closed*/
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
void jButton1_actionPerformed(ActionEvent e) {
String numberString = jTextField1 .getText();
double number = Double .parseDouble (numberString);
jLabel1.setText("");
}
}