SWING / NOTES</>↗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 / NOTES</>↗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 / NOTES</>↗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 / NOTES</>↗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 […]
SPRING CORE / NOTES</>↗Spring Core21 Mar 2012
Bean scoping is how the bean is created and returned from the spring container to the bean requester. By default, the scope of all bean is singleton. The spring container will always return the same bean whenever this bean is required, for instance when in injected or call using the getBean() method from the application […]
SPRING CORE / NOTES</>↗Spring Core13 Mar 2012
This example show you how to create a bean using factory method in Spring Framework. We will use a singleton as an example. An instance of a singleton can be obtained only from a factory method because a singleton will have a private constructor, so it will not be possible to create an instance of […]