Home » Author Archives: Ilias Tsagklis (page 10)

Author Archives: Ilias Tsagklis

Ilias Tsagklis
Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.

Scaling Shearing Translating and Rotating a drawn image

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 drwan Image one should take the following steps: Load an image from a source using Toolkit.getDefaultToolkit().getImagemethod Use an ImageObserver to monitor ...

Read More »

Loading an Image from a file

In this tutorial we are going to show you how to draw on an Image. This is quite useful when you want to further customize the graphics of your application, if you are not pleased with the original Image. In short in order to Draw on a Buffered Image one should take the following steps: Load an image from a source ...

Read More »

Draw using Alpha example

In this example we are going to see how to draw an image with Alpha enabled. The notion of Alpha is quite famous on the graphics world. This will help you to make sharper graphics and make your images look very clear and avoid pixelation. In short, in order to enable antialiasing in your drawing, you should: Create a class ...

Read More »

Key event listener to capitalize letter keys example

In this example we shall show you how to use KeyEventDispatcher interfacce in order to create a simple application that capitalizes key letters on the fly in a Java Desktop Application. You might find this particularly usefull when you want your application to ignore the case of text input. Additionally, you can use these template and the basic techniques to ...

Read More »

Draw text example

With this example we are going to see how to draw text in a Java Desktop Application. This is very useful when you have lots of graphics components in your application and you want to display some text in it.   In order to draw text in your Java Desktop Application you should: Create a new Frame. Add to the ...

Read More »

Draw shapes example

With this tutorial we shall show you how to draw simple shapes in a Java Desktop Application. This is a very important step when designing your own graphics for your App. Basically, all you have to do in order to draw shapes in a Java application is: Create a new Frame. Create a class that extends the Component class and ...

Read More »

Determine when a component is added or removed from a container

In this example we shall show you how to use a ContainerListener in Java. When you develop an Application with dynamic GUI features, it’s very important to monitor the activities of the components that are added or removed from a component container, and that is the job of the ContainerListener. In short to work with a ContainerListener you have to: Create a new ContainerListener Override the ...

Read More »

Determine when a component moves becomes visible or resizes

In this tutorial we are going to see how to use the ComponentAdapter class in Java. In some ways the ComponentAdapter is quite similar to the ComponentListener interface, but being a class it can be used more robustly, among some other features it implements. In this example we are going to see how to monitor the window position of a window in you application. The position of the ...

Read More »

Drawing components example

With this tutorial we shall show you how to draw simple shapes in a Java Desktop Application. This is a very important step when designing your own graphics for your App Basically, all you have to do in order to draw shapes in a Java application is: Create a new Frame. Create a class tha extends Component class and override the paint method. Use Graphics2D.drawOval to draw an ...

Read More »

Screen capture example

In this example we are going to see how to take screen captures in a Java Desktop Application. Basically, all you have to do to take screen captures is: Create a new Robot instance. Create a new Rectangle shape. Use robot.createScreenCapture to get a rectangle screen capture. Use ImageIO to save the image in a file.   Let’s see the ...

Read More »