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.

CORE API / CATATAN</>
Core API08 Sep 2010

How do I sort an array of string data using RuleBasedCollator class?

We can use the java.text.Collator class to sort strings in language-specific order. Using the java.text.Collator class makes the string not just sorted by the ASCII code of their characters, but it will follow the language natural order of the characters. If the predefined collation rules do not meet your needs, you can design your own […]

Wayan · 2 menit baca
SWING / CATATAN</>
Swing06 Sep 2010

How do I set the initial color of a JColorChooser?

To create an instance of a JColorChooser with a default or initial color such as Color.BLUE you can pass the Color object to the constructor of the JColorChooser component. The example below shows how to do it. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class JColorChooserDefaultColor extends JFrame { public JColorChooserDefaultColor() throws HeadlessException { initializeUI(); […]

Wayan · 1 menit baca
SWING / CATATAN</>
Swing05 Sep 2010

How do I get the selected color from JColorChooser?

To get the selected color from JColorChooser we need to create an implementation of the ChangeListener interface. This interface provides a single method call stateChanged(ChangeEvent e). The instance of this interface implementation need to be passed to JColorChooser by calling the JColorChooser.getSelectionModel().addChangeListener() method. In this example our ChangeListener implementation get the selected color and replace […]

Wayan · 2 menit baca
SWING / CATATAN</>
Swing01 Sep 2010

How do I use JColorChooser component?

The JColorChooser is a Swing component that provides a palette from where we can select a color code in RGB format. The JColorChooser component has two parts, the tabbed pane of color selection and a preview box. The tabbed has three tabs which allows us to select a color from a swatches, a HSB (Hue, […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API27 Agt 2010

How do I change the date format symbols for a specified locale?

package org.kodejava.text; import java.text.DateFormatSymbols; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class ChangeDateFormatSymbols { public static void main(String[] args) { Locale id = new Locale("in", "ID"); String pattern = "EEEE, dd MMM yyyy"; Date today = new Date(); // Gets formatted date specify by the given pattern for // Indonesian Locale no changes for default […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API25 Agt 2010

How do I get a formatted date for a specific pattern and locale?

If you want to change formatting styles provided by DateFormat, you can use SimpleDateFormat class. The SimpleDateFormat class is locale-sensitive. If you instantiate SimpleDateFormat without a Locale parameter, it will format the date and time according to the default Locale. Both the pattern and the Locale determine the format. For the same pattern, SimpleDateFormat may […]

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.