package schmo; /** * This JFrame allows the user to edit information about an existing hotel * in the database. The user is allowed to edit all vital information about * the hotel including the hotel name, type, whether they are a Chamber Member, * address, city, state, zip, phone number, email address, website, and the * manager's name. * * @author Michelle Lee & Joey Pini */ public class EditHotelInfo extends javax.swing.JFrame { /** Creates new form EditHotelInfo */ public EditHotelInfo() { 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() { jLabel1 = new javax.swing.JLabel(); hotelNameField = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); addressField = new javax.swing.JTextField(); cityField = new javax.swing.JTextField(); stateField = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); zipField = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); typeComboBox = new javax.swing.JComboBox(); chamberMemberCheckBox = new javax.swing.JCheckBox(); phoneField = new javax.swing.JTextField(); emailField = new javax.swing.JTextField(); websiteField = new javax.swing.JTextField(); managerField = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); submitButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Edit Hotel Information"); setLocationByPlatform(true); jLabel1.setText("Hotel Name:"); jLabel2.setText("Type:"); jLabel3.setText("Address:"); jLabel4.setText("City:"); jLabel5.setText("State:"); jLabel6.setText("Zip:"); typeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "", "Hotel", "Motel", "Resort", "B & B", "Campground" })); chamberMemberCheckBox.setText("Chamber Member"); chamberMemberCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); chamberMemberCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); jLabel7.setText("Phone:"); jLabel8.setText("Email:"); jLabel9.setText("Website:"); jLabel10.setText("Manager:"); submitButton.setText("Submit"); submitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { submitButtonActionPerformed(evt); } }); cancelButton.setText("Cancel"); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel3) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel4) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel5) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel6) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel7) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel8) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel9) .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel10)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(managerField) .add(org.jdesktop.layout.GroupLayout.LEADING, hotelNameField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, addressField) .add(org.jdesktop.layout.GroupLayout.LEADING, cityField) .add(org.jdesktop.layout.GroupLayout.LEADING, stateField) .add(org.jdesktop.layout.GroupLayout.LEADING, zipField) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .add(typeComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(chamberMemberCheckBox)) .add(org.jdesktop.layout.GroupLayout.LEADING, phoneField) .add(org.jdesktop.layout.GroupLayout.LEADING, emailField) .add(org.jdesktop.layout.GroupLayout.LEADING, websiteField)) .addContainerGap()) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap(142, Short.MAX_VALUE) .add(submitButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelButton) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel1) .add(hotelNameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel2) .add(typeComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(chamberMemberCheckBox)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel3) .add(addressField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel4) .add(cityField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel5) .add(stateField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel6) .add(zipField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(phoneField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel7)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(emailField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel8)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(websiteField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel9)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel10) .add(managerField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelButton) .add(submitButton)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// //GEN-END:initComponents /** * Defines what happens when the "Submit" button is pressed. */ private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitButtonActionPerformed System.out.println("schmo.EditHotelInfo submit button pressed..."); }//GEN-LAST:event_submitButtonActionPerformed /** * Defines what happens when the "Cancel" button is pressed: this frame * is disposed. */ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed this.dispose(); }//GEN-LAST:event_cancelButtonActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new EditHotelInfo().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField addressField; private javax.swing.JButton cancelButton; private javax.swing.JCheckBox chamberMemberCheckBox; private javax.swing.JTextField cityField; private javax.swing.JTextField emailField; private javax.swing.JTextField hotelNameField; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JTextField managerField; private javax.swing.JTextField phoneField; private javax.swing.JTextField stateField; private javax.swing.JButton submitButton; private javax.swing.JComboBox typeComboBox; private javax.swing.JTextField websiteField; private javax.swing.JTextField zipField; // End of variables declaration//GEN-END:variables }