Home » Desktop Java » awt » geom

geom

Scaling Shearing Translating Rotating a Shape

With this example will shall show you four fundamental graphical transformations that you should know when you try to construct you own custom graphical environment or develop simple graphics. In short in order to perform Scaling, Shearing, Translation and Rotation to a simple shape, one should take the following steps: Use RoundRectangle2D to construct a simple rectangle shape Use AffineTransform class and its ...

Read More »

Create a shape from lines and curves

With this tutorial we shall show you how to swap RGB values in an Image. This is very useful when you are trying to create some effects to your Application. Basically all you have to do in order to swapp RGD values of an Image is: Create a GeneralPath class instance Use moveTo, lineTo, quadTo, curveTo and closePath to draw ...

Read More »

Combining shapes example

In this tutorial we shall show you how to create a simple graphic by combining basic shapes. We are going to use some the built in classes that Java offers. Basically to create and combine shapes in Java: Use Line2D, Ellipse2D, Rectangle2D, RoundRectangle2D, Arc2D, Area to create some simple shapes Use add, subtract, intersect, exclusiveOr methods of the Area class ...

Read More »

Creating basic shapes example

In this tutorial we shall show you how to construct a simple graphic by creating basic shapes. We are going to use some the built in classes that Java offers. Basically to create simple shapes in Java: Use Line2D, Ellipse2D, Rectangle2D, RoundRectangle2D, Arc2D, Area to create some simple shapes Then use Graphics2D class and its draw function ton paint each shape an a new Frame. Let’s see how the ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns