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

  Design a java program that has two parallel arrays

Design a java program that has two parallel arrays: a string array named people that is initialized with the names of seven of your friends, and a string array named phoneNumbers that is initialized with your friends phone numbers.

  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.

  Write a program that reads a set of floating-point

Write a program that reads a set of floating-point data values from the input.

  Accepts a string as its parameter and returns an integer

Write a method in java named secondHalfLetters that accepts a string as its parameter and returns an integer representing how many of letters in the string come from the second half of the alphabet

  Creates an array named odds

Write code that creates an array named odds and stores all odd numbers between -6 and 38 into it using a loop. Make the array's size exactly large enough to store the numbers.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Write a program that prompts for and accepts input of test

write a program that prompts for and accepts input of test ggrades that are integers between 0 and 100. For each numerical test grade,  program should display a corresponding letter grade

  Java applet to find how much federal tax we need to pay

Write a java applet to determine how much federal tax we need to pay assuming the tax rate is 12%.  Ask the taxable income.

  Write java program to utilizes gui with five text fields

Write down the program called MaxMinAvgGUI.java which utilizes GUI with five(5)text fields which asks user to enter 5(five) decimal numbers. 1(one)number in each text field.

  The code must take into account

The code must take into account leap year and adding or subtracting between years. Write two additional methods that you come with on your own as well.

  Write a class that reads a file

In java, write a class that reads a file and outputs a list of the unique words in the file and the number of times each unique word occurs.Hint: use a HashMap with keys being the words and values being integer counts associated with the words.

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