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.

SWING / CATATAN</>
Swing27 Okt 2010

How do I set and get the contents of JTextArea?

To set and get the contents of a JTextArea you can use the setText(String text) and getText() methods. In the code below we create a JTextArea and sets its contents after we create a new instance of JTextArea. To get the contents we use the action on a button. When the button is pressed the […]

Wayan · 2 menit baca
SWING / CATATAN</>
Swing27 Okt 2010

How do I set the tab size in JTextArea?

In this example you will be shown how to set or change the tab size for the JTextArea component. You can use the setTabSize(int size) to define the tab size. For this demo we create a combo box that have some integer values which will be used to define the tab size. When you change […]

Wayan · 2 menit baca
BASIC / CATATAN</>
Basic26 Okt 2010

How do I use the || operator in Java?

The || operator or conditional OR operator operates on two boolean expressions. This operator exhibit “short-circuiting” behavior, which means that the second operand is evaluated only if needed. The || operator evaluate only boolean values. For an OR (||) expression it will return true if either of the operand is true. If the first operand […]

Wayan · 1 menit baca
BASIC / CATATAN</>
Basic26 Okt 2010

How do I use the boolean negation (!) operator in Java?

The ! operator is a logical compliment operator. The operator inverts the value of a boolean expression. package org.kodejava.basic; public class NegationOperator { public static void main(String[] args) { // negate the result of boolean expressions boolean negate = !(2 < 3); boolean value = !false; System.out.println("result: " + negate); System.out.println("value : " + value); […]

Wayan · 1 menit baca
SWING / CATATAN</>
Swing26 Okt 2010

How do I wrap the text lines in JTextArea?

To wrap the lines of JTextArea we need to call the setLineWrap(boolean wrap) method and pass a true boolean value as the parameter. The setWrapStyleWord(boolean word) method wrap the lines at word boundaries when we set it to true. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class TextAreaWrapDemo extends JPanel { public TextAreaWrapDemo() { initializeUI(); […]

Wayan · 2 menit baca
REGEX / CATATAN</>
Regex26 Okt 2010

How do I match a regex pattern in case-insensitive?

Finding the next subsequence of the input sequence that matches the pattern while ignoring the case of the string in regular expression can simply apply by create a pattern using compile(String regex, int flags) method and specifies a second argument with PATTERN.CASE_INSENSITIVE constant. package org.kodejava.regex; import java.util.regex.Pattern; import java.util.regex.Matcher; public class RegexIgnoreCaseDemo { public static […]

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