Home » Desktop Java » awt

awt

Java GridLayout Example

GridLayout represents a layout manager with a specified number of rows and columns. Every rectangle cell has the same size and contains a component, which fills in the entire size of the cell. In this example we are going to design a simple calculator using GridLayout, where the grid will contains simple components.         1. Syntax of ...

Read More »

Ring the bell example

In this tutorial we are going to show you how to use the Terminal bell in a Java program. You might want to use the bell in terminal based apps to get the user’s attention when something important happens to the program. So in order to ring the bell in a Java Application you have to: Print the ASCII code ...

Read More »

Handling Mouse Clicks

In this short tutorial we are going to see how to monitor a very basic GUI event in Java Desktop Applications, which is mouse clicks. What we want to see is what button mouse the user pressed (left, middle or right click) and then we want to know the exact location, in coordinates, in our Frame that this event occurred. ...

Read More »

Print shapes example

In this tutorial we are going to show how you can print simple shapes in paper using your printer. We are going to use some basic classes from AWT. The basic steps we go through this example are: Create a custom class that extends Component and implements Printable Override the paint method of Component class. Inside that method create a ...

Read More »

Sharpening a Buffered Image

In this example we are going to see how can you load an image from a source (a URL for instance) and make it look sharper in your own screen and according to the graphics environment that it is displayed into. Basically, to sharpen a Buffered Image one should take the following steps: Load an image from a URL using ...

Read More »

Flipping a Buffered Image

With this example we are going to show you how to perform one of the most basic graphics transformations. When you perform flipping of an image you simply rotate the image. In short in order to flip an image one should take the following steps: Load an image from a source using Toolkit.getDefaultToolkit().getImage method Use an ImageObserver to monitor the loading of the image. ...

Read More »

Embossing a Buffered Image

In this tutorial we are going to see how can you load an image from a source  and emboss it according to your needs Basically, to emboss a Buffered Image one should take the following steps: Load an image from a URL usingToolkit.getDefaultToolkit().getImage method Use an ImageObserver to monitor the loading of the image. When the image is fully load the user will ...

Read More »

Converting a Colored Buffered Image to Grayscale

With this tutorial we are going to see all that is necessary in order to load a colored image from a source and convert it to grayscale. Basically, to convert a Colored Buffered Image to grayscale one should take the following steps: Load an image from a URL using Toolkit.getDefaultToolkit().getImage method Use an ImageObserver to monitor the loading of the image. When the image ...

Read More »

Brightening or Darkening an RGB Buffered Image

In this tutorial we are going to see all that is necessary in order to brighten or darken an RGB Buffered Image from a source. This is one of the most basic image processing techniques that you will use when developing applications that involve images. Basically, to brighten or darken a buffered image one should take the following steps: Load an ...

Read More »

Blurring a Buffered Image

In this tutorial we are going to see how can you load an image from a source  and blur it. This is one of the most basic graphics effects that you are going to use when you begin with image processing. In short, to blur a Buffered Image you simply have to take the following steps: Load an image from ...

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