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</>↗
Swing13 Jan 2009

How do I arrange the swing component using FlowLayout?

In this example you can see how to arrange the swing components using the FlowLayout manager. This manager arranges the component in a directional flow based on the container component orientation such as ComponentOrientation.LEFT_TO_RIGHT and ComponentOrientation.RIGHT_TO_LEFT. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class FlowLayoutExample extends JFrame { public FlowLayoutExample() { initialize(); } public static […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing10 Jan 2009

How do I arrange the swing component using BoxLayout?

This example demonstrate how we can arrange component in row or column order using the BoxLayout layout manager. Instead of use the BoxLayout manager we can also use the Box component as our content pane to get the same effect as using the BoxLayout manager. package org.kodejava.swing; import javax.swing.*; public class BoxLayoutDemo extends JFrame { […]

Wayan · 1 min read
SWING / NOTES</>↗
Swing08 Jan 2009

How do I determine if the menu of JComboBox is displayed?

This example show how to create an implementation of PopupMenuListener for listening to when the JComboBox menu is visible, invisible or cancelled. package org.kodejava.swing; import javax.swing.*; import javax.swing.event.PopupMenuListener; import javax.swing.event.PopupMenuEvent; import java.awt.*; public class ComboBoxPopupMenuListener extends JFrame { public ComboBoxPopupMenuListener() { initialize(); } public static void main(String[] args) { SwingUtilities.invokeLater(...

Wayan · 1 min read
SWING / NOTES</>↗
Swing03 Jan 2009

How do I add an action listener to JComboBox?

The code below shows you how to add an ActionListener to a JComboBox component. In the snippet we add a listener by calling the addActionListener() method and give an instance of ActionListener listener as an anonymous class (a class without a specified name) as the parameter. The ActionListener interface contract said that we must implement […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing31 Dec 2008

How do I listen for changes to the selected item in JComboBox?

This example demonstrates the ItemListener to listen for changes to the selected item in the JComboBox component. package org.kodejava.swing; import javax.swing.*; import javax.swing.border.BevelBorder; import java.awt.event.ItemEvent; import java.awt.*; public class ComboBoxSelectionChange extends JFrame { public ComboBoxSelectionChange() { initialize(); } public static void main(String[] args) { SwingUtilities.invokeLater( () -> new ComboBoxSelectionChange().setVisible(true...

Wayan · 2 min read
SWING / NOTES</>↗
Swing28 Dec 2008

How do I change the number of visible items in JComboBox?

In this example you’ll see how we can change the default number of visible items in the combo box. By default, it only shows eight items at once and when the combo box has more items a scrollbar will be shown, so we can scroll up and down in the combo box list. If we […]

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.