Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

BASIC / CATATAN</>
Basic28 Jun 2008

How do I mark method as @deprecated?

To mark a method as deprecated we can use the JavaDoc @deprecated tag. This is what we did since the beginning of Java. But when a new metadata support introduced to the Java language we can also use annotation. The annotation for marking method as deprecated is @Depreated. The difference between these two that the […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API24 Jun 2008

How do I programmatically compile Java class?

This example using the Java Compiler API introduced in JDK 1.6 to programmatically compile a Java class. Here we’ll compile the Hello.java. The process of compiling can be start by obtaining a JavaCompiler from the ToolProvider.getSystemJavaCompiler(). The simplest way to compile is by calling the run() method of the compiler and passing the first three […]

Wayan · 1 menit baca
BEANS / CATATAN</>
Beans24 Jun 2008

How do I list property names of a Bean?

package org.kodejava.bean; import java.io.Serializable; import java.beans.BeanInfo; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.beans.IntrospectionException; public class Fruit implements Serializable { private Long id; private String name; private String latinName; private double price; public Fruit() { } public static void main(String[] args) { try { BeanInfo bi = Introspector.getBeanInfo(Fruit.class); PropertyDescriptor[] pds = bi.getP...

Wayan · 1 menit baca
BEANS / CATATAN</>
Beans20 Jun 2008

How do I create an instance of a Bean?

package org.kodejava.bean; import java.io.Serializable; import java.io.IOException; import java.beans.Beans; public class TheBean implements Serializable { private Long id; private String name; public TheBean() { } public static void main(String[] args) { try { TheBean bean = (TheBean) Beans.instantiate( ClassLoader.getSystemClassLoader(), "org.kodejava.bean.TheBean"); bean.setId(1L); bean.setName("John"); System.out.println("The Bean = " + bean); } catch (IOException | Class...

Wayan · 1 menit baca
BEANS / CATATAN</>
Beans16 Jun 2008

How do I listen for a constrained property change?

The constrained property change is fired when a bean’s value is about to change. When a VetoableChangeListener veto the value change the bean’s value will be rolled-back to the previous value. In this example we have a constrained property called interest. package org.kodejava.bean; import java.beans.VetoableChangeSupport; import java.beans.PropertyVetoException; public class VetoBean { private double interest; private […]

Wayan · 2 menit baca
BEANS / CATATAN</>
Beans12 Jun 2008

How do I listen for bean’s property change event?

In this example we’ll listen to bean’s property change event. We create a small bean named MyBean, adds attributes and getter/setter. We want to know or to get notified when the bean property name is changed. First we need the add a PropertyChangeSupport field to the bean, with this object we will fire the property […]

Wayan · 2 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.