package schmo; /** * This JDialog is for the user to confirm that the hotel that the tourist * has selected has been called to confirm the booking. The user is prompted * with the hotel's contact information and can click "Hotel Has Confirmed" or * the "Cancel" button depending on if the hotel still has the room available. * * @author Michelle Lee & Joey Pini */ public class ConfirmDialogBox extends javax.swing.JDialog { /** Creates new form ConfirmDialogBox */ public ConfirmDialogBox(java.awt.Frame parent, boolean modal) { super(parent, modal); 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(); hotelNameLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); startDateLabel = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); endDateLabel = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); priceLabel = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); hotelNameLabel2 = new javax.swing.JLabel(); hotelNumberLabel = new javax.swing.JLabel(); hotelHasConfirmedButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Confirm Reservation With Hotel"); setLocationByPlatform(true); jLabel1.setText("The tourist has decided to stay at "); hotelNameLabel1.setText("Seacliff Inn Best Western"); jLabel3.setText("from"); startDateLabel.setText("June 15, 2007"); jLabel5.setText("until"); endDateLabel.setText("June 16, 2007"); jLabel7.setText("at a price of"); priceLabel.setText("$130 / night."); jLabel9.setText(""); jLabel10.setText("

Please call the hotel to confirm the reservation:"); hotelNameLabel2.setText("Seacliff Inn Best Western"); hotelNumberLabel.setText("(831)688-7300"); hotelHasConfirmedButton.setText("Hotel Has Confirmed"); hotelHasConfirmedButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { hotelHasConfirmedButtonActionPerformed(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() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(layout.createSequentialGroup() .add(jLabel9) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(hotelNameLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(hotelNumberLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .add(layout.createSequentialGroup() .add(hotelHasConfirmedButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cancelButton)))) .add(layout.createSequentialGroup() .addContainerGap() .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE)) .add(layout.createSequentialGroup() .add(39, 39, 39) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(jLabel1) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(hotelNameLabel1)) .add(layout.createSequentialGroup() .add(46, 46, 46) .add(jLabel3) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(10, 10, 10) .add(jLabel7) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(priceLabel)) .add(layout.createSequentialGroup() .add(startDateLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jLabel5) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(endDateLabel))))))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(20, 20, 20) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel1) .add(hotelNameLabel1)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(startDateLabel) .add(jLabel5) .add(endDateLabel)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel7) .add(priceLabel)) .add(21, 21, 21) .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(jLabel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 39, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(15, 15, 15) .add(hotelNameLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(hotelNumberLabel)) .add(jLabel9)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cancelButton) .add(hotelHasConfirmedButton)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// //GEN-END:initComponents /** * Defines what happens when the "Canel" button is pressed: this dialog * box is hidden. */ private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed this.setVisible(false); }//GEN-LAST:event_cancelButtonActionPerformed /** * Defines what happens when the "Hotel Has Confirmed" button is pressed. * A new instance of the Confirm frame is created and set as visible, and * this dialog is hidden. */ private void hotelHasConfirmedButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hotelHasConfirmedButtonActionPerformed Confirm confirm = new Confirm(); confirm.setVisible(true); this.setVisible(false); }//GEN-LAST:event_hotelHasConfirmedButtonActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ConfirmDialogBox(new javax.swing.JFrame(), true).setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton cancelButton; private javax.swing.JLabel endDateLabel; private javax.swing.JButton hotelHasConfirmedButton; private javax.swing.JLabel hotelNameLabel1; private javax.swing.JLabel hotelNameLabel2; private javax.swing.JLabel hotelNumberLabel; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel9; private javax.swing.JSeparator jSeparator1; private javax.swing.JLabel priceLabel; private javax.swing.JLabel startDateLabel; // End of variables declaration//GEN-END:variables }