Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

AWT / CATATAN</>
AWT28 Des 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 menit baca
AWT / CATATAN</>
AWT26 Des 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 menit baca
AWT / CATATAN</>
AWT25 Des 2009

How do I read the status of Num Lock key?

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

Wayan · 1 menit baca
AWT / CATATAN</>
AWT23 Des 2009

How do I read the status of Caps Lock key?

This example show you how to detect if the Caps Lock key is in active mode. package org.kodejava.awt; import java.awt.Toolkit; import java.awt.event.KeyEvent; public class CapsLockState { public static void main(String[] args) { // Get the locking state of the Caps Lock button. This method // return boolean true value if it is "on". boolean isOn […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API22 Des 2009

How do I read a file into byte array?

package org.kodejava.io; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; public class ReadFileIntoByteArray { public static void main(String[] args) throws IOException { File file = new File("README.md"); try (InputStream is = new FileInputStream(file)) { if (file.length() > Integer.MAX_VALUE) { throw new IOException("File is too large."); } int offset = 0; int bytesRead; byte[] bytes = […]

Wayan · 1 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons22 Des 2009

How do I generate a random alphanumeric string?

The code below show you how to use the Apache Commons-Lang RandomStringUtils class to generate some random string data. package org.kodejava.commons.lang; import org.apache.commons.lang3.RandomStringUtils; public class RandomStringUtilsDemo { public static void main(String[] args) { // Creates a 64-chars length random string of number. String result = RandomStringUtils.random(64, false, true); System.out.println("random = " + result); // Creates […]

Wayan · 2 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.