Explain eventhandling concepts in java

Assignment Help JAVA Programming
Reference no: EM13940572

Enhance the ButtonViewer program so that it prints the time at which the button was clicked.
Please provide the ClickListener class in your solution.

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);
}
}

Reference no: EM13940572

Questions Cloud

Determine the changes in the prime rate that have occurred : Review a current issue of the Federal Reserve Bulletin, or review of copy from the Fed's Web site (www.federalreserve.gov) or the St. Louis Fed's Web site (www.stlouisfed.org). And Determine the changes in the prime rate that have occurred since the ..
Prepare a scattergraph using all twelve months of data : Prepare a scattergraph using all 12 months of data. What step might Tracy, using her judgment, take to amend the results from the method of least squares?
Develop a powerpoint presentation on the bernie madoff : Assume you are an instructor presenting an unethical case study to your graduate students. Develop a PowerPoint presentation on the Bernie Madoff. Be certain to address the following key components for your student audience:
Prepare a cost formula for the receiving activity : Using the high-low method, prepare a cost formula for the receiving activity. Using this formula, what is the predicted cost of receiving for a month in which 1,450 receiving orders are processed?
Explain eventhandling concepts in java : Enhance the ButtonViewer program so that it prints the time at which the button was clicked.Please provide the ClickListener class in your solution.
Provide a background of the firm industry economy : Provide a background of the firm, industry, economy, and outlook for the future Analyze the short term liquidity of the firm Analyze the operating efficiency of the firm Analyze the capital structure of the firm Analyze the profitability of the firm ..
Write a test application named simpledatetest : Write a test application named SimpleDateTest that demonstrates class SimpleDate's capabilities
Explaining the concepts of efficiency and effectiveness : What political consequences might result from an unfavorable opinion of your department? Describe how the Sheriff's department would measure efficiency and effectiveness.
Strategic management process at sector : 1. Provide a critical insight into the strategic management process at sector/business level 2. Clearly identify and appraise the strategic environment and factors which should be considered when evaluating the global diamond market.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implement a simple number guessing game using html forms

Your assignment is to implement a simple number guessing game using HTML forms and a Java servlet. The HTML page should introduce the game and provide a form for the user to guess a number on. The servlet should use an HTTP session object to store..

  Create a package called people

Create a second package called ‘task01'. Within this package provide classes which perform the following tasks.

  Digit decimal seconds counter using two 7-segment displays

Write a program that implements a two digit decimal seconds counter using two 7-segment displays.  Make this program using java programming. Make this program in simple way.

  Write a computer program that prompts the user for a number

Write a computer program that prompts the user for a number, creates an array for that number of random integers, and then uses the sophisticated form of bubble sort to order the array

  Write a general package for reading in arithmetic expression

Write a general package for reading in arithmetic expressions and simplifying them. Write a program for a simple calculating language with two forms of statement.

  Create a form that contains a guessing game

Create a Form that contains a guessing game with five RadioButtons numbered 1 through 5.  Randomly choose one of the RadioButtons as the winning button.  When the user clicks a RadioButton, display a message indicating whether the user is correct.

  Dijikstra for undirected graph using simple scheme

Dijikstra for undirected graph using simple scheme with array and fibonacci heap and compare the performance/results, preferably in java.

  Determine java application on web and structure functions

Determine the Java application on Web and explain how program structure functions. Explain the application in as much detail as possible.

  Wordlist generator in java

Wordlist generator in java Object oriented my instructor requested for a project using: inheritance, Polymorphism, arraysList, array of object, String class methods

  Squashes the difference in fruit weight-distribution

Assume that in squashes the difference in fruit weight between a 3-lb type and a 6-lb type results from three independently segregating allelic pairs, A/a, B/b, and C/c. Each capital-letter allele contributes a half pound to the weight of the squash...

  Build the gui layout of the game

Build the Build the GUI layout of the game in java.

  Create a class that implements movieloader

Fill in the empty Frame class that has been provided. Each object of this type will store data consisting of a single frame from an input le.

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