Question
3. Create a JFrame that holds five buttons with the names of five different fonts. Include a sixth button that the user can click to make a font larger or smaller. Display a demonstration JLabel using the font and size that the user selects. Save the file as JFontSelector.java

4. Create a JFrame that uses BorderLayout. Place a JButton in the center region. Each time the user clicks the JButton, change the background color in one of the other regions. Save the file as JColorFrame.java.

4. Write an application for Lambert's Vacation Rentals. Use separate ButtonGroups to allow a client to select one of three locations, the number of bedrooms, and whether meals are included in the rental. Assume that the locations are parkside for $600 per week, poolside for $750 per week, or lakeside for $825 per week. Assume that the rentals have one, two, or three bedrooms and that each bedroom over one adds $75 to the base price. Assume that if meals are added, the price is $200 more per rental. Save the file as JVacationRental.java

5.
a. Write an application that allows a user to select one of at least five television shows to watch on demand. When the user selects a show, display a brief synopsis. Save the file as JTVDownload.java

b. Change the JTVDownload application to include an editable combo box. Allow the user to type the name of a television show and display an appropriate error message if the desired show is not available. Save the file as JTVDownload2.java.
Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references.
Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.

/**
*
* @author
*/
public class JVacationRental extends JFrame implements ItemListener {

    // size of frame
    private final int SIZE = 180;
    // for location selection
    private static final String[] locationNames = {
       "Parkside", "Poolside", "Lakeside"
    };
    private JCheckBox[] locations;
    private static final int[] locationPrice = {
       600, 750, 825
    };

    // for house selection
    private static final String[] bedroomTypes = {
       "One bedrom", "Two bedrooms", "Three bedrooms"
    };
    private JCheckBox[] bedrooms;
    private static final int[] bedromNum = {
       1, 2, 3
    };
    private static final int roomPrice = 75;
    private static final int mealPrice = 200;

    // meals selection
    private JCheckBox meals;
    // ouput label
    private JLabel price;

    /**
    * constructor
    * @throws HeadlessException
    */
    public JVacationRental() throws HeadlessException {
       super("JVacationRental");
       setSize(SIZE * 2, SIZE);
      
       // we have 4 panel on the frame
       JPanel[] jps = new JPanel[4];
       for (int i = 0; i < jps.length; i++) {
            jps[i] = new JPanel(new FlowLayout(FlowLayout.LEADING));
       }
       setLayout(new GridLayout(jps.length, 1));

       // location panel
       locations = new JCheckBox[locationNames.length];

       ButtonGroup locationButtons = new ButtonGroup();
       for (int i = 0; i < locations.length; i++) {
            locations[i] = new JCheckBox(locationNames[i]);
            locations[i].addItemListener(this);
            locationButtons.add(locations[i]);
            jps[0].add(locations[i]);
       }
       add(jps[0]);

       // bedroom selection panel
       bedrooms = new JCheckBox[bedroomTypes.length];

       ButtonGroup bedroomButtons = new ButtonGroup();
       for (int i = 0; i < bedrooms.length; i++) {
            bedrooms[i] = new JCheckBox(bedroomTypes[i]);
            bedrooms[i].addItemListener(this);
            bedroomButtons.add(bedrooms[i]);
            jps[1].add(bedrooms[i]);
This is only a preview of the solution.
Please use the purchase button to see the entire solution.
By purchasing this solution you'll be able to access the following files:
Solution.zip
Purchase Solution
$60.00
Google Pay
Amazon
Paypal
Mastercard
Visacard
Discover
Amex
View Available Computer Science Tutors 645 tutors matched
Ionut
(ionut)
Master of Computer Science
Hi! MSc Applied Informatics & Computer Science Engineer. Practical experience in many CS & IT branches.Research work & homework
5/5 (6,808+ sessions)
1 hour avg response
$15-$50 hourly rate
Pranay
(math1983)
Doctor of Philosophy (PhD)
Ph.D. in mathematics and working as an Assistant Professor in University. I can provide help in mathematics, statistics and allied areas.
4.6/5 (6,701+ sessions)
1 hour avg response
$40-$50 hourly rate
Leo
(Leo)
Doctor of Philosophy (PhD)
Hi! I have been a professor in New York and taught in a math department and in an applied math department.
4.9/5 (6,469+ sessions)
2 hours avg response

Similar Homework Solutions