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.

CORE API / NOTES</>↗
Core API13 Sep 2008

How do I display file contents in hexadecimal?

In this program we read the file contents byte by byte and then print the value in hexadecimal format. As an alternative to read a single byte we can read the file contents into array of bytes at once to process the file faster. package org.kodejava.io; import java.io.FileInputStream; public class HexDumpDemo { public static void […]

Wayan · 1 min read
SWING / NOTES</>↗
Swing11 Sep 2008

How do I use SwingWorker to perform background tasks?

This demo gives examples of using the SwingWorker class. The purpose of SwingWorker is to implement a background thread that you can use to perform time-consuming operations without affecting the performance of your program’s GUI. package org.kodejava.swing; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.WindowConstants; import java.awt.Dimension; impo...

Wayan · 2 min read
CORE API / NOTES</>↗
Core API11 Sep 2008

How do I know if a date is after another date?

This example demonstrate Date‘s class after() method to check if a date is later than another date. package org.kodejava.util; import java.util.Date; import java.util.Calendar; public class DateCompareAfter { public static void main(String[] args) { // Get current date Date today = new Date(); // Add 1 day from the current date. Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API10 Sep 2008

How do I know if a date is before another date?

This example demonstrate Date‘s class before() method to check if a date is earlier than another date. package org.kodejava.util; import java.util.Date; import java.util.Calendar; public class DateCompareBefore { public static void main(String[] args) { // Get current date Date today = new Date(); // Subtract 1 day from the current date. Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic10 Sep 2008

How do I create an inner class?

An inner class is a class defined inside another class. Inner classes can, in fact, be constructed in several contexts. An inner class defined as a member of a class can be instantiated anywhere in that class. An inner class defined inside a method can only be referred to later in the same method. Inner […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic06 Sep 2008

How do I clone an object?

To enable our object to be cloned we need to override Object class clone method. We can also add a java.lang.Cloneable interface to our class, this interface is an empty interface. When we call the clone() method we need the add a try-catch block to catch the CloneNotSupportedException. This exception will be thrown if we […]

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