EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
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
1. Design a Java Swing Frame where you enter two strings into two separate text boxes and on a button click the strings are concatenated and displayed in a third text box. 2. Use a button to invoke the process. 3. Put this in a panel. 4. Create another panel where you have a dropdown. Concatenate the choice from the drop- down with the previous string and display in another text field in the second panel. Use a button to invoke this process.
Create a JavaFX application with at least six labels that contain facts about your favorite topic—for example, the French Revolution or astronomy. Every time the user clicks a Button, remove one of the Labels and add a different one.
Create JavaFX application that displays similar picture. You can use your own color palette. You do not have to match sizes exactly.

Chapter 15 Solutions

EBK 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
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,
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY