Home » jlabel

Tag Archives: jlabel

Java JFrame Example

Bipartite Graph

In this article, we include a Java JFrame tutorial through examples. We will discuss some of the main methods and how JFrame and other main classes like JPanel, JLabel, and JButton fit into the Swing hierarchy. We will then create a simple GUI using the javax.swing package. 1. Introduction JFC (Java foundation classes) encompasses a group of features for building ...

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 »

Set background color in JLabel

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

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 »

Align Icon in JLabel

With this tutorial we shall show you how to align Icons in JLabel. This is a very easy optimization you can perform to your JLabel. Basically in order to align Icon in JLabel, one should follow these steps: Create a class that extends JFrame. Create a new ImageIcon. Create a new JLabel and use new JLabel(icon, JLabel.CENTER) to set the ...

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 »