SPRING CORE / CATATAN</>↗Spring Core01 Apr 2012
In the other example, How do I initialize and destroy beans in Spring? you can see how to initialize and destroy a bean using the Spring configuration init-method and destroy-method. In the following example you’ll see how to achieve the same thing using the Spring API. In this case our class need to implements the […]
SWING / CATATAN</>↗Swing23 Mar 2012
The following example demonstrate how to disable some keys in JTextArea and JScrollPane using the InputMap. In the disableKeys() method below we disable the arrow keys including the UP, DOWN, LEFT and RIGHT. Let’s see the code snippet below: package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class TextAreaDisableKeyDemo extends JFrame { public TextAreaDisableKeyDemo() { initialize(); […]
SWING / CATATAN</>↗Swing23 Mar 2012
The following example will show you how to create a single line JTextArea. A single line means that you cannot insert a new line in the text area. When pressing the enter key it will be replaced by a space. This can be done by putting a property called filterNewlines and set its value to […]
SWING / CATATAN</>↗Swing23 Mar 2012
The default behavior when pressing the tabular key in a JTextArea is to insert a tab spaces in the text area. In this example you’ll see how to change this to make the tab key to transfer focus to other component forward or backward. The main routine can be found in the key listener section. […]
SPRING CORE / CATATAN</>↗Spring Core22 Mar 2012
When creating an instance of a bean you might need to do some initialization to the bean. Likewise, when the bean is no longer needed and removed from the Spring container you might want to do some cleanup routine or destroy the bean. To do this initialization and destroy routine you can use the init-method […]
SWING / CATATAN</>↗Swing22 Mar 2012
Using the read(Reader in, Object desc) method inherited from the JTextComponent allow us to populate a JTextArea with text content from a file. This example will show you how to do it. In this example we use an InputStreamReader to read a file from our application resource. You could use other Reader implementation such as […]