Alicia creates a button using the code jbutton exit button

Assignment Help JAVA Programming
Reference no: EM13167058

Alicia creates a button using the code JButton exitButton = new JButton("exit"); and places it into a JFrame named mainFrame

using mainFrame.add(exitButton); When Alicia runs her code, she verifies that the button can be clicked as evidenced by it changing appearance when she attempts to click on it. However, clicking on the button does not cause the

program to exit.

 

A. Explain why JButton has built-in functionality to change appearance when exitButton is clicked.

 

B. Explain why JButton does not have built-in functionality to cause the program to exit when exitButton is clicked

 

Alicia decides to add functionality to her program so that it exits when exitButton is clicked.

is clicked.

 

C. Explain the type of class Alicia should define to add this functionality.

 

D Explain the method(s) that the class needs in order to provide this functionality.

 

E. Explain how many objects of that class will need to be created to provide this functionality.

 

F. Explain how that object/those objects will be connected to Alicia's previous code to provide

this functionality

 

Phil takes the code written by Alicia in Question 1 and decides to add a window that pops up after exitButton is pressed but before the program exits in order to confirm that the user really wishes to exit the program.

A. Alicia tells Phil to be sure that the new window is modal.
Explain what 'modal' means in this context and why it is appropriate to make this window modal.

B. Explain an appropriate component for Phil to use for this window.

C. Explain how Phil will need to modify Alicia's code to incorporate this new window and its new
functionality.

 

 

Reference no: EM13167058

Questions Cloud

Statement to display the sku, sku_description : write an sql statement to display the SKU, SKU_Description, WareHouse ID, and QuantityOnHand for all products having a QuantityOnOrder equal to 0. Sort the results in descending order by WareHouse ID and in ascending order by SKU
Explain where the following method invocations : Explain where the following method invocations are most likely to be found in a program for dealing with census data organized using the Model, View, Controller (MVC) design pattern. Choices are zero or more of Model, View, and Controller. Be sure to..
Point class having x and y coordinates : Write a program that includes a Point class having x and y coordinates as data member. Also implement an overloaded constructor for the Point class.
Write a class encapsulating a pc-based game : Write a class encapsulating a PC-based game, which inherits from Game. A PC-bases game has the following additional attributes: the minimum megabytes of RAM needed to play the fame, the number of megabytes needed on the hard drive to install the fame..
Alicia creates a button using the code jbutton exit button : Alicia creates a button using the code JButton exitButton = new JButton("exit"); and places it into a JFrame named mainFrame
A parking garage charges a $2.00 minimum : A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $0.50 per hour for each hour or part thereof over three hours.
For the prototype user interface : For the prototype user interface, design a switchboard that leads from main sections to sub-sections of related system tasks. The main sections may include member information, registration, payments
During data and process modeling : During data and process modeling, Susan Park developed a logical model of the proposed system. She drew an entity-relationship diagram and constructed a set of leveled and balaced DFD
Savingsaccount and bankaccount objects : The only differences between SavingsAccount and BankAccount objects is that SavingsAccount have an interest rate and can compute interest when necessary. Add an instance variable and a method to SavingsAccount to allow for these items.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Program that counts the number of occurrences of lowercase

Write a program that counts the number of occurrences of lowercase and uppercase vowels in entered lines of text. Use a two-dimensional array to store the vowel counts. The array's first column holds the counts for the lowercase vowels, and the secon..

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Write a class to represent a credit card.

write a class to represent a credit card.

  Difference between the two following statements

What exactly is the difference between the two following statements and which is preferred, please provide details: 1) frame.setSize(400, 300); // Set JFrame Size

  Public float usefulload()

public float usefulLoad() // this is the grossWeight - emptyWeight public float usefulLoadWithFuel( in gallons ) // this is the useful load - gallons x 6. The programmer user will pass in the number of gallons on board.

  Uml exercise

UML Exercise: Automated Teller Machine (ATM),   1. To allow authorized card holders to make transactions,   Brief Summary of Requirements:

  Shows the users name and program name

Java program, the program has a page that shows the users name and program name. a second jpanel that shows 4 buttons (circle square rectangle and oval) the problem i am having is that my program is not dropping where i click and the shapes are not s..

  Write java program which will permit user to input data

Write the Java Program which will permit the user to input data. The data will be validated using a loop that requires the user to input the data until it is correct or in the correct range. T

  Elements from a html document

Function test Count List Elements should simply retrieve an array of all list elements on the page and assert that their total count is 3.

  Java application to declare and create a vector

Write a java application that perform the following task: declare and create a vector with initial size of 10, increment of 2

  Solving programming problems

Write a computer program that will figure out the total of an order when given the amount of the order ($1000) and a sales tax rate of eight percent.

  Instance methods

instance methods: setWidth(double w), setHeight(double h), double getWidth(), double getHeight() and double getArea() * A triangle's area is calculated by width*height*0.5  * all variables are private and methods public.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd