/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * MultipleChoiceView.java * * Created on Nov 21, 2009, 5:35:43 PM */ package cstutor.quizcreation; /** * * @author Josh Robinson */ public class MultipleChoiceView extends javax.swing.JFrame { /** Creates new form MultipleChoiceView */ public MultipleChoiceView() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents private void initComponents() { optionBG = new javax.swing.ButtonGroup(); option4RB = new javax.swing.JRadioButton(); okB = new javax.swing.JButton(); option3RB = new javax.swing.JRadioButton(); cancelB = new javax.swing.JButton(); option4TF = new javax.swing.JTextField(); weightL = new javax.swing.JLabel(); option2RB = new javax.swing.JRadioButton(); weightTF = new javax.swing.JTextField(); option3TF = new javax.swing.JTextField(); correspondingSectionSP = new javax.swing.JScrollPane(); correspondingSectionList = new javax.swing.JList(); option1TF = new javax.swing.JTextField(); option2TF = new javax.swing.JTextField(); correspondingSectionL = new javax.swing.JLabel(); scrollBarSB = new javax.swing.JScrollBar(); showRenderedHTMLB = new javax.swing.JButton(); option1RB = new javax.swing.JRadioButton(); option5RB = new javax.swing.JRadioButton(); option5TF = new javax.swing.JTextField(); interactiveQuestionL = new javax.swing.JLabel(); questionSP = new javax.swing.JScrollPane(); questionTA = new javax.swing.JTextArea(); questionL = new javax.swing.JLabel(); setResizable(false); optionBG.add(option4RB); okB.setText("OK"); okB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okBActionPerformed(evt); } }); optionBG.add(option3RB); cancelB.setText("Cancel"); cancelB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelBActionPerformed(evt); } }); weightL.setText("Weight:"); optionBG.add(option2RB); correspondingSectionSP.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); correspondingSectionList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); correspondingSectionSP.setViewportView(correspondingSectionList); correspondingSectionL.setText("Corresponding Section:"); showRenderedHTMLB.setText("Show Rendered HTML"); optionBG.add(option1RB); optionBG.add(option5RB); interactiveQuestionL.setFont(new java.awt.Font("Tahoma", 1, 18)); interactiveQuestionL.setText("Multiple Choice Question Creation"); questionTA.setColumns(20); questionSP.setViewportView(questionTA); questionL.setText("Question:"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addComponent(option3RB) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(option3TF, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(option1RB) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(option1TF, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(option2RB) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(option2TF, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(option4RB) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(option4TF, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(option5RB) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(correspondingSectionL) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(correspondingSectionSP, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(option5TF, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(scrollBarSB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(questionL) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(interactiveQuestionL) .addComponent(questionSP, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE)))) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addComponent(cancelB) .addGap(116, 116, 116) .addComponent(weightL) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(weightTF, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 88, Short.MAX_VALUE) .addComponent(okB) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(showRenderedHTMLB) .addGap(138, 138, 138)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(interactiveQuestionL) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(questionL) .addComponent(questionSP, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(option1TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(option1RB)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(option2TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(option2RB)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(option3TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(option3RB)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(option4TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(option4RB)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(option5TF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(option5RB))) .addComponent(scrollBarSB, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(showRenderedHTMLB) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(correspondingSectionL) .addComponent(correspondingSectionSP, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(weightL) .addComponent(weightTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(22, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cancelB) .addComponent(okB)) .addContainerGap()))) ); pack(); }// //GEN-END:initComponents private void cancelBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelBActionPerformed // TODO add your handling code here: this.setVisible(false); }//GEN-LAST:event_cancelBActionPerformed private void okBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okBActionPerformed // TODO add your handling code here: this.setVisible(false); }//GEN-LAST:event_okBActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new MultipleChoiceView().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton cancelB; private javax.swing.JLabel correspondingSectionL; private javax.swing.JList correspondingSectionList; private javax.swing.JScrollPane correspondingSectionSP; private javax.swing.JLabel interactiveQuestionL; private javax.swing.JButton okB; private javax.swing.JRadioButton option1RB; private javax.swing.JTextField option1TF; private javax.swing.JRadioButton option2RB; private javax.swing.JTextField option2TF; private javax.swing.JRadioButton option3RB; private javax.swing.JTextField option3TF; private javax.swing.JRadioButton option4RB; private javax.swing.JTextField option4TF; private javax.swing.JRadioButton option5RB; private javax.swing.JTextField option5TF; private javax.swing.ButtonGroup optionBG; private javax.swing.JLabel questionL; private javax.swing.JScrollPane questionSP; private javax.swing.JTextArea questionTA; private javax.swing.JScrollBar scrollBarSB; private javax.swing.JButton showRenderedHTMLB; private javax.swing.JLabel weightL; private javax.swing.JTextField weightTF; // End of variables declaration//GEN-END:variables }