Home » Archives for Byron Kiourtzoglou » Page 11

Author Archives: Byron Kiourtzoglou

Byron is a master software engineer working in the IT and Telecom domains. He is an applications developer in a wide variety of applications/services. He is currently acting as the team leader and technical architect for a proprietary service creation and integration platform for both the IT and Telecom industries in addition to a in-house big data real-time analytics solution. He is always fascinated by SOA, middleware services and mobile development. Byron is co-founder and Executive Editor at Java Code Geeks.

RGB to HSB and vice versa color conversion

With this example we are going to see how to convert RGB to HSB and vice versa. This is very useful when you want to unify the units in Java Desktop application, and thus make the components much more manageable. In short, in order to convert RGB to HSB and vice versa, one should follow these steps: Create three basic ...

Read More »

Center Frame on screen example

In this example we are going to see how to center a Frame on the screen. This is very important when you have many windows opened to your application and you want to manage the important ones. In short to center a Frame on screen, you have to follow these steps: Create a new Frame. Create a new TextArea and ...

Read More »

Set tool tip for tab in JTabbedPane

With this example we shall see how to set the tool tip for a tab in JTabbedPane. In order to do that, one should follow these steps: Create a new JFrame. Call frame.getContentPane().setLayout(new GridLayout(1, 1) to set up grid layout for the frame. Use JTabbedPane(JTabbedPane.TOP) to get a JTabbedPane. Use tabbedPane.addTab to add a tool tip. Let’s see the code: ...

Read More »

Remove tab in JTabbedPane

With this example we shall see how to  remove a tab from a JTabbedPane. In order to do that, one should follow these steps: Create a new JFrame. Call frame.getContentPane().setLayout(new GridLayout(1, 1) to set up grid layout for the frame. Use JTabbedPane(JTabbedPane.TOP) to get a JTabbedPane. Use tabbedPane.remove(2) to remove the third tab for instance Use tabbedPane.addTab to add a tool tip. Let’s see the code: package com.javacodegeeks.snippets.desktop; import java.awt.GridLayout; ...

Read More »

Get/Set selected tab in JTabbedPane

With this tutorial we shall show you how to get or set the selected tab in a JTabbedPane component of a Java Desktop Application. Basically all you have to do for it is to: Create a new JFrame. Call frame.getContentPane().setLayout(new GridLayout(1, 1) to set up grid layout for the frame. Use JTabbedPane(JTabbedPane.TOP) to get a JTabbedPane. Use tabbedPane.getSelectedIndex() to get the index of the selected tab. Use tabbedPane.setSelectedIndex() ...

Read More »

Add tab to JTabbedPane

In this tutorial we are going to see how to add a tab to a JTabbedPane component of a Java Desktop Application. Basically, all you have to do is: Create a new JFrame. Call frame.getContentPane().setLayout(new GridLayout(1, 1) to set up grid layout for the frame. Use JTabbedPane(JTabbedPane.TOP) to get a JTabbedPane. Use tabbedPane.addTab to add a tab.   Let’s see the code: package com.javacodegeeks.snippets.desktop; import java.awt.GridLayout; import javax.swing.Icon; import ...

Read More »

Get/Set divider size in JSplitPane

This is an example on how to get or set the size of the divider in a JSplitPane component of a Java Desktop Application. In order to do that you have to follow these steps: Create a new JFrame. Call frame.getContentPane().setLayout(new FlowLayout()) to set flow layout for the frame. Create two String arrays that will containt the contents of the ...

Read More »

Create JSplitPane example

This is an example on how to create a new JSplitPane component for a Java Desktop Application.The JSplitPane is commonly used component because it lets you split your window horizontally or vertically in order to create a wide variety of GUI elements to suit your application’s needs. In short in order to create a JSplitPane component in Java, one should ...

Read More »

Set scrollbar policy in JScrollPane container

With this example we are going to see how to set scroll bar policy in a JScrollPane container. This is very useful when you want to further customize your scroll bars. Basically all you have to do to set scroll bar policy in a JScrollPane is: Create a new JFrame. Create a new JTextArea. Create a new JScrollPane with the ...

Read More »

Select file selection mode in file chooser

With this tutorial we are going to see how to set the file selection mode in a file chooser of a Java Desktop Application. This is very useful when you want to search for a specific type of file in your file system. To select file selection mode in a file chooser in a Java Application you have to: Create ...

Read More »