Home » Desktop Java

Desktop Java

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 »

Mouse button detection

With this example we shall show you how to use a MouseAdapter in order to detect which button of the mouse the user used. This is very useful when you want to add some extra functionality or flexibility to your application. It might be useful to the user to give input to the program using his mouse. Additionally you can ...

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 »

Move and resize objects using Mouse Events

With this tutorial we are going to see how to handle moving and re sizing events in a Java Desktop application. You might find this useful when you want to add rich mouse functionality to the application. For example it’s very cool to let the users resize a window using the mouse wheel. In short in order to move and ...

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 »

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

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 »

A simple mouse drag 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 ...

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 »

Drag event 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 objects that the user needs to move around the screen very frequently. It’s is very user friendly to let the user drag ...

Read More »