Home » Archives for Ilias Tsagklis » Page 8

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.

A simple text menu using TextAction example

With this tutorial we are going to show you how to create an application with a simple text menu that uses TextAction in Java. This will be particularly useful when you want to create a simple and fast menu for your GUI Application. In order to work with TextAction in Java: Create a JTextArea component. Use the getActions() methods of ...

Read More »

ChangeListener example

In this example we are going to see how to use the ChangeListener interface in Java. This is very useful when you want to monitor generic changes in your application. In short, to use a simple ChangeListener one should follow these steps: Create a new ChangeListener instance. Override the stateChanged method to customize the handling of specific events. Use specific functions of components to get better undemanding of ...

Read More »

Multilistener example

In this tutorial we shall show you how to use an ActionListener in order to create a Multilistener component in a Java Desktop application. You may find this useful when you want some of your components to behave in the same way under certain circumstances. In short, all you have to do in order to create a MultiListener component is: ...

Read More »

Detect double or triple click example

With this tutorial we are going to see how can you detect double or triple clicks in a Java Desktop application. This is very useful when you want the user to have rich interaction with your application using his mouse. You can also add extra functionality according to how many clicks the user did with the mouse. In short all ...

Read More »

Handling Mouse Clicks example

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 »

KeyStrokes example

In this example we are going to see how to work with key strokes in a Java Desktop Application. You might find this useful when you want to bind specific keystrokes with certain behaviors in your app. For example you might want to give the user the opportunity to specify key shortcuts etc. Basically in order to set up and use key ...

Read More »

MouseMotion event example

With this tutorial we shall show you how to work with the MouseMotionListener interface in Java. It is a very useful feature when you want to have full control over mouse events and mouse input that the users give. It also particularly useful when you want to make your application behave according to the mouse events that occur. This is very ...

Read More »

Draw and Drag rectangles

In this example we are going to create a simple application in which you can draw a simple shape (rectangle for example ) and drag it around our canvas. This is a very nice feature to use if your application has many graphical object that the user needs to move around the screen very frequently. It’s is very user friendly ...

Read More »

Drag and Selection example

With this example we shall show you how to work with MouseListener and MouseMotionListener interfaces in order to handle and monitor mouse events an especially mouse drags. This is a very nice feature to use if your application has many graphical object that the user needs to move around the screen very frequently. It’s is very user friendly to let the user drag ...

Read More »

List Key strokes example

In this example we are going to see how to list all Key Strokes in Java. This is very useful when you want to inform users of the application or the client code about all available key strokes. Basically all you have to do in order to list key strokes, one should follows these steps: Create an input device like ...

Read More »