/*
This program display the input screen,
accepts input data and and passes the data to the logic class
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
class CheckboxSample extends JFrame implements ActionListener
{
//*****************//
// CLASS VARIABLES //
//*****************//
private static final int FRAME_WIDTH = 1019;
private static final int FRAME_HEIGHT = 520;
private static final int FRAME_X_ORIGIN = 00;
private static final int FRAME_Y_ORIGIN = 00;
// private static final int BUTTON_WIDTH = 80;
// private static final int BUTTON_HEIGHT = 30;
//********************//
// INSTANCE VARIABLES //
//********************//
// private JButton okButton;
// private JButton cancelButton;
protected JTextField inputLine1; //This part added for Input Text field
protected JTextField inputLine2; //This part added for Input Text field
// protected JTextField inputLine3; //This part added for Input Text field
// protected JTextField inputLine4; //This part added for Input Text field
protected JTextArea textArea1; //This part added for Input Text field
protected JTextArea textArea2; //This part added for Input Text field
protected JLabel promptText1;
protected JLabel promptText2;
protected JLabel promptText3;
protected JLabel promptText4;
protected JLabel promptTextHelp;
protected JCheckBox cb1;
protected JCheckBox cb2;
//************************************************//
//** CONSTRUCTOR FOR OBJECTS OF CLASS TEACHMATH **//
//************************************************//
public static void main (String[ ] args)
{
CheckboxSample g = new CheckboxSample();
g.setVisible(true);
}
public CheckboxSample( )
{
Container contentPane = getContentPane();
// set the frame properties
setTitle ("Add");
setSize (FRAME_WIDTH, FRAME_HEIGHT);
setLocation (FRAME_X_ORIGIN, FRAME_Y_ORIGIN);
setResizable(false);
// set the content pane properties
contentPane.setLayout(null);
contentPane.setBackground(Color.white);
promptTextHelp = new JLabel();
promptTextHelp.setText("[Question on top, answer below]");
promptTextHelp.setBounds(800, 15, 350, 25); // 30 from left, 20 from top, 150 length, 25 height
contentPane.add(promptTextHelp);
promptText1 = new JLabel();
promptText1.setText("Code:");
promptText1.setBounds(30, 10, 150, 25); // 30 from left, 20 from top, 150 length, 25 height
contentPane.add(promptText1);
inputLine1 = new JTextField();
inputLine1.setBounds(70, 10, 100, 25); // 100 from left, 20 from top, 200 length, 25 height
contentPane.add(inputLine1);
inputLine1.addActionListener(this);
contentPane.add(inputLine1);
promptText2 = new JLabel();
promptText2.setText("Category:");
promptText2.setBounds(200, 10, 150, 25); // 30 from left, 20 from top, 150 length, 25 height
contentPane.add(promptText2);
inputLine2 = new JTextField();
inputLine2.setBounds(260, 10, 350, 25);
contentPane.add(inputLine2);
inputLine2.addActionListener(this);
contentPane.add(inputLine2);
cb1 = new JCheckBox();
cb1.setText("T1");
cb1.setBackground(Color.white);
cb1.setBounds(640, 10, 60, 25);
contentPane.add(cb1);
cb2 = new JCheckBox();
cb2.setText("T2");
cb2.setBackground(Color.white);
cb2.setBounds(710, 10, 60, 25);
contentPane.add(cb2);
textArea1 = new JTextArea();
textArea1.setEditable(true);
JScrollPane scrollText1 = new JScrollPane(textArea1);
//scrollText.setBounds(20, 10, 353, 375);
scrollText1.setBounds(10, 40, 998, 200);
scrollText1.setBorder(BorderFactory.createLineBorder(Color.blue));
contentPane.add(scrollText1);
textArea2 = new JTextArea();
textArea2.setEditable(true);
JScrollPane scrollText2 = new JScrollPane(textArea2);
//scrollText.setBounds(20, 10, 353, 375);
scrollText2.setBounds(10, 250, 998, 200);
scrollText2.setBorder(BorderFactory.createLineBorder(Color.blue));
contentPane.add(scrollText2);
// register 'Exit' upon closing as default close util
setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setVisible(true);
}
public void actionPerformed(ActionEvent event)
{
}
private void processButtonAction(String buttonText)
{
}
private void processanswerAction(String keyPressed) //for search
{
}
} // End of Class