Java Programming
Java Programming
8th Edition
ISBN: 9781305981829
Author: Joyce Farrell
Publisher: Cengage Limited
bartleby

Concept explainers

bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 15, Problem 1PE

Explanation of Solution

Program:

File name: “JMovieFrame.java

//Import necessary header files

import java.awt.BorderLayout;

import java.awt.Container;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JFrame;

/*Define a class named JMovieFrame that extends JFrame

and implements ActionListener */

public class JMovieFrame extends JFrame implements ActionListener

{

    /*Create five JButton objects for north, south, east,

    west and center */

    private JButton northBtn=new JButton("North by NorthWest");

    private JButton southBtn=new JButton("Song of South");

    private JButton eastBtn=new JButton("East of Eden");

private JButton westBtn=new JButton("Once upon a time in west");

    private JButton centerBtn=new JButton("World Trade Center");

    private Container container=getContentPane();

    //Define a Constructor of the class JMovieFrame

    public JMovieFrame()

    {

        //Set the title

        setTitle("JMovieFrame");

        //Set the BorderLayout

        container.setLayout(new BorderLayout());

        //Add north button

        container.add(northBtn, BorderLayout.NORTH);

        //Add south button

        container.add(southBtn, BorderLayout.SOUTH);

        //Add west button

        container.add(westBtn, BorderLayout.WEST);

        //Add east button

        container.add(eastBtn, BorderLayout.EAST);

        //Add center button

        container.add(centerBtn, BorderLayout.CENTER);

        //Set width and height

        setSize(450, 250);

        //Add ActionListener

        northBtn.addActionListener(this);

        southBtn.addActionListener(this);

        westBtn.addActionListener(this);

        eastBtn...

Blurred answer
Students have asked these similar questions
After our initial deployment for our ML home based security system, the first steps we took to contribute further to the project, we conducted load testing, tested and optimize for low latency, and automated user onboarding. What should be next?
Why investing in skills and technology is a critical factor in the financial management aspect of system projects.
why investing in skills and technology is a critical factor in the financial management aspect of systems projects.

Chapter 15 Solutions

Java Programming

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
CMPTR
Computer Science
ISBN:9781337681872
Author:PINARD
Publisher:Cengage
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY