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

How do I create Border for swing component?

This example shows how we can create border for swing components. In the example below we set border of a JPanel component. Some border implementation that we use below including LineBorder, BevelBorder, EtchedBorder and MatteBorder. package org.kodejava.swing; import javax.swing.*; import javax.swing.border.LineBorder; import javax.swing.border.BevelBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.MatteBorder; import java.awt.*; public class BorderDe...

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

How do I create a ButtonGroup for radio buttons?

This example shows you how to create a ButtonGroup for grouping our radio buttons components into a single group. In this example you can also see that we add an action listener to the radio buttons. package org.kodejava.swing; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class ButtonGroupDemo extends JFrame { public ButtonGroupDemo() { […]

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

How do I create JRadioButton and define some action?

Below we create a JRadioButton and pass an action handle to the component so that we know when the component is clicked. package org.kodejava.swing; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; public class RadioButtonCreateAction extends JFrame { public RadioButtonCreateAction() { initializeUI(); } public static void main(String[] args) { SwingUtilities.invokeLater( () -> new RadioButtonCreateAction().setVisible(true)); } private void […]

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

How do I create a JRadioButton component?

This simple example shows you how to create a JRadioButton component. To create an instance of JRadioButton we can simply call its constructor and pass a string as the radio button text. We can also call the constructor with a boolean value after the text to indicate whether the radio button is selected or not. […]

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

How do I place swing component using absolute coordinates?

In this example you can see how we do an absolute positioning to a swing component in the content panel. In this example we use a JPanel as the container, and we didn’t set a layout manager into it. To position the component on the container we use the setBounds() method of the component. This […]

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

How do I arrange the swing component using GridLayout?

This example use the GridLayout to create a four by four grid layout. One each of the grid we place a JTextField component to read user inputs. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class GridLayoutDemo extends JFrame { public GridLayoutDemo() { initializeUI(); } public static void main(String[] args) { SwingUtilities.invokeLater(() -> new GridLayoutDemo().setVisible(true)); } […]

Wayan · 1 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.