Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
6th Edition
ISBN: 9780133957051
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 12, Problem 1MC
Program Description Answer

To create a frame with the use of “Swing”, the programmer should use the “JFrame” class for the application.

Hence, the answer is option “C”.

Expert Solution & Answer
Check Mark

Explanation of Solution

“JFrame” class:

The basic window of the swing application is known as frame. To create a frame, the programmer should create an object for the “JFrame” class in a Swing application.  The package of “import javax.swing.JFrame*” should import in the program before use the “JFrame” class.

Syntax:

JFrame object_name=new JFrame();

Here,

  • “JFrame” is the class name.
  • “object_name” is the object name of the frame.

The programmer can use the object name of the “JFrame” to insert components in the window.

Explanation for incorrect options:

“Frame” class:

The “Frame” class is a class from “AWT” package. The programmer can create a window using the “Frame” class by importing the “import java.awt.*” package not in Swing package.

Hence, the option “A” is not correct.

SwingFrame:

The term “SwingFrame” is not a predefined class in java. This class is not available in both Swing and AWT packages.

Hence, the option “B” is not correct.

JavaFrame:

The term “JavaFrame” refers a frame in an application. But the class name “JavaFrame” is not a predefined class in java. This class is not available in both Swing and AWT packages.

Hence, the option “D” is not correct.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!

Chapter 12 Solutions

Starting Out with Java: From Control Structures through Objects (6th Edition)

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.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education