CORE API / CATATAN</>↗Core API12 Okt 2006
One of the common task related to a text file is to append or add some contents to the file. It’s really simple to do this in Java using a FileWriter class. This class has a constructor that accept a boolean parameter call append. By setting this value to true a new data will be […]
SWING / CATATAN</>↗Swing09 Okt 2006
Using the following code snippet you can change the shape of mouse cursor in your Java Swing desktop application. The cursor is represented by the java.awt.Cursor class. Create an instance of Cursor using the new operator and pass the cursor type to the Cursor class constructor. We can change Swing’s objects (JLabel, JTextArea, JButton, etc) […]
BASIC / CATATAN</>↗Basic04 Okt 2006
At the time you decided to start to learn Java Programming you can start by downloading the Java Development Kit (JDK) from Java Download website. There are three different types of JDK, the Java SE (Java Standard Edition), Java EE (Java Enterprise Edition), Java ME (Java Mobile Edition). From the website you can also download […]
JDBC / CATATAN</>↗JDBC03 Okt 2006
In this example we are showing you how to delete a record from table in the database. We use a standard JDBC library for this purpose. For the database we use MySQL, you can use any type of database you want. All you need to do is to find the JDBC driver for the database […]
CORE API / CATATAN</>↗Core API30 Sep 2006
Below is an example code that reverse a string. In this example we use StringBuffer.reverse() method to reverse a string. In Java 1.5, a new class called StringBuilder also has a reverse() method that do just the same, one of the difference is StringBuffer class is synchronized while StringBuilder class is not. And here is […]
CORE API / CATATAN</>↗Core API25 Sep 2006
Here we have a small class that convert a string literal into an array, a character array. To do this we can simply use String.toCharArray() method. package org.kodejava.lang; public class StringToArrayExample { public static void main(String[] args) { // We have a string literal that contains the tag line of this blog. String literal = […]