This document provides an overview of Java GUI programming using AWT and Swing. It discusses:
1. AWT and Swing - the two main sets of visual components for building Java GUIs. AWT relies on native platform components while Swing uses pure Java components.
2. Key concepts of AWT and Swing including lightweight vs heavyweight components, advantages and disadvantages of each, and common GUI component and container classes.
3. The Java GUI API class hierarchy including component classes, container classes, and helper classes for graphics, colors, fonts etc.
4. Event handling in Java GUI programs using the delegation model where components fire events and listener objects handle them. Common user actions, event
In this core java training session, you will learn Elements of Java programming. Topics covered in this session are:
• Quick review of some important concepts from last class
• History of Java
• JDK and JRE
• Byte Code and JVM (Java Virtual Machine)
• Platform Independence
• Principles of Object Oriented Programming
• Writing your first Java Application
• Elements of Java programming language
• Built in Data Types
• Conditional Statements
• Loops
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
In this session you will learn:
1. Principles of Object-Oriented Programming
2. Writing your first Java Application
3. Elements of Java programming language
4. Built in Data Types
5. Conditional Statements
6. Loops
In this core java training session, you will learn Elements of Java programming. Topics covered in this session are:
• Quick review of some important concepts from last class
• History of Java
• JDK and JRE
• Byte Code and JVM (Java Virtual Machine)
• Platform Independence
• Principles of Object Oriented Programming
• Writing your first Java Application
• Elements of Java programming language
• Built in Data Types
• Conditional Statements
• Loops
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
In this session you will learn:
1. Principles of Object-Oriented Programming
2. Writing your first Java Application
3. Elements of Java programming language
4. Built in Data Types
5. Conditional Statements
6. Loops
This program is designed for the use of LibraryManagement System and its functioning Main Objective of this project to facilitate the transactions through use of electronic medium. We use java netbeans 6.5.1 software and Mysql to programming our project.
Java programming, Java Swing Programming, SWING GUI Design, desktop application, Getting Started with Swing application development in java, Introduction to GUI based programming in java, Java to standard edition, J2SE, Core Java, Swing package in java
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Advanced Flow Concepts Every Developer Should KnowPeter Caitens
Tim Combridge from Sensible Giraffe and Salesforce Ben presents some important tips that all developers should know when dealing with Flows in Salesforce.
This program is designed for the use of LibraryManagement System and its functioning Main Objective of this project to facilitate the transactions through use of electronic medium. We use java netbeans 6.5.1 software and Mysql to programming our project.
Java programming, Java Swing Programming, SWING GUI Design, desktop application, Getting Started with Swing application development in java, Introduction to GUI based programming in java, Java to standard edition, J2SE, Core Java, Swing package in java
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Advanced Flow Concepts Every Developer Should KnowPeter Caitens
Tim Combridge from Sensible Giraffe and Salesforce Ben presents some important tips that all developers should know when dealing with Flows in Salesforce.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Modern design is crucial in today's digital environment, and this is especially true for SharePoint intranets. The design of these digital hubs is critical to user engagement and productivity enhancement. They are the cornerstone of internal collaboration and interaction within enterprises.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Your Digital Assistant.
Making complex approach simple. Straightforward process saves time. No more waiting to connect with people that matter to you. Safety first is not a cliché - Securely protect information in cloud storage to prevent any third party from accessing data.
Would you rather make your visitors feel burdened by making them wait? Or choose VizMan for a stress-free experience? VizMan is an automated visitor management system that works for any industries not limited to factories, societies, government institutes, and warehouses. A new age contactless way of logging information of visitors, employees, packages, and vehicles. VizMan is a digital logbook so it deters unnecessary use of paper or space since there is no requirement of bundles of registers that is left to collect dust in a corner of a room. Visitor’s essential details, helps in scheduling meetings for visitors and employees, and assists in supervising the attendance of the employees. With VizMan, visitors don’t need to wait for hours in long queues. VizMan handles visitors with the value they deserve because we know time is important to you.
Feasible Features
One Subscription, Four Modules – Admin, Employee, Receptionist, and Gatekeeper ensures confidentiality and prevents data from being manipulated
User Friendly – can be easily used on Android, iOS, and Web Interface
Multiple Accessibility – Log in through any device from any place at any time
One app for all industries – a Visitor Management System that works for any organisation.
Stress-free Sign-up
Visitor is registered and checked-in by the Receptionist
Host gets a notification, where they opt to Approve the meeting
Host notifies the Receptionist of the end of the meeting
Visitor is checked-out by the Receptionist
Host enters notes and remarks of the meeting
Customizable Components
Scheduling Meetings – Host can invite visitors for meetings and also approve, reject and reschedule meetings
Single/Bulk invites – Invitations can be sent individually to a visitor or collectively to many visitors
VIP Visitors – Additional security of data for VIP visitors to avoid misuse of information
Courier Management – Keeps a check on deliveries like commodities being delivered in and out of establishments
Alerts & Notifications – Get notified on SMS, email, and application
Parking Management – Manage availability of parking space
Individual log-in – Every user has their own log-in id
Visitor/Meeting Analytics – Evaluate notes and remarks of the meeting stored in the system
Visitor Management System is a secure and user friendly database manager that records, filters, tracks the visitors to your organization.
"Secure Your Premises with VizMan (VMS) – Get It Now"
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Why React Native as a Strategic Advantage for Startup Innovation.pdfayushiqss
Do you know that React Native is being increasingly adopted by startups as well as big companies in the mobile app development industry? Big names like Facebook, Instagram, and Pinterest have already integrated this robust open-source framework.
In fact, according to a report by Statista, the number of React Native developers has been steadily increasing over the years, reaching an estimated 1.9 million by the end of 2024. This means that the demand for this framework in the job market has been growing making it a valuable skill.
But what makes React Native so popular for mobile application development? It offers excellent cross-platform capabilities among other benefits. This way, with React Native, developers can write code once and run it on both iOS and Android devices thus saving time and resources leading to shorter development cycles hence faster time-to-market for your app.
Let’s take the example of a startup, which wanted to release their app on both iOS and Android at once. Through the use of React Native they managed to create an app and bring it into the market within a very short period. This helped them gain an advantage over their competitors because they had access to a large user base who were able to generate revenue quickly for them.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Chapter 1-Note.docx
1. 1
Chapter 1
Review of Java and Object Oriented Programming
1.1 Overview of Java programming
A Brief History of Java
Java is a high level language.
Java is an object-oriented language developed by Sun Microsystems.
Many of the concepts and syntax of Java are borrowed from C++.
Can be used to create two types of programs: applications and applets.
Robust: no pointers in java and no manual memory handling.
Secure.
The Sun development team soon realized that the Java language would be suitable for
writing programs to run on different computers connected to the Internet.
Java programs are portable.
Java promise: “Write once, run everywhere”.
Java differs from other programming languages in that it is both compiled and interpreted
language.
Java compilers produce the Java bytecode.
Java bytecodes are a set of instructions written for a hypothetical computer, known as the
Java virtual machine.
Bytecodes are platform-independent.
The JVM is an interpreter for bytecode.
An interpreter reads the byte code and translates into a sequence of commands that can be
directly executed by the computer.
Because the execution of every Java program is under the control of the JVM, the JVM can
contain the program and prevent it from generating side effects outside of the system.
2. 2
Object Oriented Programming
In the older styles of programming, a programmer who is faced with some problem must identify
a computing task that needs to be performed in order to solve the problem. Programming then
consists of finding a sequence of instructions that will accomplish that task. But at the heart
of object-oriented programming, instead of tasks we find objects– entities that have behaviors,
that hold information, and that can interact with one another. Programming consists of
designing a set of objects that model the problem at hand.
All computer programs consist of two elements: code and data.
In OO programming, a system or problem is decomposed into entities called objects.
OOP instead of focusing on what the system has to do, focus on:
o What objects the system contains
o How they interact
In OO, data is critical – data is not allowed to move freely around a system, but it is tied
closely to the functions that operate on it.
An object has data members and functions (methods in java).
Data is protected because the data belonging to an object can only be accessed and
modified by the methods of that object.
Different objects can 'talk' to each other through their methods. In this way, Object A
cannot directly modify data belonging to Object B – but it can call a method of Object
B that in turn modifies the data.
To summarize the OO approach:
o Emphasis on data, not procedure
o Programs are made up of objects
o Data is hidden from external functions
o Objects can communicate with each other through methods
The basic concepts of OO are:
o Objects and classes
o Data abstraction and encapsulation
3. 3
o Inheritance
o Polymorphism
o Dynamic (late) binding
o Message communication
These are explained below.
o Objects and Classes
o Object:
Represent ‘things/objects’ from the real world, or from some problem
domain (example: “the red car down there in the car park”)
A set of data items (fields) with operations (methods - that implement
class behaviors) to manipulate them
Has characteristic behavior.
Combines data and operations in one place
An object is also known as an instance. E.g Ibsa is an instance of a Student
o Class:
Defines a type of object (example: “car”)
Specifies methods and data that type of object has
Map of a building(class) vs. building (object)
Abstraction
Ignore details when appropriate
o Think about what a method/object/class does, not how it does it
o Treat it as a black box
Encapsulation
Is the mechanism that binds together code and the data it manipulates
Put related things in the same place
o I.e. group related data and operations in an object
o Each object has its own data and knows how to use it
Hide internal representation/implementation
4. 4
o Object = black box
o Deny external access to internal fields/methods
o Also called information hiding
Access an object through its interface:
o Set of externally accessible fields and methods
o Should not change even if internal implementation does
Goal of encapsulation: to transparently use different implementations of same object
An analogy:
o When you drive a car, you don’t have know the details of how many cylinders the
engine has or how the gasoline and air are mixed and ignited.
o Only have to know how to use the controls.
Inheritance
Inheritance is the process by which one object acquires the properties of another object.
Allows reuse of implementation
Classical Inheritance: “is-a” relationship
Example: fruits and types of fruit (an apple is a type of fruit)
Goal of inheritance: code reuse
Polymorphism
The ability to take more than one form
Different objects can respond differently to the same message
In terms of the OOP, this means that a particular operation may behave differently for
different sub-classes of the same class.
E.g Shape (circle, rectangle, etc) – draw or calculate area
5. 5
Chapter 2
AWT and Swing
Objective:
Within this chapter you will be introduced to many of the Java components for constructing
graphical user interfaces (GUIs). With the information in this chapter you will be able to
develop your own GUIs.
2.1Introduction
A graphical user interface (GUI) presents a user-friendly mechanism for interacting with an
application. A GUI gives an application a distinctive “look” and “feel.” There are two main sets
of visual components and containers for user interface design in JAVA:
`–AWT (Abstract Window Toolkit) and
–Swing
2.2Concepts of AWT and Swing
Before Swing was introduced in Java SE 1.2, Java GUIs were built with components from the
Abstract Window Toolkit in package java.awt. Package javax.swing contains swing components
that can be used to build Java GUIs. Most Swing components are pure Java components—they
are written, manipulated and displayed completely in Java.
2.2.1 An Overview of AWT
The AWT supports GUI Java programming. The AWT provides the connection between your
application and the native GUI. The AWT provides a high level of abstraction for your Java
program since it hides you from the underlying details of the GUI your program will be running
on. AWT is fine for developing simple graphical user interfaces, but not for developing
comprehensive GUI projects.
AWT features include:
A rich set of user interface components.
A robust event-handling model.
Graphics and imaging tools, including shape, color, and font classes.
6. 6
Layout managers, for flexible window layouts that don't depend on a particular window
size or screen resolution.
Data transfer classes, for cut-and-paste through the native platform clipboard.
The AWT components depend on native code counterparts (called peers) to handle their
functionality. Thus, these components are often called "heavyweight" components.
2.2.2 An Overview of Swing
Swing implements a set of GUI components that build on AWT technology and provide a
pluggable look and feel. Swing is implemented entirely in the Java programming language, and
is based on the JDK 1.1 Lightweight UI Framework.
Swing features include:
All the features of AWT.
100% Pure Java certified versions of the existing AWT component set (Button, Scrollbar,
Label, etc.).
A rich set of higher-level components (such as tree view, list box, and tabbed panes).
Pure Java design, no reliance on peers.
Pluggable Look and Feel.
Swing components depend less on the target platform and use less of the native GUI resource.
For this reason, Swing components that don’t rely on native GUI are referred to as lightweight
components, and AWT components are referred to as heavyweight components.
2.2.3 AWT vs. Swing
There are, of course, both pros and cons to using either set of components from the JFC in your
Java applications. Here is a summary:
AWT:
Pros
Speed: use of native peers speeds component performance.
7. 7
Applet Portability: most Web browsers support AWT classes so AWT applets can run
without the Java plugin.
Look and Feel: AWT components more closely reflect the look and feel of the OS they
run on.
Cons
Portability: use of native peers creates platform specific limitations. Some components
may not function at all on some platforms.
Features: AWT components do not support features like icons and tool-tips.
Swing:
Pros
Portability: Pure Java design provides for fewer platform specific limitations.
Behavior: Pure Java design allows for a greater range of behavior for Swing components
since they are not limited by the native peers that AWT uses.
Features: Swing supports a wider range of features like icons and pop-up tool-tips for
components.
Look and Feel: The pluggable look and feel lets you design a single set of GUI
components that can automatically have the look and feel of any OS platform (Microsoft
Windows, Solaris, Macintosh, etc.). It also makes it easier to make global changes to
your Java programs that provide greater accessibility (like picking a hi-contrast color
scheme or changing all the fonts in all dialogs, etc.).
Cons
Applet Portability: Most Web browsers do not include the Swing classes, so the Java
plugin must be used.
Performance: Swing components are generally slower than AWT. Since Swing
components handle their own painting (rather than using native API's like DirectX on
Windows) you may run into graphical glitches.
8. 8
Look and Feel: Even when Swing components are set to use the look and feel of the OS
they are run on, they may not look like their native counterparts.
2.2.4 Lightweight vs. Heavyweight GUI Components
Most Swing components are not tied to actual GUI components supported by the underlying
platform on which an application executes. Such GUI components are known as lightweight
components. AWT components (many of which parallel the Swing components) are tied to the
local platform and are called heavyweight components, because they rely on the local
platform’s windowing system to determine their functionality and their look-and-feel.
2.3The Java GUI API
The GUI API contains classes that can be classified into three groups: component classes,
container classes, and helper classes. Their hierarchical relationships are shown in Figure 1.
Fig 1: Java GUI programming utilizes the classes shown in this hierarchical diagram.
The component classes, such as JButton, JLabel, and JTextField, are for creating the user
interface. The container classes, such as JFrame, JPanel, and JApplet, are used to contain other
components. The helper classes, such as Graphics, Color, Font, FontMetrics, and Dimension,
are used to support GUI components.
9. 9
A. Component Classes
An instance of Component can be displayed on the screen. Component is the root class of all
the user-interface classes including container classes, and JComponent is the root class of all the
lightweight Swing components.
B. Container Classes
An instance of Container can hold instances of Component. Container classes are GUI
components that are used to contain other GUI components. Window, Panel, Applet, Frame,
and Dialog are the container classes for AWT components. To work with Swing components,
use Container, JFrame, JDialog, JApplet, and JPanel, as described in Table 1.1.
TABLE 1.1 GUI Container Classes
Container Class Description
java.awt.Container is used to group components. Frames, panels, and applets are its subclasses.
javax.swing.JFrame is a window not contained inside another window. It is used to hold other Swing user-interface
components in Java GUI applications.
javax.swing.JPanel is an invisible container that holds user-interface components. Panels can be nested. You can
place panels inside a container that includes a panel. JPanel is also often used as a canvas to
draw graphics.
javax.swing.JApplet is a subclass of Applet. You must extend JApplet to create a Swing-based Java applet.
javax.swing.JDialog is a popup window or message box generally used as a temporary window to receive additional
information from the user or to provide notification that an event has occurred.
C. GUI Helper Classes
The helper classes, such as Graphics, Color, Font, FontMetrics, Dimension, and
LayoutManager, are not subclasses of Component. They are used to describe the properties of
GUI components, such as graphics context, colors, fonts, and dimension, as described in Table
1.2.
TABLE 1.2 GUI Helper Classes
Helper Class Description
java.awt.Graphics is an abstract class that provides the methods for drawing strings, lines, and simple shapes.
java.awt.Color deals with the colors of GUI components. For example, you can specify background or
foreground colors in components like JFrame and JPanel, or you can specify colors of lines,
shapes, and strings in drawings.
java.awt.Font specifies fonts for the text and drawings on GUI components. For example, you can specify
10. 10
the font type (e.g., SansSerif), style (e.g., bold), and size (e.g., 24 points) for the text on a
button.
java.awt.FontMetrics is an abstract class used to get the properties of the fonts.
java.awt.Dimension encapsulates the width and height of a component (in integer precision) in a single object.
java.awt.LayoutManager specifies how components are arranged in a container.
2.4 Event Handling
Event and Event Sources
When you run a Java GUI program, the program interacts with the user, and the events drive its
execution. An event can be defined as a signal to the program that something has happened. The
code that performs a task in response to an event is called an event handler and the overall
process of responding to events is known as event handling. Events are triggered either by
external user actions, such as mouse movements, button clicks, and keystrokes, or by internal
program activities, such as a timer. The program can choose to respond to or ignore an event.
The component that creates an event and fires it is called the source object or source component.
For example, a button is the source object for a button-clicking action event. An event is an
instance of an event class. The root class of the event classes is java.util.EventObject.
Table 3 lists external user actions, source objects, and event types fired.
Table 3: User Action, Source Object, and Event Type
User Action Source Object Event Type Fired
Click a button JButton ActionEvent
Press return on a text field JTextField ActionEvent
Select a new item JComboBox ItemEvent, ActionEvent0
Select item(s) JList ListSelectionEvent
Click a check box JCheckBox ItemEvent, ActionEvent
Click a radio button JRadioButton ItemEvent, ActionEvent
Select a menu item JMenuItem ActionEvent
Move the scroll bar JScrollBar AdjustmentEvent
Move the scroll bar JSlider ChangeEvent
Window opened, closed, iconified,
deiconified, or closing
Window WindowEvent
Mouse pressed, released, clicked,
entered, or exited
Component MouseEvent
Mouse moved or dragged Component MouseEvent
Key released or pressed Component KeyEvent
Component added or removed from
the container
Container ContainerEvent
Component moved, resized,
hidden, or shown
Component ComponentEvent
Component gained or lost focus Component FocusEvent
11. 11
Listeners, Registrations, and Handling Events
Java uses a delegation-based model for event handling: a source object fires an event, and an
object interested in the event handles it. The latter object is called a listener.