CORE API / NOTES</>↗Core API30 Jun 2009
This example show you how to use the HelloAnnotation annotation on the previous example code, How do I create a simple annotation?. We add the HelloAnnotation annotation to our class and its methods. package org.kodejava.lang.annotation; @HelloAnnotation(value = "Good Morning", greetTo = "Universe") public class HelloAnnotationExample { public static void main(String[] args) { HelloAnnotationExample hello = […]
CORE API / NOTES</>↗Core API27 Jun 2009
Metadata is a way to add some supplement information to the source code. This information is called annotation will not change how the program runs. This metadata can be used by other tools such as source code generator for instance to generate additional code at the runtime. Or it will be used by a dependency […]
APACHE COMMONS / NOTES</>↗Apache Commons23 Jun 2009
This example demonstrate how to use PropertyUtils.setMappedProperty() method to modify a Map typed property value of a bean. To set the property we need to pass bean instance, property name, map key and map value to PropertyUtils.setMappedProperty() method. package org.kodejava.commons.beanutils; import org.apache.commons.beanutils.PropertyUtils; import org.kodejava.commons.beanutils.support.Track; import org.kodejava.commons.beanutils.support.Record; import java.util.HashMap...
APACHE COMMONS / NOTES</>↗Apache Commons20 Jun 2009
In this example we show how to set the value of an indexed property. In the code below we modified the value of an array type. We’ll change the second colors of MyBean‘s colors property. We do it in the same way as we are using the PropertyUtils.setSimpleProperty method. For indexed property we use the […]
APACHE COMMONS / NOTES</>↗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 / NOTES</>↗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. […]