Home » Tag Archives: desktop java

Tag Archives: desktop java

Java Swing Key Binding Example

Places where KeyListener is used in order to map key input to some action, it is more convenient and preferred from usimg Keymap or InputMap and ActionMap combination instead. Using Keymap or InputMap and ActionMap combination, it is easier to map the action to a specific key stroke and thus key binding is achieved. 1. Introduction Most of the manipulations performed on text ...

Read More »

Java Swing JTextField Example

Swing offers us components through which users can type in text input. JTextField is one such component which is used to allow applications to accept single line input. Even user can go for standard operations like copy, paste, cut, delete. 1. Introduction Swing offers several components to ease user experience while typing in text or edit text. Different such are ...

Read More »

Java Swing GridLayout Example

In Swing, in order to arrange components in a form, dialog box etc. in user friendly manner layout manager is found to be very useful. There are several layout managers. GridLayout is such layout manager. 1. Introduction GridLayout actually forms a grid like arrangement of cells. This is just like one excel spreadsheet where each cell is of same size. If ...

Read More »

Eclipse Window Builder Tutorial for GUI Creation

1.Introduction In this example, we will show you how to develop Java GUI Application using Eclipse WindowBuilder plug-in. Eclipse WindowBuilder is a powerful and easy to use bi-directional Java GUI designer that makes it very easy to create Java GUI applications without spending a lot of time writing code to display simple forms. The bi-directional Java GUI designer means the ...

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 »