Home » Archives for Ilias Tsagklis » Page 12

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.

Center JFrame/JWindow/JDialog on screen

In this example we shall show you how to center JFrame, JWindow, JDialog components in a Java Desktop Application. You can use this when you want to center you windows in your application automatically. For example, if your application has to handle many windows, you might want to add a button that centers the components you want. Basically, all you ...

Read More »

Create JFrame window with window close event

This is an example on how to create a JFrame window with window close event. Pairing a window with a closing event is a very common practice in most GUI applications. When the user closes a window, it usually means that you have to release several resources or event exit the application. The basic steps to create a JFrame with ...

Read More »

Get selected JRadioButton from ButtonGroup

With this example we shall show you how to get the selected JRadioButton for a ButtonGroup in a Java Desktop Application. Radio buttons, in general, implement a very user friendly way ton provide input to your application, especially when the user has some specific elements to choose from. In order to get the selected JRadioButton from a ButtonGroup, one should ...

Read More »

Create Checked/Unchecked JCheckBox

With this example we shall show you how to create JCheckBoxes in a Java Desktop Application. Checkboxes are very commonly used when we provide the user with a list of choices and we want him to pick as many as he wishes. To create a Checked/Unchecked JCheckBox you have to: Create a number of JCheckBoxes. Use setSelected method to set ...

Read More »

Create new JCheckBox example

With this example we shall show you how to create JCheckBoxes in a Java Desktop Application. Checkboxes are very commonly used when we provide the user with a list of choices and we want him to pick as many as he wishes. To create a JCheckBox you have to: Create a number of JCheckBoxes. Use setSelected method to set a check box checked by default. Otherwise the ...

Read More »

Create JButton example

With this example we shall show you how to create a JButton component for your Java Desktop Application. JButtons are very frequently used, and it is a very standard practice to use buttons for basic input operations in GUI applications. It’s very easy to create a JButton, as all you have to do is: Create a class tha extends JFrame. ...

Read More »

Set foreground color in JLabel

With this example we shall show you how to set foreground color in a JLabel component in Java Desktop Applications. This will enrich and customize your GUI components. It’s very easy to set the foreground color in a JLebel, as all you have to do is: Create a class that extends JFrame. Create a new JLabel. Use JLabel.setForeground(Color.[COLOR_CODE]) to set ...

Read More »

Create JLabel with border

In this example we are going to see how to create a JLabel with border. This is one basic graphics enhancement for your application. In general, this is one of the main customizations you can perform to your JLabels. In short, all you have to do to create a JLabel with border is: Create a class that extends JFrame. Create ...

Read More »

Create JLabel with ImageIcon and text

In this tutorial we are going to learn how to create a JLabel with ImageIcon and text in it. Using ImageIcons and text in Labels, usually makes them self explanatory to the end user. In short, to create a JLabel with ImageIcon and text, one should follow these steps: Create a class that extends JFrame. Create a new JLabel. Create ...

Read More »

Create JTextField with tooltip

With this example we are going to learn how to create a JTextField with a tootip. Tooltip texts are very useful because they explain to the users how to use a specific component. It’s very easy to set a tooltip text in a JTextField as all you have to do is: Create a class that extends JFrame. Create a new ...

Read More »