BASIC / CATATAN</>↗Basic13 Okt 2010
To implement an interface, a java class must use implements keyword on its class definition. For example, class A implements interface B. The class definition of class A would look like this: class A implements B { } A class can implements more than one interfaces. For example, class A can implements interface B and […]
BASIC / CATATAN</>↗Basic12 Okt 2010
Inheritance is one of object-oriented programming concepts. This concept allows classes to inherit commonly used state and behavior from other classes. Inheritance is the way to put commonly used states and behaviors into one class and reuse it. The class that inherits all the attributes from other class is called as sub class. While, the […]
BASIC / CATATAN</>↗Basic03 Okt 2010
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 […]
SWING / CATATAN</>↗Swing03 Okt 2010
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 […]
SWING / CATATAN</>↗Swing03 Okt 2010
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.*; […]
SWING / CATATAN</>↗Swing03 Okt 2010
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 { […]