/* * NewJFrame.java * * Created on November 4, 2007, 5:56 PM */ /** * * @author Nathan Dailey */ public class ViewingQuestions extends javax.swing.JFrame { /** Creates new form NewJFrame */ public ViewingQuestions() { 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. */ // //GEN-BEGIN:initComponents private void initComponents() { javax.swing.JScrollPane jScrollPane1; jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jTextField1 = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setTitle("View Questions"); jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane1.setHorizontalScrollBar(null); jScrollPane1.setMaximumSize(new java.awt.Dimension(327, 327)); jScrollPane1.setPreferredSize(new java.awt.Dimension(406, 403)); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {"Can I write a function in C?", "Yes", "Csc 102", "Short Answer", "2 min", "3", "Medium", "9/25/02", "Funtion, review", "Fisher's Computer"}, {"Can you write a method in java?", "Yes", "Csc 101", "Short Answer", "2 min", "1", "Very Easy", "9/2/01", "Review, Java", "Fisher's Computer"}, {"Could a programmer write a function in C?", "Yes, the programmer has the ability to write functions in C.", "Csc 102", "Long Answer", "10 min", "Any", "Easy", "9/2/02", "Function, method", "Fisher's Computer"}, {"How many methods are allowed in a Class?", "Infinite number.", "Csc 101", "Multiple Choice", "1 min", "Any", "Hard", "9/5/02", "method, class", "Fisher's Computer"}, {"Is their a function limit in C?", "No", "Csc 102", "Short Answer", "1 min", "6", "Easy", "9/10/02", "Function, limit, C", "Fisher's Computer"}, {"What does object oreiented mean?", "Object oriented means that program are built around object and methods.", "Csc 101", "Long Answer", "10 min", "8", "Medium", "9/11/02", "Object, java, method", "Fisher's Computer"}, {"Why is C not object oriented?", "Because, C does not have any object only functions.", "Csc 102", "Short Answer", "1 min", "2", "Easy", "9/7/06", "C, Function, Object", "Fisher's Computer"}, {"Write a linked list in Java.", "#include #include", "Csc 101", "Code", "20 min", "9", "Very Hard", "3/3/03", "Linked List, java", "Fisher's Computer"}, {"Write an example linked list in C.", "public class Linked List", "Csc 102", "Code", "15 min", "8", "Hard", "9/25/02", "Linked List, C", "Fisher's Computer"}, {"You can write a method in java.", "True", "Csc 101", "True/False", "1 min", "Any", "Very Easy", "9/22/04", "Method, java", "Fisher's Computer"} }, new String [] { "Question", "Answer", "Class", "Type", "Length", "Week", "Difficulty", "Last Used", "Keywords", "Author" } )); jTable1.setCellSelectionEnabled(true); jTable1.setOpaque(false); jTable1.setPreferredSize(new java.awt.Dimension(800, 800)); jScrollPane1.setViewportView(jTable1); jScrollPane1.getAccessibleContext().setAccessibleParent(jTable1); jLabel1.setText("Search:"); jLabel2.setText("Search by:"); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Question", "Answer", "Class", "Type", "Length", "Week", "Difficulty", "Last Used", "Keywords", "Author" })); jButton2.setText("OK"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("Cancel"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); 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) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 918, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel1)) .addGap(31, 31, 31) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(216, 216, 216) .addComponent(jButton2) .addGap(22, 22, 22) .addComponent(jButton3))))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(8, 8, 8) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton2) .addComponent(jButton3)) .addGap(29, 29, 29)) ); pack(); }// //GEN-END:initComponents private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed //TODO add your handling code here: //Just hides window for purposes of prototype this.setVisible(false); }//GEN-LAST:event_jButton3ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: // Just hides window, for purposes of prototype this.setVisible(false); }//GEN-LAST:event_jButton2ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ViewingQuestions().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JComboBox jComboBox1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JTable jTable1; private javax.swing.JTextField jTextField1; // End of variables declaration//GEN-END:variables }