Home » Archives for Ilias Tsagklis » Page 6

Author Archives: Ilias Tsagklis

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

List all available font families

With this tutorial we are going to see how to list all available font families in your environment using Java. A font family refers to a set of font faces with a related typographic design. For example, the font faces in the Lucida Sans Typewriter family are Lucida Sans Typewriter Bold, and Lucida Sans Typewriter Regular etc. This example lists ...

Read More »

Window closing event handling

In this example we are going to see how to handle window closing events. This is a very basic event handling when you are working on a UI Application. Basically all you have to do to handle window closing events is: Create a simple JFrame window Use addWindowListener to add a window listener to the JFrame Override windowClosing method of ...

Read More »

WindowListener demo

In this tutorial we will see how to use the WindowListener. This is particularly useful when you are working with a window application and you want to monitor the state of each window. With the WindowListener you can monitor a number of events. The opening or the closing of a window for instance. So, when a window opens or closes, ...

Read More »

Multicast event example

In this tutorial we are going to see how to manage multicast events. Multicast events are quite useful when you have to work with many windows in your application and you just want to perform the same action or a group of actions in a number of windows in your application at the same time. For example, if the user ...

Read More »

Keymap and KeyStroke example

With this example we are going to see how to use Keymap and KeyStroke classes in a Java. These classes are useful when you want to bind a certain key stroke with the default button of the window. In order to work with Keymap and KeyStroke: Use KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false) method to get the “Enter” key stroke. Use Keymap.removeKeyStrokeBinding to ...

Read More »

Items with the same ActionListener

With this tutorial we are going to show you how to create several items with the same ActionListener. This is very useful when you want a number of components to behave in the same way under the occurrence of certain events. It’s very easy to add this kind of functionality in your Application. You simply: Create the items you want ...

Read More »

MouseWheelListener example

With this tutorial we are going to show you how to use a MouseWheelListener in Java. This event listener is particularly useful when you want to add extra user friendly functionality in your application. For example, if you want the user to change the value of a specific item, you can allow him to do that using the wheel of ...

Read More »

MenuListener example

With this example we shall show you how the MenuListener interface works in Java. Menu components are very usual in rich, Graphical applications and they contribute to a better user experience. So, a MenuListener component can be very useful when your application has many menu items and it’s important to monitor the user events and the user interactions with each ...

Read More »

JRadioButton with ItemListener example

In this example we are going to see how to use JRadioButton bundled with an ItemListener. As you know, radio buttons a quite popular in Graphical Applications because they give flexibility to the end users, and it’s very natural to them to interact with radio buttons when you want to give specific values to choose from. In short, to use ...

Read More »

ItemListener example

In this example we are going to see how to use several components like  JRadioButton  and JComboBox  bundled with an ItemListener. As you know, radio buttons and combo boxes are quite popular in Graphical Applications because they give flexibility to the end users, and it’s very natural to them to interact with them when you want to give specific values to choose from. ...

Read More »