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</>↗
Swing18 Sep 2010

How do I create a simple JTable component?

The code snippet presented below shows you how to create a simple JTable component in a swing application. To create a JTable component we initialize it using the constructor that accept two parameters. The first parameter is the table’s row of data which type is Object[][], a two-dimensional array of Object. The second parameter is […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API18 Sep 2010

How do I break a paragraph into sentences?

This example show you how to use the BreakIterator.getSentenceInstance() to breaks a paragraphs into sentences that composes the paragraph. To get the BreakIterator instance we call the getSentenceInstance() factory method and passes a locale information. In the count(BreakIterator bi, String source) method we iterate the break to extract sentences that composes the paragraph which value […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API15 Sep 2010

How do I break a text or sentence into words?

At first, it might look simple. We can just split the text using the String.split(), the word is split using space. But what if a word ends with questions marks (?) or exclamation marks (!) instead? There might be some other rules that we also need to care. Using the java.text.BreakIterator makes it much simpler. […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API12 Sep 2010

How do I sort strings data using CollationKey class?

When the strings must be compared multiple times, for example when sorting a list of strings. It’s more efficient to use CollationKey class. Using CollationKey to compare strings is generally faster than using Collator.compare(). You can not create CollationKey directly. Rather, generate them by calling Collator.getCollationKey() method. You can only compare CollationKey generated from the […]

Wayan · 2 min read
CORE API / NOTES</>↗
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 min read
SWING / NOTES</>↗
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 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.