
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Based on the given program and the sample output, please provide the missing code.
![import javax.swing.*;
import java.awt. *;
import java.awt.event. *;
public class FinalGUI {
JButton startButton, stopButton;
JLabel label;
public
(1)
{
JFrame f= new JFrame ("SwingApp2");
f.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); //1.3+
createGUI (f);
initListeners ();
(2)
f.setVisible ( (3)____);
}
void initListeners () {
ActionListener action1 = new MyActionListener();
startButton.addActionListener
stopButton.addActionListener(
(action1);
(4) );
}
(5)
{
class MyActionListener implements
public void action Performed (ActionEvent e) {
if (e.getSource () == startButton) {
startButton.setEnabled( (6)
stopButton.setEnabled( (7) );
label.setText ("Press Stop.");
} else {
stopButton.setEnabled( (8) );
(9) ;
label.setText ("Press Start.");
startButton = new JButton ("Start");
stopButton = new JButton ("Stop");
stopButton.setEnabled(false);
(10)
Container c = f.getContentPane ();
c.add(startButton, BorderLayout.WEST);
c.add(stopButton, BorderLayout. EAST);
c.add(label, BorderLayout.SOUTH);
}
public static void main(String[] args) {
new FinalGUI ();
}
}
SAMPLE OUTPUT:
FinalGUI
Start
Stop
void createGUI (JFrame f) {
= new JLabel("Press Start.", JLabel.CENTER);
Click Start.
●●● FinalGUI
Start
Stop
Click Stop.](https://content.bartleby.com/qna-images/question/45fe4c57-b0e6-4485-95b7-0010badb1350/faf20955-1383-4806-aeaf-5132938add9c/1scgx7v_thumbnail.png)
Transcribed Image Text:import javax.swing.*;
import java.awt. *;
import java.awt.event. *;
public class FinalGUI {
JButton startButton, stopButton;
JLabel label;
public
(1)
{
JFrame f= new JFrame ("SwingApp2");
f.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); //1.3+
createGUI (f);
initListeners ();
(2)
f.setVisible ( (3)____);
}
void initListeners () {
ActionListener action1 = new MyActionListener();
startButton.addActionListener
stopButton.addActionListener(
(action1);
(4) );
}
(5)
{
class MyActionListener implements
public void action Performed (ActionEvent e) {
if (e.getSource () == startButton) {
startButton.setEnabled( (6)
stopButton.setEnabled( (7) );
label.setText ("Press Stop.");
} else {
stopButton.setEnabled( (8) );
(9) ;
label.setText ("Press Start.");
startButton = new JButton ("Start");
stopButton = new JButton ("Stop");
stopButton.setEnabled(false);
(10)
Container c = f.getContentPane ();
c.add(startButton, BorderLayout.WEST);
c.add(stopButton, BorderLayout. EAST);
c.add(label, BorderLayout.SOUTH);
}
public static void main(String[] args) {
new FinalGUI ();
}
}
SAMPLE OUTPUT:
FinalGUI
Start
Stop
void createGUI (JFrame f) {
= new JLabel("Press Start.", JLabel.CENTER);
Click Start.
●●● FinalGUI
Start
Stop
Click Stop.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 3 images

Knowledge Booster
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
- I do have the file called (number_list.txt) which is the numbers from 50 to 100 I will attach a screenshot with the question so I just need the python program codearrow_forward(a) Find the Hamming distance between the codewords that correspond to datawords 0111 and 1100. (b) Suppose the Hamming distance you found in part (a) is the minimum Hamming distance between all pairs in the codebook. What does this tell us about the number of errors this code can detect?arrow_forwardOutput the information in a formatted table. The title is right justified with a width of 33. Column 1 has a width of 20. Column 2 has a width of 23. Ex: Number of Novels Authored Author name | Number of novels -------------------------------------------- Jane Austen | 6 Charles Dickens | 20 Ernest Hemingway | 9 Jack Kerouac | 22 F. Scott Fitzgerald | 8 Mary Shelley | 7 Charlotte Bronte | 5 Mark Twain | 11 Agatha Christie | 73 Ian Flemming | 14 J.K. Rowling | 14 Stephen King | 54 Oscar Wilde | 1arrow_forward
- Click cell C9 and insert a VLOOKUP function that looks up the code in cell B9, compares it to the codes and types of art in the range B2:C6, and returns the type of art. Copy the function in cell C9 to the range C9:C54. Hide column B that contains the codes.arrow_forwardI want to read the numbers from random_number.txt and then display the number and display total of the number and the number of random number read from the file and the average of this numberarrow_forwardAnswer in R code pleasearrow_forward
- how do I enter the years row? The language is pythonarrow_forwardi want copy of this codearrow_forwardn this assignment, we will learn a few fundamentals of Data Science. You will read some data values and display some basic statistics of the data set. Your program should: Prompt the user to enter an integer number. Validate the user input to make sure it is an integer. If not, ask the user to enter a valid integer only. You may use the str.isdigit(dataValue) function to check whether the user is entering only digits where dataValue is the user input, and the expression returns True if the entered characters were numbers. Add your integer into a list. Ask the user whether they want to add more data. When the user finishes entering data values, display the count, minimum, maximum, range, and average of your data set. To get the range of the data values, you should subtract the minimum value from its maximum. You can calculate count and average using the appropriate built-in functions.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education