SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

SWING / NOTES</>↗
Swing19 Oct 2010

How do I remove tabs from JTabbedPane?

To remove tabs from JTabbedPane we can use the following remove methods: remove(int index) method to remove a tab at the specified index. remove(Component component) method to remove a tab that has the specified child component. removeAll() method to remove all tabs. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class TabbedPaneRemoveTab extends JPanel { public […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing19 Oct 2010

How do I assign keyboard shortcut to JTabbedPane tabs?

To assign a keyboard shortcut for accessing JTabbedPane‘s tab you can use the setMnemonicAt(int tabIndex, int mnemonic) method of the JTabbedPane class. The tabIndex parameter is a zero-based value parameter which means that the first tab is at index number 0. For the mnenomic parameter you can use constants value defined in the java.awt.event.KeyEvent class. […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing19 Oct 2010

How do I assign tool tips for JTabbedPane tabs?

To set a tool tips for JTabbedPane‘s tabs you need to pass the tool tips when adding a new tab to the JTabbedPane. The addTab() method accept the following parameters: the tab’s title, image icon, a component that is going to be the content of the tabs and a string of tool tips information. When […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing18 Oct 2010

How do I disable or enable tabs in JTabbedPane?

To enable or disable tabs in JTabbedPane you can use the JTabbedPane‘s setEnableAt(int index, boolean enable) method. The index is zero based, this means that the first tab is at index number 0. The enable parameter when set to true will enable the tab while setting to false will disable the tab. package org.kodejava.swing; import […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing18 Oct 2010

How do I set the colors of JTabbedPane tabs?

The example below demonstrates how to change the color of the tabs in JTabbedPane component. The JTabbedPane‘s methods that you can use the change foreground and background color are: setForeground(Color color) for changing the foreground color of all tabs. setBackground(Color color) for changing the background color of all tabs. setForegroundAt(int index, Color color) for changing […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing18 Oct 2010

How do I add disabled icon for JTabbedPane tabs?

When adding a tabs to JTabbedPane you can define the icon for the tabs. This icon will be displayed beside the tab’s title in enable or disable state of the tabs. To make the user interface better you can also define a disabled icon for the tab. This icon will be displayed when the state […]

Wayan · 2 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.