Home » Archives for Ilias Tsagklis » Page 7

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.

HyperLinkListener example

With this example we shall show you how to use a HyperLinkListener in Java. This is very useful when you have hyperlinks in the content you present in your application. In that case it might be important to monitor the hyperlink activity of the applications. For example, you might want to interact somehow with the user every time he clicks ...

Read More »

ContainerListener example

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: ...

Read More »

Print window position example

In this example we are going to see how to use a ComponentListener in order to print the window position in a Java application. The position of the window will be updated every time the user changes position to the window. This may be useful when you want your application to react differently depending on the position of the window. In ...

Read More »

ComponentListener example

With this example we are going to see how to use a ComponentListener in order to monitor the window events in our Java Application. This may be useful when you want your application to react differently depending on the position or the kind of movement of the window. In short, to work with the ComponentListener interface, one should follow these steps: Create a class ...

Read More »

AdjustmentListener example

In this tutorial we are going to see how AdjustmentListener works in Java. It is quite useful when you want to monitor a very wide variety of changes in a program with rich GUI components. For example if you bundle an AdjustmentListener with a scroll pane every time a value or a property of that component changes, the corresponding event ...

Read More »

WindowListener example

With this tutorial we shall show you how to use the WindowListener interface in Java. This component can be very useful when you develop an application with many windows an many frames, and you mast have full control over window changes. This can also be used when you want your application to behave differently depending on the window changes the ...

Read More »

A simple application to Load – Save – Edit a file

This is an example on how to create a simple GUI application that Loads, Edits and Saves a file in Java. You might find it useful if you wish to add such a functionality built into your app. For example if you have an application that handles Files, and you want to add a “Quick Edit” option. Basically, to create ...

Read More »

Focus change example

In this example we are going to see how to change focus in a Java Application. All you have to do is: Create a new ActionListener. Override the actionPerformed method. When this method fires up use the transferFocus method to transfer the focus to a specific component. Create a class that extends MouseAdapter. Override the mouseEntered method When this method ...

Read More »

PropertyChangeListener example

In this tutorial we are going to see how to use PropertyChangeListener in Java. This is very important when you are working with many components and you want to have full control over their properties. Another use case of this Listener might be when you want to customize the behavior of your program according to the changes of certain properties ...

Read More »

AncestorListener example

In this example we are going to see how AncestorListener can be paired with a timer in Java. This is very useful when you add or remove components to your Java Application and you want to monitor the relationship changes that follow these actions. Basically, all you have to do in order to work with AncestorListener  in Java is: Create a new AncestorListener instance. Override ...

Read More »