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</>↗
Swing12 Jan 2010

How do I add background image in JTextPane?

The example below demonstrate how to create a custom JTextPane component that have a background image. package org.kodejava.swing; import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Objects; public class TextPaneWithBackgroundImage extends JFrame { public TextPaneWithBackgroundImage() { initUI(); } public static void main(String[] args) { SwingUtilities.invokeLater( () -> new...

Wayan · 2 min read
CORE API / NOTES</>↗
Core API10 Jan 2010

How do I sort string of numbers in ascending order?

In the following example we are going to sort a string containing the following numbers "2, 5, 9, 1, 10, 7, 4, 8" in ascending order, so we will get the result of "1, 2, 4, 5, 7, 8, 9, 10". package org.kodejava.util; import java.util.Arrays; public class SortStringNumber { public static void main(String[] args) { […]

Wayan · 2 min read
AWT / NOTES</>↗
AWT05 Jan 2010

How do I turn on the Scroll Lock button?

The program below show you how to turn on the Scroll Lock button programmatically. Setting the locking state to Boolean.TRUE activate the Scroll Lock. package org.kodejava.awt; import java.awt.*; import java.awt.event.KeyEvent; public class TurnScrollLockOn { public static void main(String[] args) { // Gets the default toolkit. Toolkit toolkit = Toolkit.getDefaultToolkit(); // Update the locking state for […]

Wayan · 1 min read
AWT / NOTES</>↗
AWT02 Jan 2010

How do I turn on the Num Lock button?

The example below show you how to activate the Num Lock button programmatically. Setting the locking state to Boolean.TRUE will turn the Num Lock on. package org.kodejava.awt; import java.awt.Toolkit; import java.awt.event.KeyEvent; public class TurnNumLockOn { public static void main(String[] args) { // Gets the default toolkit. Toolkit toolkit = Toolkit.getDefaultToolkit(); // Update the locking state […]

Wayan · 1 min read
AWT / NOTES</>↗
AWT28 Dec 2009

How do I turn on the Caps Lock button?

The code below show you how to activate the Caps Lock button programmatically. Setting the locking state to Boolean.TRUE will turn the Caps Lock on. package org.kodejava.awt; import java.awt.Toolkit; import java.awt.event.KeyEvent; public class TurnCapsLockOn { public static void main(String[] args) throws Exception { // Gets the default toolkit. Toolkit toolkit = Toolkit.getDefaultToolkit(); // Update the […]

Wayan · 1 min read
AWT / NOTES</>↗
AWT26 Dec 2009

How do I read the status of Scroll Lock key?

This example show you how to detect if the Scroll Lock key is in active mode. If you run the program you will get an output telling you that the Scroll Lock button is active or not active. package org.kodejava.awt; import java.awt.Toolkit; import java.awt.event.KeyEvent; public class ScrollLockState { public static void main(String[] args) { Toolkit […]

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.