/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package...

this is a testing assignment from experts australia


/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package nq.realestate; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JTextArea; /** * * @author Hp */ public class BookingDetails implements ActionListener { JFrame f1; JLabel l1; Font ft, ft1; JButton b1, b2; JTextArea ta; BookingDetails() { f1 = new JFrame("NQ-Real Estate"); f1.setVisible(true); b1 = new JButton("Back"); b2 = new JButton("Exit"); ft = new Font("Courier New", Font.BOLD, 20); ft1 = new Font("Courier New", Font.BOLD, 15); l1 = new JLabel("**NQ-Real Estate Services** *****************************"); ta = new JTextArea(); ta.setFont(ft1); ServicesInfo sv = new ServicesInfo(); sv.f.setVisible(false); int numofrooms = sv.getNumRooms(); double gardenarea = sv.getAreaOfGarden(); int weeks = sv.getNumWeeks(); boolean isLuxury = sv.getIsLuxury(); double total = sv.BookingCalc(weeks, numofrooms, gardenarea, isLuxury); ta.setText("\n\n\t*******Booking Details*******\n\n\tPeriod : " + sv.getNumWeeks() + "\n\tNo of Rooms : " + sv.getNumRooms() + "\n\tArea of Garden: " + sv.getAreaOfGarden() + "\n\tTotal Charges : " + total); ta.setEditable(false); l1.setBounds(50, 15, 400, 50); l1.setFont(ft); ta.setBounds(30, 80, 400, 280); b1.setBounds(100, 370, 100, 30); b2.setBounds(210, 370, 100, 30); b1.addActionListener(this); b2.addActionListener(this); f1.setLayout(null); f1.setSize(500, 500); f1.setVisible(true); f1.setResizable(false); f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f1.add(l1); f1.add(b2); f1.add(b1); f1.add(ta); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == b1) { ServicesInfo s= new ServicesInfo(); s.f.setVisible(true); f1.setVisible(false); } //Exit button if (e.getSource() == b2) { int dialogResult = JOptionPane.showConfirmDialog(null, "Are you sure you want to exit?", "Warning", JOptionPane.YES_NO_OPTION); if (dialogResult == JOptionPane.YES_OPTION) { JOptionPane.showMessageDialog(f1, "Thank You for Using NQ-Services"); System.exit(0); } } } }
Sep 21, 2019
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here