Home » Archives for Alvin Reyes » Page 3

Author Archives: Alvin Reyes

Alvin has an Information Technology Degree from Mapua Institute of Technology. During his studies, he was already heavily involved in a number of small to large projects where he primarily contributes by doing programming, analysis design. After graduating, he continued to do side projects on Mobile, Desktop and Web Applications.

JUnit assertTrue example

1. Introduction Every developer on every platform should always have a solid JUnit test case to secure the changes they made. This will minimise the potential risk of negativity to an existing system. There are a lot of ways to do JUnit Testing and a lot of functions available to do them. One of the most popular Unit Testing framework ...

Read More »

JScrollPane Swing example

1. Introduction In this post, I’ll be giving an example of using JScrollPane Swing component. This component is usually used to create a scroller on panels that has more content that it can display. It will let the user scroll up, down, left or right, depending on what and where is the content of the panel is being viewed. 2. ...

Read More »

JTextarea Swing example

1. Introduction In this post, I’ll be giving an example of using JTextArea Swing component. This component is usually used to create an input text that can get large strings of data. Large strings of data can be, xml, html, source code or even an entire metadata string. 2. The example For this example, we’ll be making a basic JTextArea ...

Read More »

Java Swing Radio Button Example

Introduction The radio button is a one of the core components that has been introduced ever since the early foundations of graphical user interface development. The very aspects of it is that it allows the user to select one value from a group of values. In this post, I’ll be walking you through how it’s easy to create a radio ...

Read More »

Java JPanel example

Introduction JPanel is basically a virtual container that can be used to group certain components to create a user interface for Java Desktop Application. It is usually being attached to a layout (for example: GridLayout) and have it act as a consolidator of components that sticks together to form a union of programmable user interface objects. For this post, I’ll ...

Read More »

JFileChooser Swing Example

The JFileChooser Component is used to create a cross platform directory explorer that can be used for a Java Desktop Application. For this blog post, I’ll showcase the how to use the component and call it from a Java class.       1. Import the necessary objects   We need to import the following objects on your java class. ...

Read More »

Spring 4 Autowire Example

1. Introduction Autowiring is method of creating an instance of an object and “by concept” injecting that instance on a specific class that uses it. By that, therefore creates a “wiring” of an instance to a class that will use it’s attributes. In Spring, when the application server initialize the context, it creates a stack/heaps of objects in it’s JVM ...

Read More »

JMenu Swing Example

1. Introduction A lot of IDEs supports dragging and dropping components to create a Java Desktop application, it’s always good to know by hand what is going on in the code to piece together the components. For this post, I’m going to show you step by step on how to create your own JMenu swing component.   2. Step by ...

Read More »

Java Try with Resources Example

1. Introduction Try-with-resources in Java 7 is a new exception handling mechanism that makes it easier to correctly close resources that are used within a try-catch block. 2. Whats covered in this blog post? Resource Management With Try-Catch-Finally, Old School StyleManaging resources that need to be explicitly closed is somewhat tedious before Java 7. printFile() method private static void printFile() ...

Read More »

Java 7 New IO API Example

1. Introduction Java NIO (New IO) is an alternative IO API for Java (from Java 1.4) – it was deemed to be the alternative standard to the Java IO and Java Networking API. Of course, there wouldn’t be a new one if it’s not for the benefits of using it. It does still has the basic file manipulation capabilities but ...

Read More »