
Quick Contact
Java Tutorial
- What is Java?
- History of Java
- Hello Java Program
- Features of Java
- Basic Syntax
- Java Setup
- Data Types in Java
- Java Variables
- Operators in Java
- JVM
- Java If-else Statement
- Switch Case Statement
- Java Loops
- Do-While Loop
- Java While Loop
- Continue Statement
- Break Statement in Java
- Constructors in Java
- Oops Concept in Java
- Features of OOPs
- Inheritance
- Exeception handeling
- Aggregation (HAS-A relationship) in Java
- Method Overriding in Java
- Method Overloading
- Java Static Keyword
- Java This Keyword
- Java Final Keyword
- Polymorphism
- Static Binding and Dynamic Binding
- Abstract class in Java
- Access Modifiers in Java
- Difference between abstract class and interface
- Interface in Java
- Garbage Collection in Java
- Java Package
- Encapsulation
- Serialization and Deserialization in Java
- Java Inner Classes
- Java Applets
- Multithreading in Java
- Thread Priorities in Java
- Thread Creation
- Inter Thread Communication
- Wrapper Classes in Java
- Java Input Output
- Java AWT Introduction
- Java Layout Manager
- Java Layout Policy
- Java AWT Events
- Collection Framework
- Collection Framework List Interface
- Swing in Java
- Swing Utility Classes
- Swing Layout Managers
- Java JDBC
- Hibernate Framework Overview – Architecture and Basics
Springboot
- Spring Environment Setup
- Spring Boot CRUD REST API Project using IntelliJ IDEA | Postman | MySQL
- Dockerizing Spring Boot Application | Spring Boot Docker Tutorial
- spring-boot-restapidocumentation with swagger
- Spring Boot HttpClient Overview
- Apache HttpClient POST HTTP Request Example
- Apache HttpClient PUT HTTP Request Example
- Apache HttpClient DELETE HTTP Request Example
- Apache HttpClient HTML Form POST Request Example
- Spring Boot JSP Exampl
- Deploying Spring Boot WAR file with JSP to Tomcat
- Spring Boot Annotations
- Spring Core Annotations
- Spring MVC Annotations with Examples
- Spring Scheduling Annotations
- Spring - Java-based Container Configuration
- Spring Java Based Configuration Example
Hibernate
- Hibernate 5 hello world
- Hibernate- One to One Unidirectional Mapping Annotation Example
- Hibernate - Batch Processing
- Hibernate - Interceptors
- Hibernate 5 - Create, Read, Update and Delete (CRUD) Operations Example
- Hibernate Transaction Management
- Hibernate One to Many Unidirectional Mapping Example
- Hibernate One to Many Bidirectional Mapping Example
- Hibernate Many to Many Annotation Mapping Example
- Hibernate Primary KeyJoin Column
- Hibernate First Level Cache with Example
- Hibernate XML Configuration Example with Maven + Eclipse + MySQL Database
- Hibernate Java Configuration Example
- JPA 2 with Hibernate 5 Bootstrapping Example
- JPA and Hibernate Cascade Types
- Hibernate/JPA - Primary Key Generation
- Hibernate 5 - Enum Type Mapping Example
- Hibernate Component Mapping
- Hibernate Object States – Transient,Persistent and Detached
- Hibernate 5 - Save an Entity Example
- Hibernate 5 - Persist an Entity Example
- Hibernate 5 - saveOrUpdate() Method Example
- Hibernate 5 - get(), load() and byId() Method Examples
- Hibernate 5 - merge() Example
- Hibernate 5 - Delete or Remove an Entity Example
- Hibernate 5 - load() Method Example
- Hibernate Session Interface Methods
- Hibernate Session.clear() Method Example
- Introduction Of Java strutes to Architecture
- Struts 2 - Architecture
- Struts 2 - Configuration Files
- Struts 2 - Actions
- Struts 2 - Interceptors
- Struts 2 - Results & Result Types
- Struts 2 - Value Stack/OGNL
- Struts 2 - File Uploading
- Struts 2 - Database Access
- Struts 2 - Validations Framework
JAVA FX
- JavaFX Tutorial
- Introduction to JavaFX Pane
- JavaFX Popup
- JavaFX group
- JavaFX Controller
- JavaFX Gradient Color
- JavaFXAnchorPane
- JavaFXTabPane
- JavaFX Scene
- JavaFX Stage
- JavaFXWebView
- JavaFX Timeline
- JavaFX Timer
- JavaFX Image
- JavaFX Background
- JavaFX dialog
- JavaFX Font
- JavaFXTextArea
- JavaFXObservableList
- JavaFX GUI
- JavaFX FXML
- JavaFXEventHandler
- JavaFXGradle
- JavafxScrollpane
- JavaFXAPI
Swing Utility Classes
Before we start developing some serious Swing GUIs, it is worth mentioning some utility classes frequently used. They are simple classes. Most of them have some properties specified in their constructors and have getters and setters for those properties.
The Point Class
As the name suggests, an object of the Point class represents a location in a two-dimensional space. Two-dimensional space is represented by two values: an x coordinate and a y coordinate. The Point class is in the java.awt package. The following snippet of code demonstrates its use:
//Create an object of the Point class with (x, y) coordinate of (20, 40) Point p = new Point(20, 40); //Get the x and y coordinate of p int x = p.getX(); int y = p.getY(); //Set the x and y coordinate of p to (10, 60) p.setLocation(10, 60); The Point class's main usage in Swing is to set and get the location (x and y coordinates) of a component. For example, you can set the location of a JButton. JButton closeButton = new JButton("Close"); //The following two statements do the same thing. //We will use one of the following statements and not both. closeButton.setLocation(10, 15); closeButton.setLocation(new Point(10, 15)); //Get the location of the closeButton Point p = closeButton.getLocation();
The Dimension Class
An object of the Dimension class wraps the width and height of a component. The width and height of an element are collectively known as its size. In other words, the Dimension class object is used to represent the size of a component. We can use an object of the Dimension class to wrap any two arbitrary integers. The class is in the java.awt package.
//Create an object of the Dimension class with a width and height of 200 and 20 Dimension d = new Dimension(200, 20); //Set the size of closeButton to 200 X 20. Both of the statements have the same efecct. //You will use one of the following two statements. closeButton.setSize(200, 20); closeButton.setsize(d); //Get the size of closeButton Dimension d2 = closeButton.getSize(); int width = d2.width; int height = d2.height;
The Insets Class
An object of the Insets class represents spaces that are left around a container. It wraps four properties named top, left, bottom, and right. Their values represent the spaces left on the four side of a container. The class is in the java.awt package.
//Create an object of the Insets class //using its constructor Insets(top, left, bottom, right) Insets ins = new Insets(20, 5, 5, 5); //Get the insets of a JFrame Insets ins = frame.getInsets(); int top = ins.top; int left = ins.left; int bottom = ins.bottom; int right = ins.right;
The Rectangle Class
As its name suggests, an instance of the Rectangle class represents a rectangle. It is in the java.awt package. You can define a rectangle in many ways. Three properties define a Rectangle:
- (x, y) coordinates of the upper-left corner
- Width
- Height
We can think of a Rectangle object as a combination of a Point object and a Dimension object; the Point object has the (x, y) coordinates of the upper left corner and the Dimension object holds the width and height. We can create an object of the Rectangle class by specifying different combinations of its properties.
//Create a Rectangle object whose upper-left corner is at (0, 0) //with width and height as zero Rectangle r1 = new Rectangle(); //Create a Rectangle object from a Point object with its width and height as zero Rectangle r2 = new Rectangle(new Point(10, 10)); //Create a Rectangle object from a Point object and a Dimension object Rectangle r3 = new Rectangle(new Point(10, 10), new Dimension(200, 100)); //Create a Rectangle object by specifying its upper-left corner's //coordinate at (10, 10) and width as 200 and height as 100 Rectangle r4 = new Rectangle(10, 10, 200, 100);
The Rectangle class defines many methods to manipulate a Rectangle object and to inquire about its properties, such as the (x, y) coordinate of its upper-left corner, width, and height.
An object of the Rectangle class defines the location and size of a component in a Swing application. The location and size of a component are known as its bounds. Two methods, setBounds() and getBounds(), can be used to set and get any component or container’s bounds. The setBounds() method is overloaded, and you can specify x, y, width, and height properties of a component, or a Rectangle object. The getBounds() method returns a Rectangle object.
Apply now for Advanced Java Training Course