/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * InstrTime.java * * Created on Dec 8, 2010, 11:10:48 PM */ package scheduletool; /** * * @author Adriel */ public class InstrTime extends javax.swing.JFrame { // public InstrRoom inroom; /** Creates new form InstrTime */ public InstrTime() { initComponents(); // inroom = new InstrRoom(); // it = new InstrTime(); } /** 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() { mainPanel = new javax.swing.JPanel(); Generate = new java.awt.Button(); jScrollPane2 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); menuBar = new javax.swing.JMenuBar(); javax.swing.JMenu fileMenu = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); Edit = new javax.swing.JMenu(); jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); View = new javax.swing.JMenu(); Course = new javax.swing.JMenuItem(); Time = new javax.swing.JMenuItem(); Room = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setName("Form"); // NOI18N mainPanel.setName("mainPanel"); // NOI18N org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(scheduletool.ScheduletoolApp.class).getContext().getResourceMap(InstrTime.class); Generate.setActionCommand(resourceMap.getString("Generate.actionCommand")); // NOI18N Generate.setLabel(resourceMap.getString("Generate.label")); // NOI18N Generate.setName("Generate"); // NOI18N Generate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { GenerateActionPerformed(evt); } }); jScrollPane2.setName("jScrollPane2"); // NOI18N jTable2.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {"7:00 - 8:00 AM", "N", "N", "N", "N", "N", "N", "N"}, {"8:00 - 9:00 AM", "N", "N", "N", "N", "N", "N", "N"}, {"9:00 - 10:00 AM", "N", "N", "N", "N", "N", "N", "N"}, {"10:00 - 11:00 AM", "N", "N", "N", "N", "N", "N", "N"}, {"11:00 - 12:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"12:00 - 1:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"1:00 - 2:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"2:00 - 3:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"3:00 - 4:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"4:00 - 5:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"5:00 - 6:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"6:00 - 7:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"7:00 - 8:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"8:00 - 9:00 PM", "N", "N", "N", "N", "N", "N", "N"}, {"9:00 - 10:00 PM", "N", "N", "N", "N", "N", "N", null} }, new String [] { "Times", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jTable2.setName("jTable2"); // NOI18N jScrollPane2.setViewportView(jTable2); javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel); mainPanel.setLayout(mainPanelLayout); mainPanelLayout.setHorizontalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addGap(783, 783, 783) .addComponent(Generate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(27, Short.MAX_VALUE)) .addGroup(mainPanelLayout.createSequentialGroup() .addContainerGap(20, Short.MAX_VALUE) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 896, javax.swing.GroupLayout.PREFERRED_SIZE)) ); mainPanelLayout.setVerticalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Generate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); menuBar.setName("menuBar"); // NOI18N fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N fileMenu.setName("fileMenu"); // NOI18N jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N jMenuItem1.setName("jMenuItem1"); // NOI18N fileMenu.add(jMenuItem1); javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(scheduletool.ScheduletoolApp.class).getContext().getActionMap(InstrTime.class, this); exitMenuItem.setAction(actionMap.get("quit")); // NOI18N exitMenuItem.setName("exitMenuItem"); // NOI18N fileMenu.add(exitMenuItem); menuBar.add(fileMenu); Edit.setText(resourceMap.getString("Edit.text")); // NOI18N Edit.setName("Edit"); // NOI18N jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.META_MASK)); jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N jMenuItem2.setName("jMenuItem2"); // NOI18N Edit.add(jMenuItem2); jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.META_MASK)); jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N jMenuItem3.setName("jMenuItem3"); // NOI18N Edit.add(jMenuItem3); menuBar.add(Edit); View.setText(resourceMap.getString("View.text")); // NOI18N View.setName("View"); // NOI18N Course.setText(resourceMap.getString("Course.text")); // NOI18N Course.setName("Course"); // NOI18N View.add(Course); Time.setText(resourceMap.getString("Time.text")); // NOI18N Time.setName("Time"); // NOI18N View.add(Time); Room.setText(resourceMap.getString("Room.text")); // NOI18N Room.setName("Room"); // NOI18N Room.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { RoomActionPerformed(evt); } }); View.add(Room); menuBar.add(View); helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setName("helpMenu"); // NOI18N aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N aboutMenuItem.setText(resourceMap.getString("aboutMenuItem.text")); // NOI18N aboutMenuItem.setName("aboutMenuItem"); // NOI18N helpMenu.add(aboutMenuItem); menuBar.add(helpMenu); setJMenuBar(menuBar); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 916, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(mainPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 340, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(mainPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 339, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 1, Short.MAX_VALUE))) ); pack(); }// //GEN-END:initComponents private void GenerateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GenerateActionPerformed // TODO add your handling code here: }//GEN-LAST:event_GenerateActionPerformed private void RoomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RoomActionPerformed // inroom.setVisible(true); //this.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_RoomActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new InstrTime().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuItem Course; private javax.swing.JMenu Edit; private java.awt.Button Generate; private javax.swing.JMenuItem Room; private javax.swing.JMenuItem Time; private javax.swing.JMenu View; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable jTable2; private javax.swing.JPanel mainPanel; private javax.swing.JMenuBar menuBar; // End of variables declaration//GEN-END:variables }