This document discusses event handling in Java. It describes the delegation event model where a source generates an event and sends it to one or more listeners. It outlines several common listener interfaces like ActionListener, ItemListener, KeyListener, MouseListener, and WindowListener. For each interface it provides the listener methods and describes how to write an event handler class to implement the interface. It also discusses the classes for different event types like ActionEvent, ItemEvent, KeyEvent, and MouseEvent.
The document discusses Java I/O streams and input/output. It introduces streams as an ordered sequence of data linked to a physical device. Streams can represent different sources and destinations like files, devices, networks. Input streams read data from a source while output streams write data to a destination. Byte streams handle bytes and character streams handle characters. Important stream classes include InputStream, OutputStream, Reader, and Writer. The System class defines predefined input, output, and error streams. Reading input involves wrapping System.in in a BufferedReader while writing uses PrintStream.
This document discusses Java applets and provides examples. It defines an applet as a Java program that can be run in a web browser. Applets must extend the Applet class and override certain methods like init(), start(), stop(), and destroy() that are called at different stages of the applet lifecycle. There are two main types of applets - ones based on the AWT and ones based on Swing. The document also discusses graphics drawing in applets using the Graphics class and setting colors and fonts. It provides examples of a scrolling banner applet and using the status window.
This document discusses the basics of GUI programming in Java using the AWT API. It explains that AWT provides classes for building graphical user interfaces and that there are three types of GUI classes: container classes, component classes, and helper classes. Container classes hold other components, component classes make up the visual elements, and helper classes provide properties like colors and fonts. Important container classes include Frame and Panel, while common components are buttons, labels, text fields, and checkboxes. The document provides details on constructing and using many of these classes.
This document provides an overview of Java Beans. It defines Java Beans as reusable software components that extend the power of Java by enabling objects to be manipulated visually at design time. The key points covered include: Java Beans specifications which define requirements like having public no-arg constructors and implementing Serializable; getter and setter methods for accessing bean properties; event models for handling bean events; and steps for creating a basic Java Bean component and packaging it in a JAR file.
This document discusses Remote Method Invocation (RMI) in Java. RMI allows a method to be invoked on an object residing in a different Java Virtual Machine (JVM). It works through stubs and skeletons - stubs act as proxies for remote objects on the client side, while skeletons handle incoming calls on the server side. Developing RMI applications involves creating a remote interface, implementing it in a remote class that extends UnicastRemoteObject, compiling the class to generate stubs and skeletons, starting the RMI registry, and having the client access remote objects by lookup or direct construction.
This document provides an overview of generics in Java. It discusses the benefits of generics, including type safety and compile-time error detection. It also covers generic classes and interfaces, generic methods, wildcard types, and restrictions on generics. Examples are provided to illustrate key concepts like generic classes with multiple type parameters, bounded types, and the implementation of generics using type erasure.
The document discusses key concepts in Java including classes, objects, methods, and command line arguments. A class defines common properties and behaviors for objects through fields and methods. Objects are instantiated from classes and can access fields and methods using dot notation. Command line arguments allow passing data into a Java application and are accessed through the args parameter in the main method.
Packages in Java provide a namespace that organizes related classes and interfaces. A package declaration specifies the package that a class belongs to. Packages prevent naming collisions and allow access modifiers like public, protected and private to control visibility. Common packages in Java include java.lang for core language classes, java.util for collections, and java.io for file input/output. The import statement is used to use classes from another package.
The document discusses Java I/O streams and input/output. It introduces streams as an ordered sequence of data linked to a physical device. Streams can represent different sources and destinations like files, devices, networks. Input streams read data from a source while output streams write data to a destination. Byte streams handle bytes and character streams handle characters. Important stream classes include InputStream, OutputStream, Reader, and Writer. The System class defines predefined input, output, and error streams. Reading input involves wrapping System.in in a BufferedReader while writing uses PrintStream.
This document discusses Java applets and provides examples. It defines an applet as a Java program that can be run in a web browser. Applets must extend the Applet class and override certain methods like init(), start(), stop(), and destroy() that are called at different stages of the applet lifecycle. There are two main types of applets - ones based on the AWT and ones based on Swing. The document also discusses graphics drawing in applets using the Graphics class and setting colors and fonts. It provides examples of a scrolling banner applet and using the status window.
This document discusses the basics of GUI programming in Java using the AWT API. It explains that AWT provides classes for building graphical user interfaces and that there are three types of GUI classes: container classes, component classes, and helper classes. Container classes hold other components, component classes make up the visual elements, and helper classes provide properties like colors and fonts. Important container classes include Frame and Panel, while common components are buttons, labels, text fields, and checkboxes. The document provides details on constructing and using many of these classes.
This document provides an overview of Java Beans. It defines Java Beans as reusable software components that extend the power of Java by enabling objects to be manipulated visually at design time. The key points covered include: Java Beans specifications which define requirements like having public no-arg constructors and implementing Serializable; getter and setter methods for accessing bean properties; event models for handling bean events; and steps for creating a basic Java Bean component and packaging it in a JAR file.
This document discusses Remote Method Invocation (RMI) in Java. RMI allows a method to be invoked on an object residing in a different Java Virtual Machine (JVM). It works through stubs and skeletons - stubs act as proxies for remote objects on the client side, while skeletons handle incoming calls on the server side. Developing RMI applications involves creating a remote interface, implementing it in a remote class that extends UnicastRemoteObject, compiling the class to generate stubs and skeletons, starting the RMI registry, and having the client access remote objects by lookup or direct construction.
This document provides an overview of generics in Java. It discusses the benefits of generics, including type safety and compile-time error detection. It also covers generic classes and interfaces, generic methods, wildcard types, and restrictions on generics. Examples are provided to illustrate key concepts like generic classes with multiple type parameters, bounded types, and the implementation of generics using type erasure.
The document discusses key concepts in Java including classes, objects, methods, and command line arguments. A class defines common properties and behaviors for objects through fields and methods. Objects are instantiated from classes and can access fields and methods using dot notation. Command line arguments allow passing data into a Java application and are accessed through the args parameter in the main method.
Packages in Java provide a namespace that organizes related classes and interfaces. A package declaration specifies the package that a class belongs to. Packages prevent naming collisions and allow access modifiers like public, protected and private to control visibility. Common packages in Java include java.lang for core language classes, java.util for collections, and java.io for file input/output. The import statement is used to use classes from another package.
The document provides an introduction to object-oriented programming concepts in Java. It discusses classes and objects, defining a class, creating objects, using methods, naming conventions, primitive data types like boolean, char, integers and floats, and type casting. It also covers topics like abstraction, encapsulation, inheritance and polymorphism using examples.
This document summarizes a lecture on object-oriented programming and virtual functions in C++. It discusses:
1) The difference between static and dynamic binding, and how virtual functions allow for dynamic/late binding by performing function binding at runtime based on the object's type.
2) An example showing that without virtual functions, calling a function through a base class pointer results in the base class function being called rather than the derived class function.
3) How declaring a function as virtual in the base class allows the correct overridden function to be called in the derived class when called through a base class pointer, enabling polymorphism.
Programming Fundamentals With OOPs Concepts (Java Examples Based)indiangarg
This presentation gives you various types of programming models, A clear concept of object oriented languages, Classes and Object Concept, Different types of programming paradigms, program tokens, statements, expressions, Concepts of Inheritance, Encapsulation, Abstraction, Polymorphism, Interface etc.
This document discusses Java wrapper classes. It explains that wrapper classes allow primitive types to be used as objects. Each primitive type has a corresponding wrapper class (e.g. Integer for int). Wrapper classes provide methods to convert between primitive types and their object equivalents. They allow primitives to be used in contexts that require objects, like collections, and provide additional functionality like constants and parsing/formatting methods.
This presentation provides the information on python including the topics Python features, applications, variables and operators in python, control statements, numbers, strings, print formatting, list and list comprehension, dictionaries, tuples, files, sets, boolean, mehtods and functions, lambda expressions and a sample project using Python.
Java is an object-oriented programming language. Key aspects of Java include:
- It is platform independent and runs on a virtual machine.
- Programs are written in classes with methods. The main method is where execution begins.
- Common operations include accepting user input, printing output, and performing math functions.
- Java supports concepts like inheritance, polymorphism, abstraction and encapsulation.
- The language does not support pointers, structures or multiple inheritance.
Java defines data as objects with methods that support the objects. It provides features like abstraction, encapsulation, inheritance and polymorphism. Java programs can be executed on any platform that supports a Java Virtual Machine as Java code is compiled to bytecode, which is platform independent. To execute a Java program, the source code must be compiled to bytecode using the javac compiler, which checks for errors. The bytecode can then be executed using the java command.
Python Programming - VI. Classes and ObjectsRanel Padon
This document discusses classes and objects in Python programming. It covers key concepts like class attributes, instantiating classes to create objects, using constructors and destructors, composition where objects have other objects as attributes, and referencing objects. The document uses examples like a Time class to demonstrate class syntax and how to define attributes and behaviors for classes.
The document provides an introduction to object-oriented programming concepts and Java. It discusses key OOP concepts like objects, classes, encapsulation, inheritance, and polymorphism. It also explains the basics of Java, including its history, features like being platform independent and secure, and the structure of a Java program with main components like packages, import statements, and class definitions.
OCP Java (OCPJP) 8 Exam Quick Reference CardHari kiran G
If you are preparing to appear for Oracle Certified Professional Java SE 8 Programmer (OCPJP 8) certification exam, this a reference card (sort of long cheat sheet) meant to help you. You may want to print this reference card for your easy and quick reference when you prepare for your exam.
C++ Object oriented concepts & programmingnirajmandaliya
This document discusses various C++ concepts related to functions and operators. It defines what a default pointer is and how it receives addresses passed to a called function. It also discusses reference variables, inline functions, friend functions, default arguments, passing objects as parameters, function overloading, static members, function pointers, and operator overloading. It provides examples and explanations for each concept.
Java is a programming language invented by James Gosling and others in 1994.
originally named Oak ,was developed as a part of the Green project at the Sun Company.
Java 7 is latest stable release
The document provides information about Java interview questions for freshers, including questions about why Java is platform independent, why Java is not 100% object-oriented, different types of constructors in Java, why pointers are not used in Java, the difference between arrays and array lists, what maps and classloaders are in Java, access modifiers, defining a Java class, creating objects, runtime and compile time polymorphism, abstraction, interfaces, inheritance, method overloading and overriding, multiple inheritance, encapsulation, servlet lifecycles, session management in servlets, JDBC drivers and JDBC API components.
This document discusses an object oriented programming lecture on C++ structures. It defines a structure as a collection of variables grouped together under a single name. Structures allow defining custom data types that aggregate data of different types. The document provides an example structure for an employee that contains members for id, age, name, and salary. It demonstrates declaring a structure variable and accessing members using dot notation. The example program outputs the member values of an employee structure to demonstrate its use.
This document provides an overview of an Object Oriented Programming course taught by Rajasekaran S. The course covers 5 units: introduction to OOP and Java fundamentals, inheritance and interfaces, exception handling and I/O, multithreading and generic programming, and event driven programming. It defines key OOP concepts like objects, classes, abstraction, encapsulation, inheritance, and polymorphism using examples like cars. The document also lists the prerequisites for the course as a computer with Java installed, internet access, a text editor or IDE like Eclipse, and a reference book.
This document discusses the syllabus for the course IT1301 - Object Oriented Programming. It covers key concepts in OOP like classes, objects, inheritance, polymorphism, abstraction and encapsulation. It also discusses features of Java like being platform independent, secure, robust etc. The document contains examples and questions related to OOP concepts in Java. Constructors and their types, access specifiers, object class and reflection are explained in detail with examples. Creation and accessing of user-defined packages in Java is also discussed.
The document discusses event handling in Java. It describes how events are generated from user interactions with GUI components and handled via the delegation event model. This model involves events, event sources that generate events, and event listeners that receive and process events. The document lists some important event classes like ActionEvent and MouseEvent, and listener interfaces. It also provides details on how to register listeners with sources and implement event handling in classes.
The document discusses Java event handling and various listener interfaces. It describes the delegation event model where an event source generates an event and sends it to registered listeners. It outlines common listener interfaces like ActionListener, ItemListener, KeyListener, MouseListener, and WindowListener. It provides details on the methods in each interface and how to write classes that implement the listener interfaces.
Java Programming :Event Handling(Types of Events)simmis5
Event Handling is the mechanism that controls the event and decides what should happen if an event occurs. This mechanism have the code which is known as event handler that is executed when an event occurs. Java Uses the Delegation Event Model to handle the events.
The document provides an introduction to object-oriented programming concepts in Java. It discusses classes and objects, defining a class, creating objects, using methods, naming conventions, primitive data types like boolean, char, integers and floats, and type casting. It also covers topics like abstraction, encapsulation, inheritance and polymorphism using examples.
This document summarizes a lecture on object-oriented programming and virtual functions in C++. It discusses:
1) The difference between static and dynamic binding, and how virtual functions allow for dynamic/late binding by performing function binding at runtime based on the object's type.
2) An example showing that without virtual functions, calling a function through a base class pointer results in the base class function being called rather than the derived class function.
3) How declaring a function as virtual in the base class allows the correct overridden function to be called in the derived class when called through a base class pointer, enabling polymorphism.
Programming Fundamentals With OOPs Concepts (Java Examples Based)indiangarg
This presentation gives you various types of programming models, A clear concept of object oriented languages, Classes and Object Concept, Different types of programming paradigms, program tokens, statements, expressions, Concepts of Inheritance, Encapsulation, Abstraction, Polymorphism, Interface etc.
This document discusses Java wrapper classes. It explains that wrapper classes allow primitive types to be used as objects. Each primitive type has a corresponding wrapper class (e.g. Integer for int). Wrapper classes provide methods to convert between primitive types and their object equivalents. They allow primitives to be used in contexts that require objects, like collections, and provide additional functionality like constants and parsing/formatting methods.
This presentation provides the information on python including the topics Python features, applications, variables and operators in python, control statements, numbers, strings, print formatting, list and list comprehension, dictionaries, tuples, files, sets, boolean, mehtods and functions, lambda expressions and a sample project using Python.
Java is an object-oriented programming language. Key aspects of Java include:
- It is platform independent and runs on a virtual machine.
- Programs are written in classes with methods. The main method is where execution begins.
- Common operations include accepting user input, printing output, and performing math functions.
- Java supports concepts like inheritance, polymorphism, abstraction and encapsulation.
- The language does not support pointers, structures or multiple inheritance.
Java defines data as objects with methods that support the objects. It provides features like abstraction, encapsulation, inheritance and polymorphism. Java programs can be executed on any platform that supports a Java Virtual Machine as Java code is compiled to bytecode, which is platform independent. To execute a Java program, the source code must be compiled to bytecode using the javac compiler, which checks for errors. The bytecode can then be executed using the java command.
Python Programming - VI. Classes and ObjectsRanel Padon
This document discusses classes and objects in Python programming. It covers key concepts like class attributes, instantiating classes to create objects, using constructors and destructors, composition where objects have other objects as attributes, and referencing objects. The document uses examples like a Time class to demonstrate class syntax and how to define attributes and behaviors for classes.
The document provides an introduction to object-oriented programming concepts and Java. It discusses key OOP concepts like objects, classes, encapsulation, inheritance, and polymorphism. It also explains the basics of Java, including its history, features like being platform independent and secure, and the structure of a Java program with main components like packages, import statements, and class definitions.
OCP Java (OCPJP) 8 Exam Quick Reference CardHari kiran G
If you are preparing to appear for Oracle Certified Professional Java SE 8 Programmer (OCPJP 8) certification exam, this a reference card (sort of long cheat sheet) meant to help you. You may want to print this reference card for your easy and quick reference when you prepare for your exam.
C++ Object oriented concepts & programmingnirajmandaliya
This document discusses various C++ concepts related to functions and operators. It defines what a default pointer is and how it receives addresses passed to a called function. It also discusses reference variables, inline functions, friend functions, default arguments, passing objects as parameters, function overloading, static members, function pointers, and operator overloading. It provides examples and explanations for each concept.
Java is a programming language invented by James Gosling and others in 1994.
originally named Oak ,was developed as a part of the Green project at the Sun Company.
Java 7 is latest stable release
The document provides information about Java interview questions for freshers, including questions about why Java is platform independent, why Java is not 100% object-oriented, different types of constructors in Java, why pointers are not used in Java, the difference between arrays and array lists, what maps and classloaders are in Java, access modifiers, defining a Java class, creating objects, runtime and compile time polymorphism, abstraction, interfaces, inheritance, method overloading and overriding, multiple inheritance, encapsulation, servlet lifecycles, session management in servlets, JDBC drivers and JDBC API components.
This document discusses an object oriented programming lecture on C++ structures. It defines a structure as a collection of variables grouped together under a single name. Structures allow defining custom data types that aggregate data of different types. The document provides an example structure for an employee that contains members for id, age, name, and salary. It demonstrates declaring a structure variable and accessing members using dot notation. The example program outputs the member values of an employee structure to demonstrate its use.
This document provides an overview of an Object Oriented Programming course taught by Rajasekaran S. The course covers 5 units: introduction to OOP and Java fundamentals, inheritance and interfaces, exception handling and I/O, multithreading and generic programming, and event driven programming. It defines key OOP concepts like objects, classes, abstraction, encapsulation, inheritance, and polymorphism using examples like cars. The document also lists the prerequisites for the course as a computer with Java installed, internet access, a text editor or IDE like Eclipse, and a reference book.
This document discusses the syllabus for the course IT1301 - Object Oriented Programming. It covers key concepts in OOP like classes, objects, inheritance, polymorphism, abstraction and encapsulation. It also discusses features of Java like being platform independent, secure, robust etc. The document contains examples and questions related to OOP concepts in Java. Constructors and their types, access specifiers, object class and reflection are explained in detail with examples. Creation and accessing of user-defined packages in Java is also discussed.
The document discusses event handling in Java. It describes how events are generated from user interactions with GUI components and handled via the delegation event model. This model involves events, event sources that generate events, and event listeners that receive and process events. The document lists some important event classes like ActionEvent and MouseEvent, and listener interfaces. It also provides details on how to register listeners with sources and implement event handling in classes.
The document discusses Java event handling and various listener interfaces. It describes the delegation event model where an event source generates an event and sends it to registered listeners. It outlines common listener interfaces like ActionListener, ItemListener, KeyListener, MouseListener, and WindowListener. It provides details on the methods in each interface and how to write classes that implement the listener interfaces.
Java Programming :Event Handling(Types of Events)simmis5
Event Handling is the mechanism that controls the event and decides what should happen if an event occurs. This mechanism have the code which is known as event handler that is executed when an event occurs. Java Uses the Delegation Event Model to handle the events.
The document discusses object oriented programming concepts like events, event sources, event classes, event listeners, and the delegation event model. It describes how events like mouse clicks and keyboard presses are handled in Java. It provides details on common event classes like MouseEvent and KeyEvent. It also discusses components of the AWT class hierarchy like labels, buttons, text fields, and scrollbars, and how to handle user interface events with them.
The document discusses event handling in Java. It defines key terms like events, event sources, and event listeners. Events describe changes in state of objects, like user interactions. Event sources generate events, while event listeners receive notifications of events. The delegation event model is described where sources generate events that are sent to registered listeners. Important event classes like ActionEvent and listener interfaces are listed. The steps to handle events, which include implementing listener interfaces and registering components with listeners, are outlined.
The document discusses Java event handling and the delegation event model. It describes key concepts like events, sources that generate events, and listeners that handle events. It provides examples of registering components as listeners and implementing listener interfaces. The delegation event model joins sources, listeners, and events by notifying listeners when sources generate events.
This document discusses event handling in Java GUI programming. It defines an event as user interaction with a GUI component. Events have sources that trigger them and listeners that process them via event handlers. Common event listener interfaces include ActionListener, ComponentListener, and FocusListener. The event handling process involves determining the event source and type, creating an event object, and invoking the appropriate listener method. Examples are given of sources that can trigger events and assignments are provided to practice event handling.
This document provides an overview of event handling in Java. It discusses key concepts like events, event sources, event listeners, and different types of events like action events, item events, key events, mouse events, and window events. For each event type, it describes the relevant listener interface and event class, including their common methods. It explains how events are generated by sources and handled by registered listener objects using the delegation event model in Java.
1. An event describes a change in state of an object and is generated from user interaction with GUI components like buttons, mouse movement, keyboard entry etc.
2. There are two types of events - foreground events from direct user interaction and background events from system processes.
3. Event handling is the mechanism that controls how programs respond to events using event handlers (listener objects) that contain code to execute when an event occurs. The delegation event model defines how events are generated and handled in Java.
This document discusses event handling in Java. It describes the delegation event model, which defines standard mechanisms for generating and processing events. An event is an object that describes a state change in an event source, like a button click. Event sources generate events and send them to registered event listeners. Listeners implement interfaces that define methods for processing specific event types. Common event classes and interfaces are also outlined.
The document discusses Java AWT event handling and graphics. It covers key concepts like events, event classes, event handling process, commonly used event listeners and adapter classes. It also covers AWT containers, layout managers, menu classes, graphics classes and how to work with frames and graphics in Java. The document is intended to teach programming in Java and is part of a larger unit on AWT.
The document discusses activities, intents, and event listeners in Android. It defines an activity as a single focused thing the user can interact with and explains the activity lifecycle including methods like onCreate, onStart, onResume, etc. It describes intents as messages that allow communication between app components and how they are used to start activities. It also defines event listeners as a way to handle user interactions and collect data on events like button presses. It provides examples of registering different types of event listeners including anonymous inner classes and having the activity implement listener interfaces.
This document provides an overview of event handling in Java. It discusses the delegation event model where a source generates an event and sends it to one or more listeners. It describes event sources, event listeners, common event classes like ActionEvent, MouseEvent, and KeyEvent. It explains the roles of sources that generate events, listeners that receive event notifications, and event classes that represent specific types of events.
An event-driven program relies on events to trigger responses rather than actively polling for user input. Older programs used polling which involved continuously checking for user actions in a loop, wasting CPU resources. Event-driven programs address this by using listeners that wait passively for events from sources like user interactions. When an event occurs, the appropriate listener receives and handles the event without wasting resources on empty polling loops.
The document discusses event handling and layouts in Java. It describes what events are, the delegation event model used in Java for handling events, and common event and listener classes. It also provides examples of using buttons and event handling in both AWT and Swing. The section about layouts states that layout managers automatically position and size components within containers.
This document discusses event handling in Java. It defines events as changes in the state of an object and categorizes them as foreground or background events. It explains that event handling uses a delegation model with sources that generate events and listeners that handle them. It provides an example of handling action events from buttons by implementing an ActionListener interface and attaching it to the buttons. The example displays text indicating which button was clicked.
Event handling in Java uses the delegation event model. There are two main types of events - foreground events which require direct user interaction, and background events which do not. The delegation model defines key participants in event handling - the source which generates the event, and the listener which processes the event. Common event classes in Java include ActionEvent, WindowEvent, AdjustmentEvent, and KeyEvent. Listener interfaces define callback methods for the different event types.
Common Programming Errors by Beginners in JavaRavi_Kant_Sahu
This document discusses 10 common errors that beginners encounter when programming in Java.
1) The "javac is not recognized" error occurs when the Java environment variables are not set correctly.
2) When compiling, the file name must have a ".java" extension.
3) When executing, only the class name should be passed without the ".java" extension, and the class must contain a main method.
4) The "file not found" error occurs when the file is not in the current working directory or the file name is incorrect.
The document discusses various Java collection classes - ArrayList, LinkedList, Vector, and Stack. It provides details about their constructors, methods, and differences. The key points are:
- ArrayList and LinkedList store elements in arrays and linked lists respectively, affecting their performance for insertion/deletion.
- Vector is similar to ArrayList but contains synchronized methods for thread-safety.
- Stack extends Vector and defines methods for LIFO (Last In First Out) operations like push, pop.
This document provides an overview of Java collections and common collection interfaces like List, Set, Map, Queue, and their implementations. It discusses the core collection interfaces like Collection, List, Set, Map, Queue, and their methods. Specific implementations of these interfaces are covered like ArrayList, LinkedList, HashSet, TreeSet, HashMap, TreeMap, PriorityQueue. The document is presented by Ravi Kant Sahu, Assistant Professor at Lovely Professional University in Punjab, India and provides details on using collections in Java.
StringBuffer implements a mutable sequence of characters that can be modified unlike strings. It has methods to modify the character sequence such as append, insert, delete and replace. It can grow dynamically as characters are added and its methods are used by the compiler to implement string concatenation with the + operator.
This document discusses string handling in Java. It explains that strings are immutable objects of type String. It describes the four main string classes in Java - String, StringBuffer, StringBuilder, and StringTokenizer. The document outlines various string methods like length(), charAt(), compareTo(), indexOf(), and replace() among others. It also discusses how to create, modify, search and compare strings in Java.
Packages in Java provide a namespace that organizes related classes and interfaces. A package declaration specifies the package that a class belongs to. Packages prevent naming collisions and allow access modifiers like public, protected and private to control visibility. Common packages in Java include java.lang for core language features and java.util for collections. The import statement is used to use classes from another package.
The document discusses arrays in Java. Some key points:
- Arrays allow storing multiple values of the same type together and accessing using an index.
- One-dimensional arrays store elements in a list. Two-dimensional arrays represent tables/matrices.
- Arrays are initialized with a size, then individual elements can be assigned and accessed using indexes.
- Methods demonstrate declaring, initializing, and manipulating values in one and two-dimensional arrays. Arrays can also be passed as arguments or returned from methods.
This document discusses keywords in Java including this, super, and final. It explains that this refers to the current object instance and is used to call methods or access fields of the current class. Super is used to call methods or access fields of the parent class. Final is used to declare variables that cannot be reassigned, prevent method overriding, and prevent class inheritance. The document also covers static keywords and how static methods can be called on a class without creating an instance.
This document discusses methods, constructors, and interfaces in Java programming. It defines methods as constructs that group statements together to perform a function. Methods can return values or be void. Constructors are special methods used to initialize objects, and must have the same name as the class. Interfaces contain abstract method signatures that classes implement, allowing for multiple inheritance. The document provides examples of defining methods, constructors, abstract classes, and implementing interfaces in Java code.
This document discusses keywords in Java including this, super, and final. It explains that this refers to the current object instance and is used to call methods or access fields of the current class. Super is used to call methods or access fields of the parent class. Final is used to declare variables that cannot be reassigned, prevent method overriding, and prevent class inheritance. The document also covers static keywords and how static methods can be called on a class without creating an instance.
The document discusses inheritance in Java programming. It defines inheritance as an is-a relationship between a superclass and subclasses, where subclasses inherit and extend the functionality of the superclass. The document covers key inheritance concepts like method overriding, where subclasses can define their own implementation of a method from the superclass, and method overloading, where classes can define multiple methods with the same name but different parameters. It also discusses dynamic method dispatch, where Java determines which version of an overridden method to call based on the object type at runtime.
The document outlines Java Database Connectivity (JDBC) and its key concepts. JDBC provides a standard interface for connecting Java applications to various databases. It defines APIs for establishing a connection to a database, issuing queries and updates, and processing result sets. The document discusses the JDBC architecture, driver types, and interfaces like Connection, Statement, PreparedStatement, CallableStatement, and ResultSet.
The document discusses objects and classes in Java. It defines a class as a template for creating objects with common properties and behaviors. A class contains fields to store data and methods to perform actions on that data. The document uses the Circle class as an example, defining fields like radius and center coordinates, and methods like circumference() and area(). It explains how to define classes, create objects from classes using the new keyword, access object fields and methods, and use nested classes, inner classes, local classes and anonymous classes in Java.
This document summarizes a lecture on operators and expressions in Java. It discusses the four main categories of operators: arithmetic, bitwise, relational, and logical. It provides examples of common operators like addition, subtraction, logical AND, OR, and describes operator precedence. Key concepts covered include arithmetic assignment operators, increment/decrement operators, bitwise operators, relational operators for comparison, short-circuit logical operators, and the ternary conditional operator.
The document discusses control structures in Java, including selection statements like if-else and switch statements, and iteration statements like for, while, do-while loops. It provides examples and explanations of how each statement works. Key points covered include how if-else statements evaluate conditions and execute the appropriate block, how switch statements can be used as a replacement for long if-else-if chains, and how the different loop constructs like for, while, do-while iterate until a condition is met. It also discusses concepts like break, continue and return which change the flow of control.
This document provides an introduction to GUI programming using Swing in Java. It discusses the key differences between AWT and Swing, including that Swing components are lightweight and platform independent. The document covers Swing concepts like the model-view-controller architecture, event dispatch thread, common Swing components like JPanel and JScrollPane, and layout managers. It also discusses setting colors, fonts, and default operations in a JFrame. The goal of the document is to introduce developers to essential Swing concepts for GUI programming in Java.
This document provides an introduction and overview of the Java programming language presented by Ravi Kant Sahu. It defines Java as an object-oriented language based on C++ that is designed for easy web and internet applications. The key characteristics of Java discussed include being simple, object-oriented, distributed, interpreted, robust, secure, architecture-neutral, portable, high-performance, multithreaded, and dynamic. The principles of object-oriented programming such as encapsulation, inheritance, and polymorphism are also explained.
This document provides an overview of Java basics including keywords, data types, variables, and constants. It discusses object-oriented programming concepts like objects, classes, encapsulation, inheritance, and polymorphism. It also describes the primitive data types in Java like integer, floating-point, character, and boolean types. Finally, it covers identifiers, keywords, constants, and variables in Java.
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
3. Introduction
• An event can be defined as a signal to the program that something has
happened.
• 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.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
4. Introduction
• An event is an instance of an event class.
• The root class of the event classes is java.util.EventObject.
•
We can identify the source object of an event using the getSource()
method in the EventObject class.
• The subclasses of EventObject deal with special types of events, such
as action events, window events, component events, mouse events,
and key events.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
6. The Delegation Event Model
• The delegation event model defines standard and consistent
mechanisms to generate and process events.
Principle:
• A source generates an event and sends it to one or more listeners.
• The listener waits until it receives an event.
• Once an event is received, the listener processes the event and then
returns.
Advantage:
• The application logic that processes events is cleanly separated
from the user interface logic that generates those events.
• A user interface element is able to “delegate” the processing of an
event to a separate piece of code.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
7. • In the delegation event model, listeners must register with a source
in order to receive an event notification.
• This provides an important benefit: notifications are sent only to
listeners that want to receive them.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
8. Event
• An event is an object that describes a state change in a source.
• It can be generated as a consequence of a person interacting with
the elements in a graphical user interface.
• For Example, pressing a button, entering a character via the
keyboard, selecting an item in a list, and clicking the mouse.
• Events may also occur that are not directly caused by interactions
with a user interface.
• For example, an event may be generated when a timer expires, a
counter exceeds a value, a software or hardware failure occurs, or
an operation is completed.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
9. Event Source
• An Event source is an object that generates an event.
• This occurs when the internal state of that object changes in some
way.
• Sources may generate more than one type of event.
• A source must register listeners in order for the listeners to receive
notifications about a specific type of event.
• Each type of event has its own registration method.
public void addTypeListener(TypeListener el)
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
10. • When an event occurs, all registered listeners are notified and
receive a copy of the event object. This is known as multicasting
the event.
• In all cases, notifications are sent only to listeners that register to
receive them.
• Some sources may allow only one listener to register.
public void addTypeListener(TypeListener el) throws
java.util.TooManyListenersException
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
11. Event Listener
• A listener is an object that is notified when an event occurs. It has two
major requirements.
• First, it must have been registered with one or more sources to receive
notifications about specific types of events.
• Second, it must implement methods to receive and process these
notifications.
• The methods that receive and process events are defined in a set of
interfaces found in java.awt.event.
• For example, the MouseMotionListener interface defines two methods
to receive notifications when the mouse is dragged or moved.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
13. Listener API Table
Listener Interface
Listener Methods
ActionListener
actionPerformed(ActionEvent)
ItemListener
itemStateChanged(ItemEvent)
MouseListener
mouseClicked(MouseEvent)
mouseEntered(MouseEvent)
mouseExited(MouseEvent)
mousePressed(MouseEvent)
mouseReleased(MouseEvent)
MouseMotionListener
KeyListener
mouseDragged(MouseEvent)
mouseMoved(MouseEvent)
keyPressed(KeyEvent)
keyReleased(KeyEvent)
keyTyped(KeyEvent)
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
14. ActionListener
• Action listeners are most common event handlers to implement.
• An action event occurs, whenever an action is performed by the user.
• We implement an action listener to define what should be done when
an user performs certain operation.
Examples: When the user clicks a button, chooses a menu item,
presses Enter in a text field.
•
The result is that an actionPerformed message is sent to all action
listeners that are registered on the relevant component.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
15. • To write an Action Listener, follow the steps given below:
• Declare an event handler class and specify that the class either
implements an ActionListener interface or extends a class that
implements an ActionListener interface.
For example:
public class MyClass implements ActionListener {
• Register an instance of the event handler class as a listener on one
or more components.
For example:
someComponent.addActionListener(instanceOfMyClass);
• Include code that implements the methods in listener interface.
For example:
public void actionPerformed(ActionEvent e)
{ ...//code that reacts to the action... }
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
16. ActionEvent Class
Method
Purpose
String getActionCommand()
Returns the string associated with this
action. Most objects that can fire action
events support a method called
setActionCommand that lets you set
this string.
Object getSource()
Returns the object that fired the event.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
17. ItemListener Interface
• Item events are fired by components that implement the
ItemSelectable interface.
• Generally, ItemSelectable components maintain on/off state for one or
more items.
• The Swing components that fire item events include buttons like
check boxes, check menu items, toggle buttons and combo boxes etc.
• ItemListener Interface has only one method.
public void itemStateChanged (ItemEvent)
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
18. ItemEvent class
Method
Object getItem()
Purpose
Returns the component-specific
object associated with the item
whose state changed. Often this is a
String containing the text on the
selected item.
ItemSelectable getItemSelectable() Returns the component that fired
the item event. You can use this
instead of the getSource method.
int getStateChange()
Returns the new state of the item.
The ItemEvent class defines two
states: SELECTED and
DESELECTED.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
19. KeyListener Interface
• Key events indicate when the user is typing at the keyboard.
• Key events are fired by the component with the keyboard focus
when the user presses or releases keyboard keys.
• Notifications are sent about two basic kinds of key events:
– The typing of a Unicode character
– The pressing or releasing of a key on the keyboard
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
20. • The first kind of event is called a key-typed event.
• To know when the user types a Unicode character ? whether by
pressing one key such as 'a' or by pressing several keys in sequence ?
• The second kind is either a key-pressed or key-released event.
• To know when the user presses the F1 key, or whether the user
pressed the '3' key on the number pad, you handle key-pressed events.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
21. Methods of KeyListener Interface
Method
Purpose
keyTyped(KeyEvent)
Called just after the user types a
Unicode character into the listenedto component.
keyPressed(KeyEvent)
Called just after the user presses a
key while the listened-to
component has the focus.
keyReleased(KeyEvent)
Called just after the user releases a
key while the listened-to
component has the focus.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
22. KeyEvent class
Method
int getKeyChar()
Purpose
Obtains the Unicode character associated
with this event.
int getKeyCode()
Obtains the key code associated with this
event. The key code identifies the
particular key on the keyboard that the user
pressed or released. For example, VK_A
specifies the key labeled A, and
VK_ESCAPE specifies the Escape key.
boolean isActionKey()
Returns true if the key firing the event is an
action key. Examples of action keys
include Page Up, Caps Lock, the arrow and
function keys.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
23. MouseListener Interface
• Mouse events notify when the user uses the mouse (or similar input
device) to interact with a component.
• Mouse events occur when the cursor enters or exits a component's
onscreen area and when the user presses or releases one of the mouse
buttons.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
24. Methods of MouseListener Interface
Method
Purpose
mouseClicked(MouseEvent)
Called just after the user clicks the
listened-to component.
mouseEntered(MouseEvent)
Called just after the cursor enters
the bounds of the listened-to
component.
mouseExited(MouseEvent)
Called just after the cursor exits the
bounds of the listened-to
component.
mousePressed(MouseEvent)
Called just after the user presses a
mouse button while the cursor is
over the listened-to component.
mouseReleased(MouseEvent)
Called just after the user releases a
mouse button after a mouse press
over the listened-to component.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
25. MouseEvent class
Method
Purpose
int getClickCount()
Returns the number of quick, consecutive
clicks the user has made (including this
event). For example, returns 2 for a double
click.
int getButton()
int getX()
int getY()
Returns which mouse button, if any, has a
changed state. One of the following
constants is returned: NOBUTTON,
BUTTON1, BUTTON2, or BUTTON3.
Return the (x,y) position at which the event
occurred, relative to the component that
fired the event.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
26. MouseAdapter Class
• MouseAdapter class provides an empty implementation of all the
methods in MouseListener interface. This class exists as convenience
for creating listener objects.
• Extend this class to create a MouseEvent listener and override the
methods for the events of interest.
• Create a listener object using the extended class and then register it
with a component using the component's addMouseListener method.
• When a mouse button is pressed, released, or clicked (pressed and
released), or when the mouse cursor enters or exits the component,
the relevant method in the listener object is invoked and the
MouseEvent is passed to it.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
27. MouseMotionListener Interface
• Mouse-motion events notify when the user uses the mouse (or a
similar input device) to move the onscreen cursor.
• If an application requires the detection of both mouse events and
mouse-motion events, use the MouseInputAdapter class.
• It implements the MouseInputListener a convenient interface that
implements both the MouseListener and MouseMotionListener
interfaces.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
28. Methods of MouseMotionListener Interface
Method
mouseDragged(MouseEvent)
mouseMoved(MouseEvent)
Purpose
Called in response to the user moving
the mouse while holding a mouse
button down. This event is fired by the
component that fired the most recent
mouse-pressed event, even if the
cursor is no longer over that
component.
Called in response to the user moving
the mouse with no mouse buttons
pressed. This event is fired by the
component that's currently under the
cursor.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
29. WindowListener Interface
• The listener interface for receiving window events.
• The class that is interested in processing a window event either
implements this interface (and all the methods it contains) or
extends the abstract WindowAdapter class (overriding only the
methods of interest).
• The listener object created from that class is then registered
with a Window using the window's addWindowListener ()
method.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
30. Methods of WindowListener
Method
Purpose
void windowClosing
(WindowEvent e)
Invoked when the user attempts to close the
window from the window's system menu.
void windowOpened
(WindowEvent e)
Invoked the first time a window is made visible.
void windowClosed
(WindowEvent e)
Invoked when a window has been closed as the
result of calling dispose on the window.
void windowIconified
(WindowEvent e)
Invoked when a window is changed from a
normal to a minimized state.
void windowDeiconified(W Invoked when a window is changed from a
indowEvent e)
minimized to a normal state.
void windowActivated
(WindowEvent e)
Invoked when the Window is set to be the active
Window.
void windowDeactivated(W Invoked when a Window is no longer the active
indowEvent e)
Window.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)