Home » desktop java » Page 5

Tag Archives: desktop java

ListSelection example

With this tutorial we shall show you how to perform List Selection activities using JList components and ListSelectionListener interface. List selection is a very useful feature, when you applications requires user input with fixed choices. In order to use JList and ListSelectionListener, one should perform the following steps: Create a class that implements ListSelectionListener interface. Override the methods that correspond ...

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 »

InternalFrameListener example

In this example we are going to see how to use InternalFrameListener in Java. When you are developing an application with a vivid Graphical environment it is very possible that you will use JInternalFrame components to enhance the end user’s experience. As you might image the monitoring an handling of the several events that occur in the life cycle of ...

Read More »

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 »

FocusListener example

This is an example that discusses how to use FocusListener in Java. This is a very handy feature when you have several components and you want to monitor and handle the event when on of them gains or looses focus. In short, all you have to do in order to work with a FocusListener is: Create a new FocusListener Override ...

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 »

Maximization event example

With this tutorial we shall show you how use the ComponentListener interface to handle Maximization events in your Java Application. The basic idea is very simple. We want the user to be noted every time he maximizes a certain window in our Application. This is very important when your application has to handle many different windows an you want 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 »

ComponentAdapter example

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

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 »