Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
3rd Edition
ISBN: 9780134038179
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 12, Problem 1MC

With Swing, you use this class to create a frame.

  1. a. Frame
  2. b. SwingFrame
  3. c. JFrame
  4. d. JavaFrame
Expert Solution & Answer
Check Mark
Program Description Answer

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

Hence, correct answer is option “C”.

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 using 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 “JFrame” class to insert components in the window.

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!
Students have asked these similar questions
Using comments within the code itself, can you provide an line by line explanation of the below JavaScript file? The file itself deals with WebGl if that helps you. Please and thank you JavaScript file: "use strict";   var canvas; var gl;   var positions = []; var colors = [];   var numTimesToSubdivide = 3;   window.onload = function init() { canvas = document.getElementById("gl-canvas");   gl = canvas.getContext('webgl2'); if (!gl) alert("WebGL 2.0 isn't available");   // // Initialize our data for the Sierpinski Gasket //   // First, initialize the vertices of our 3D gasket // Four vertices on unit circle // Intial tetrahedron with equal length sides   var vertices = [ vec3(0.0000, 0.0000, -1.0000), vec3(0.0000, 0.9428, 0.3333), vec3(-0.8165, -0.4714, 0.3333), vec3(0.8165, -0.4714, 0.3333) ];   divideTetra(vertices[0], vertices[1], vertices[2], vertices[3], numTimesToSubdivide);   // // Configure WebGL // gl.viewport(0, 0, canvas.width, canvas.height); gl.clearColor(1.0, 1.0, 1.0,…
Does this display two images? And if so in which folder shall I add the gif files?   package javafxapplication3; import javafx.application.Application;import javafx.scene.Scene;import javafx.scene.image.Image;import javafx.scene.image.ImageView;import javafx.scene.layout.GridPane;import javafx.stage.Stage; public class JavaFXApplication3 extends Application {@Overridepublic void start(Stage primaryStage)throws Exception {GridPane gridPane = new GridPane();int flagCount = 0;for (int i = 0; i<2; i++) {for (int j = 0; j<2; j++) { gridPane.add(new ImageView(new Image("image/flag"+flagCount+".gif")), i, j);flagCount++;}}Scene scene = new Scene(gridPane, 1000, 500);primaryStage.setTitle("Flags");primaryStage.setScene(scene);primaryStage.show();}public static void main(String[]args) {Application.launch(args);}}
Which objects are added to others, from left to right, as in:  A is added (→) to B which is added (→) to C, etc.?    Button → Stage → Scene → Pane   Button → Scene → Stage → Pane    Button → Scene → Pane → Stage   Button → Pane → Scene → Stage

Chapter 12 Solutions

Starting Out with Java: From Control Structures through Data Structures (3rd Edition)

Ch. 12.3 - Prob. 12.11CPCh. 12.3 - Which layout manager arranges components in a row,...Ch. 12.3 - Prob. 12.13CPCh. 12.3 - Prob. 12.14CPCh. 12.3 - Prob. 12.15CPCh. 12.3 - Prob. 12.16CPCh. 12.3 - Prob. 12.17CPCh. 12.4 - Prob. 12.18CPCh. 12.4 - Prob. 12.19CPCh. 12.4 - Prob. 12.20CPCh. 12.4 - Prob. 12.21CPCh. 12.4 - Prob. 12.22CPCh. 12.4 - Prob. 12.23CPCh. 12.4 - Prob. 12.24CPCh. 12.4 - Prob. 12.25CPCh. 12.5 - Prob. 12.26CPCh. 12.5 - Prob. 12.27CPCh. 12 - With Swing, you use this class to create a frame....Ch. 12 - Prob. 2MCCh. 12 - Prob. 3MCCh. 12 - Prob. 4MCCh. 12 - Prob. 5MCCh. 12 - Prob. 6MCCh. 12 - Prob. 7MCCh. 12 - Prob. 8MCCh. 12 - Prob. 9MCCh. 12 - Prob. 10MCCh. 12 - Prob. 11MCCh. 12 - Prob. 12TFCh. 12 - Prob. 13TFCh. 12 - Prob. 14TFCh. 12 - Prob. 15TFCh. 12 - Prob. 16TFCh. 12 - Prob. 17TFCh. 12 - Prob. 18TFCh. 12 - Prob. 19TFCh. 12 - Prob. 20TFCh. 12 - The following statement is in a class that uses...Ch. 12 - Prob. 2FTECh. 12 - Prob. 3FTECh. 12 - Prob. 4FTECh. 12 - Prob. 5FTECh. 12 - Prob. 1AWCh. 12 - Prob. 2AWCh. 12 - The variable myWindow references a JFrame object....Ch. 12 - Prob. 4AWCh. 12 - Prob. 5AWCh. 12 - Prob. 6AWCh. 12 - Prob. 7AWCh. 12 - Prob. 8AWCh. 12 - Prob. 9AWCh. 12 - Prob. 1SACh. 12 - Prob. 2SACh. 12 - Prob. 3SACh. 12 - Prob. 4SACh. 12 - Retail Price Calculator Create a GUI application...Ch. 12 - Prob. 2PCCh. 12 - Prob. 3PCCh. 12 - Travel Expenses Create a GUI application that...Ch. 12 - Prob. 5PCCh. 12 - Joes Automotive Joes Automotive performs the...Ch. 12 - Prob. 8PC
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
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
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY