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 API30 Sep 2010

How do I convert raw IP address to String?

This example show you how to convert a raw IP address, an array of byte, returned by InetAddress.getAddress() method call to its string representation. package org.kodejava.net; import java.net.InetAddress; import java.net.UnknownHostException; public class RawIPToString { public static void main(String[] args) { byte[] ip = new byte[0]; try { InetAddress address = InetAddress.getLocalHost(); ip = address.getAddress(); } […]

Wayan · 1 min read
SWING / NOTES</>↗
Swing28 Sep 2010

How do I create a vertical JSlider?

To create a vertical JSlider set the orientation on the JSlider‘s constructor to JSlider.VERTICAL. If you do not pass JSlider.VERTICAL as a constructor parameter use the setOrientation() method instead. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class JSliderVertical extends JPanel { public JSliderVertical() { initializeUI(); } public static void showFrame() { JPanel panel = new […]

Wayan · 1 min read
SWING / NOTES</>↗
Swing28 Sep 2010

How do I use a JSlider component?

This simple example show you how to use the JSlider component. A JSlider component is intended to let the user easily enter a numeric value bounded by a minimum and maximum value. There are a couples properties that you need to set when creating a JSlider. These include setting setMinorTickSpacing(), setMajorTickSpacing(), setPaintTicks() and setPaintLabels(). These […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing27 Sep 2010

How do I create a scrollable JTable component?

To create a scrollable JTable component we have to use a JScrollPane as the container of the JTable. Besides, that we also need to set the table auto resize mode to JTable.AUTO_RESIZE_OFF so that a horizontal scroll bar displayed by the scroll pane when needed. If we do not turn off the auto resize mode, […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic26 Sep 2010

How do I throw exceptions in Java?

The exceptions that you catch in a try-catch block must have been raised by a method that you’ve called. You can raise an exception with a statement that consists of the throw keyword, followed by an exception object. This exception object is an instance of any subclass of the Throwable class. In the example below […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic25 Sep 2010

How do I catch multiple exceptions?

If a try block can throw several kind of exceptions, and you want to handle each exception differently, you can put several catch blocks to handle it. package org.kodejava.basic; public class MultipleCatchExample { public static void main(String[] args) { int[] numbers1 = {1, 2, 3, 4, 5}; int[] numbers2 = {1, 2, 3, 4, 5, […]

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.