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.

BASIC / NOTES</>↗
Basic03 Oct 2010

How do I create a class in Java?

A class is a specification or blueprint from which individual objects are created. A class contains fields that represent the object’s states and methods that defines the operations that are possible on the objects of the class. The file name that contains the definition of a class is always the same as the public class […]

Wayan · 3 min read
SWING / NOTES</>↗
Swing03 Oct 2010

How do I reverse JSlider’s value-range?

On a normal JSlider the value range displayed left-to-right on a horizontal JSlider and bottom-to-top on vertical JSlider. To reverse the slider values from their normal order you can use the setInverted() method of the JSlider instance. Passing a true boolean value into this method call reverse the values order. package org.kodejava.swing; import javax.swing.*; import […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing03 Oct 2010

How do I create a JSlider with custom labels?

The JSlider‘s setLabelTable() method allows you to define a custom labels for the JSlider. The label table is a Hashtable that contains an Integer number as the keys and a JLabel component as their values. The integer keys correspond to the JSlider tick where the labels will be customized. package org.kodejava.swing; import javax.swing.*; import java.awt.*; […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing03 Oct 2010

How do I create a JSlider that snap to the closest tick mark?

The JSlider‘s setSnapToTicks() method call is used to move JSlider‘s knob to the nearest tick mark from where you positioned the knob. The default value of this property is false. To make it snap to the closest tick set this property to true. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class SnapToTickJSlider extends JPanel { […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic30 Sep 2010

How do I create custom exception class?

You can define your own exception class for your application specific purposes. The exception class is created by extending the java.lang.Exception class for checked exception or java.lang.RuntimeException for unchecked exception. By creating your own Exception classes, you could identify the problem more precisely. package org.kodejava.basic; public class CustomExceptionExample { public static void main(String[] args) { […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic30 Sep 2010

How do I use checked and unchecked exception?

By throwing a checked exception, you force the caller to handle the exception in a catch block. If a method throws a checked exception, it must declare that it throw the exception in the method declaration. All exceptions are checked exceptions, except for those indicated by java.lang.Error, java.lang.RuntimeException, and their subclasses. Runtime exception are exceptional […]

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.