Java Tutorial

by Dinesh Thakur Category: Java 2D Example

Draw a straight line is one of the easiest things to do with Java2D. This is achieved through the Line2D class, whose constructor accepts four parameters, namely the coordinates of the start and end respectively.

 
by Dinesh Thakur Category: Java 2D Example

The QuadCurve2D class lets build a curved segment based on mathematical equations. The curve generated is also called curve quadratic Bezier and based on a very simple idea is to establish two points that define the ends of a curved segment and a third point, called checkpoint that allows "stretching" more or less the curvature of the segment.

 
by Dinesh Thakur Category: Java 2D Example

With this code we will study how text is drawn on a any image.

 
by Dinesh Thakur Category: Java 2D Example

The ellipses or ovals are drawn by Ellipse2D class.This requires you defined to be a rectangle enclosing the boundaries between the ellipse.There the concept of a circle, so that it must be obtained by an ellipse enclosed in a square.

 
by Dinesh Thakur Category: Java 2D Example

The class allows Arc2D draw an arc of an ellipse or a circle. For this, first the rectangle that contains the ellipse whose arc you want to draw is defined ; then assuming that the center of the rectangle sets the point (0,0) of a Cartesian coordinate axis , the angles start and end are specified the arc in degrees . Finally , indicate whether you want to close the bow joining ends or not. This closure can be of three types :

 
by Dinesh Thakur Category: Java 2D Example

This code can be seen as built a clipping path with the content of the text area of the word "Java " located in the middle of the window.In the drawn area can be seen as the image is painted behind the chain. As seen, the effect is very colorful and easy to perform.

 
by Dinesh Thakur Category: Java 2D Example

CubicCurve2D which also shows the segments joining  the ends with the points control and the set together. An example of use appears in the following code, which also have highlighted the four reference points. The result can be seen in CubicCurve2D Java Example.

 
by Dinesh Thakur Category: Java 2D Example

much more powerful mechanism for drawing text is provided  the TextLayout class.This class not only allows you to draw text in a similar way  to as was done be fore but also provides a number of methods that  let youk now what is specific to draw features.

 
by Dinesh Thakur Category: Java 2D Example

In this example we show how the Set operations going to make a Subtraction of 2 circles . Subtraction examples how the code as follows:

 
by Dinesh Thakur Category: Java 2D Example

In this example we show how the Set operations going to make a Addition of 2 circles. An example show the code below:

 
by Dinesh Thakur Category: Java 2D Example

The variable map is which allows you to assign design attributes of the object type source AttributedString. Through this variable may change any aspect of the font . TextAttribute example shown the code as follows:

 
by Dinesh Thakur Category: Java 2D Example

In this example we show how the Set operations going to make a union of 2 circles. Union exclusive (XOR ) examples how the code as follows:

 
by Dinesh Thakur Category: Java 2D Example

In this example we show how the Set operations going to make a Intersection of 2 circles . Intersection examples how the code as follows:

 
by Dinesh Thakur Category: Java 2D Example

This code can be seen as built a clipping path with the text area of the word " Dinesh Thakur " located in the middle of the window. In the drawn area can be seen as the image is painted behind the chain. As seen, the effect is very colorful and easy to perform.

 

 
by Dinesh Thakur Category: Java 2D Example

The Java2D API provides advanced two-dimensional graphics capabilities for programmers who require detailed and complex graphical manipulations. The API includes features for processing line art, text and images in packages java.awt, java.awt.image, java.awt.color, java.awt.font. java.awt.geom, java.awt.print and java.awt.image.renderable.



 
by Dinesh Thakur Category: JDBC

Join is a keyword in SQL that is used to retrieve data from two or more table based on some relationship between two columns.

 
by Dinesh Thakur Category: JDBC

A transaction is a group of operations used to perform a particular task. In a transaction if one operation fails then all operations of the transaction gets cancelled. Finally, the transaction status fails.

 
by Dinesh Thakur Category: JDBC

Microsoft's ODBC is the most commonly used driver to connect to the database as it can connect to almost all databases on most of the platforms. However, ODBC uses the concept of pointers and other constructs that are not supported by Java.



 
by Dinesh Thakur Category: JDBC

A JDBC statement object is used to execute an SQL statement. JDBC API supports three types of JDBC statement object to work with the SQL statements.



 
by Dinesh Thakur Category: JDBC

The save point is a logical position in a transaction up to which we can rollback the transaction. When the save point is placed in the middle of the transaction, the logics placed before the save point will be committed and the logics placed after the save point will be rolled back. There are two types of save points:

 


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.