Reference no: EM13950854
Enhance the ButtonViewer program so that it prints the time at which the button was clicked.
Use the following class as your main class:
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
/**
This program demonstrates how to install an action listener.
*/
public class ButtonViewer
{
private static final int FRAME_WIDTH = 100;
private static final int FRAME_HEIGHT = 60;
public static void main(String[] args)
{
JFrame frame = new JFrame();
JButton button = new JButton("Click me!");
frame.add(button);
ActionListener listener = new ClickListener();
button.addActionListener(listener);
frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
You need to supply the following class in your solution:
ClickListener
Do not modify the following:
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
/**
This program demonstrates how to install an action listener.
*/
public class ButtonViewer
{
private static final int FRAME_WIDTH = 100;
private static final int FRAME_HEIGHT = 60;
public static void main(String[] args)
{
JFrame frame = new JFrame();
JButton button = new JButton("Click me!");
frame.add(button);
ActionListener listener = new ClickListener();
button.addActionListener(listener);
frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
Does the square magnitude of this complex number depend on x
: For Quantum Mechanics, suppose a complex number is such that its real component is cos(x) for any value of x, and its imaginary component is sin(x). Does the square magnitude of this complex number depend on x? Explain why.
|
Problem regarding the physician referral directory
: Recently, the physician marketing task force at state university medical center developed a physician referral directory. And advertisement, the garget was primary care physicians in the region who could refer patients to state university for tert..
|
Pay today for a share of fancy threads common stock
: The owner of Fancy Threads, a national high-end women’s boutique is considering opening a boutique on Grand River Avenue. The company has experienced phenomenal sales growth, and you are considering buying some of their stock. how much would you pay ..
|
Paid by their employer to carry out a job
: A major strategy for helping others grow and develop is to be a nurturing, positive person. Discuss how a nurturing person promotes the growth of others.
|
Enhance the buttonviewer program
: Enhance the ButtonViewer program so that it prints the time at which the button was clicked.
|
Greatest threats to a computerized accounting system
: From the e-Activity, examine the greatest threats to a computerized accounting system. Suggest two (2) preventive measures or remedies to protect the system and / or mitigate negative impact to the system. Provide a rationale for your response.
|
What is the impact on earnings before interest and taxes
: What is the impact on earnings before interest and taxes (EBIT) of the 50% increase/decrease in sales? Explain using the concept of leverage.
|
Compare and contrast the two selected organizations
: Using your current work organization (or an organization of interest) and a second organization in the same industry as the subject matter, research the elements of business, compare and contrast the two selected organizations, and prepare an APA ..
|
Offered temporary job and will be having cash inflow
: You have been offered a temporary job and will be having a cash inflow of $300 in two months from now, $400 in 4 months, and $1,000 in 6 months. Whenever you receive the payments, you plan to deposit in MSUFCU savings account, paying 12% of annual in..
|