APACHE COMMONS / CATATAN</>↗Apache Commons15 Jun 2009
The Commons BeanUtils component provides a class called PropertyUtils that supplies method for manipulating a bean such as our Track class below. For this demo we use a Track class that have a property called id, title and duration. To set the value of a bean we can use the PropertyUtils.setProperty() method. This method ask […]
SWING / CATATAN</>↗Swing11 Jun 2009
This example shows you how to create a JSpinner that allow you to select an hour value. As the spinner model we are using the SpinnerDateModel and set the calendar field to Calendar.HOUR_OF_DAY. To correctly display the hour value on the spinner we also change the formatter of the spinner’s text field using SimpleDateFormatter class. […]
SWING / CATATAN</>↗Swing06 Jun 2009
The SpinnerDateModel allow us to display and select date information from the JSpinner component. By default, the initial value of the model will be set to the current date. To change it we can call the setValue method of the JSpinner object. package org.kodejava.swing; import javax.swing.*; import java.awt.*; import java.util.GregorianCalendar; import java.util.Calendar; public class JSpinnerDate […]
SWING / CATATAN</>↗Swing03 Jun 2009
This example show you how to create a JSpinner component and pass a SpinnerListModel as the available values of the JSpinner component. The SpinnerListModel can hold a value of collections object and a simple array of object instance. package org.kodejava.swing; import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class JSpinnerCreateDemo extends JFrame { public […]
SWING / CATATAN</>↗Swing31 Mei 2009
JSpinner is a single line input field with two buttons (arrow up and arrow down) that allow us to select a value like number or object from a sequence value. It looks like a combobox without a drop-down. In the following example we create the default JSpinner that will give us a spinner to select […]
JDOM / CATATAN</>↗JDOM31 Mei 2009
The following example demonstrates how to read mixed content of an xml element. A mixed content can have more than one type of content such as text (Text), comment (Comment), CDATA (CDATA) or some child elements (Element). You also see that we can remove the mixed content from the element by calling the remove method […]