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 API17 Des 2009

How do I sort a java.util.Enumeration?

In this code snippet you will see how to sort the content of an Enumeration object. We start by creating a random numbers and stored it in a Vector. We use these numbers and create a Enumeration object by calling Vector‘s elements() method. We convert it to java.util.List and then sort the content of the […]

Wayan · 2 menit baca
SPRING JDBC / CATATAN</>
Spring JDBC15 Des 2009

How do I insert a new record into a database using JdbcTemplate?

The following example show you how to use the Spring’s JdbcTemplate class to insert a record into database. package org.kodejava.spring.jdbc; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; import javax.sql.DataSource; import java.sql.Types; import java.util.Date; public class InsertDemo { private static final String INSERT_QUERY = """ INSERT INTO record (title, release_date, artist_id, label_id, created)...

Wayan · 2 menit baca
SPRING JDBC / CATATAN</>
Spring JDBC15 Des 2009

How do I create a Data Source object for JdbcTemplate?

In this example you will learn how to create and configure a DriverManagerDataSource object that will be used by the JdbcTemplate object. There are some information required when creating a DataSource including the JDBC driver class, the JDBC Url of the target database, the username and password for connecting to database server. package org.kodejava.spring.jdbc; import […]

Wayan · 2 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons11 Des 2009

How do I read a file into byte array using Apache Commons IO?

The following example shows you how to read file contents into byte array. We use the IOUtils class of the Apache Commons IO library. package org.kodejava.commons.io; import org.apache.commons.io.IOUtils; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; public class FileToByteArray { public static void main(String[] args) { File file = new File("README.md"); try { InputStream is […]

Wayan · 1 menit baca
SWING / CATATAN</>
Swing07 Des 2009

How do I create JTree with different icons for each node?

The example below demonstrates you how to create a JTree that have a different icons for each node of the tree. package org.kodejava.swing; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeCellRenderer; import java.awt.*; import java.net.URL; public class JTreeDifferentNodeIcon extends JFrame { public JTreeDifferentNodeIcon() throws HeadlessException { initializeUI(); } public static void main(String[] args) { SwingUtilities.in...

Wayan · 3 menit baca
SWING / CATATAN</>
Swing04 Des 2009

How do I expand or collapse all JTree nodes?

This example demonstrates how to use the expand-all and / or collapse-all features in the java.swing.JTree swing component. package org.kodejava.swing; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath; import javax.swing.tree.TreeNode; import java.awt.*; import java.util.Enumeration; public class JTreeNodeAutoExpandCollapse extends JFrame { public JTreeNodeAutoExpandCollapse() throws HeadlessException { initializeUI(); } p...

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.