-
UNIT I INTRODUCTION TO OOP AND JAVA FUNDAMENTALS 0/1
Object Oriented Programming – Abstraction – objects and classes – Encapsulation- Inheritance – Polymorphism- OOP in Java – Characteristics of Java – The Java Environment – Java Source File Structure – Compilation. Fundamental Programming Structures in Java – Defining classes in Java – constructors, methods -access specifiers – static members -Comments, Data Types, Variables, Operators, Control Flow, Arrays , Packages – JavaDoc comments.
-
Lecture1.1
-
Lecture1.2
-
Lecture1.3
-
Lecture1.4
-
Lecture1.5
-
Lecture1.6
-
Lecture1.7
-
Lecture1.8
-
Lecture1.9
-
Quiz1.1
-
-
UNIT II INHERITANCE AND INTERFACESÂ 0/1
Inheritance – Super classes- sub classes –Protected members – constructors in sub classes- the Object class – abstract classes and methods- final methods and classes – Interfaces – defining an interface, implementing interface, differences between classes and interfaces and extending interfaces – Object cloning -inner classes, ArrayLists – Strings
-
Lecture2.1
-
Lecture2.2
-
Lecture2.3
-
Lecture2.4
-
Lecture2.5
-
Lecture2.6
-
Lecture2.7
-
Lecture2.8
-
Lecture2.9
-
Quiz2.1
-
-
UNIT III EXCEPTION HANDLING AND I/OÂ 0/1
Exceptions – exception hierarchy – throwing and catching exceptions – built-in exceptions, creating own exceptions, Stack Trace Elements. Input / Output Basics – Streams – Byte streams and Character streams – Reading and Writing Console – Reading and Writing Files
-
Lecture3.1
-
Lecture3.2
-
Lecture3.3
-
Lecture3.4
-
Lecture3.5
-
Lecture3.6
-
Lecture3.7
-
Lecture3.8
-
Lecture3.9
-
Quiz3.1
-
-
UNIT IV MULTITHREADING AND GENERIC PROGRAMMINGÂ 0/0
Differences between multi-threading and multitasking, thread life cycle, creating threads, synchronizing threads, Inter-thread communication, daemon threads, thread groups. Generic Programming – Generic classes – generic methods – Bounded Types – Restrictions and Limitations.
-
Lecture4.1
-
Lecture4.2
-
Lecture4.3
-
Lecture4.4
-
Lecture4.5
-
Lecture4.6
-
Lecture4.7
-
Lecture4.8
-
-
UNIT V EVENT DRIVEN PROGRAMMINGÂ 0/1
Graphics programming – Frame – Components – working with 2D shapes – Using color, fonts, and images – Basics of event handling – event handlers – adapter classes – actions – mouse events – AWT event hierarchy – Introduction to Swing – layout management – Swing Components – Text Fields , Text Areas – Buttons- Check Boxes – Radio Buttons – Lists- choices- Scrollbars – Windows –Menus – Dialog Boxes.
-
Lecture5.1
-
Lecture5.2
-
Lecture5.3
-
Lecture5.4
-
Lecture5.5
-
Lecture5.6
-
Lecture5.7
-
Lecture5.8
-
Lecture5.9
-
Lecture5.10
-
Lecture5.11
-
Quiz5.1
-
Adapter Classes and Actions in Event Driven Programming
Java adapter classes provide the default implementation of listener interfaces. If you inherit the adapter class, you will not be forced to provide the implementation of all the methods of listener interfaces. So it saves code.
The adapter classes are found in java.awt.event, java.awt.dnd and javax.swing.event packages. The Adapter classes with their corresponding listener interfaces are given below.
java.awt.event Adapter classes
Adapter class | Listener interface |
---|---|
WindowAdapter | WindowListener |
KeyAdapter | KeyListener |
MouseAdapter | MouseListener |
MouseMotionAdapter | MouseMotionListener |
FocusAdapter | FocusListener |
ComponentAdapter | ComponentListener |
ContainerAdapter | ContainerListener |
HierarchyBoundsAdapter | HierarchyBoundsListener |
java.awt.dnd Adapter classes
Adapter class | Listener interface |
---|---|
DragSourceAdapter | DragSourceListener |
DragTargetAdapter | DragTargetListener |
javax.swing.event Adapter classes
Adapter class | Listener interface |
---|---|
MouseInputAdapter | MouseInputListener |
InternalFrameAdapter | InternalFrameListener |
Java WindowAdapter Example
- import java.awt.*;
- import java.awt.event.*;
- public class AdapterExample{
-     Frame f;
- Â Â Â Â AdapterExample(){
-         f=new Frame(“Window Adapter”);
-         f.addWindowListener(new WindowAdapter(){
-             public void windowClosing(WindowEvent e) {
- Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â f.dispose();
- Â Â Â Â Â Â Â Â Â Â Â Â }
- Â Â Â Â Â Â Â Â });
- Â Â Â Â Â Â Â Â f.setSize(400,400);
- Â Â Â Â Â Â Â Â f.setLayout(null);
- Â Â Â Â Â Â Â Â f.setVisible(true);
- Â Â Â Â }
- public static void main(String[] args) {
-     new AdapterExample();
- }
- }
Output:
|