MAIL / NOTES</>↗Mail19 Jan 2014
The code snippet below show you how to create a simple Java Swing application that can be used to send an e-mail. The program allows user to supply the from email address, to email address, the subject and the message of the email. User need to select the available SMTP server to connect to and […]
MAIL / NOTES</>↗Mail17 Jan 2014
Here are a list of system properties that can be used to send an e-mail using the JavaMail API. Property Default Value Description mail.host Define the host name of the mail server. mail.smtp.host Define the host name of the SMTP server; this will overrides the mail.host for SMTP connections only. mail._protocol_.host Define the host name […]
MAIL / NOTES</>↗Mail16 Jan 2014
The following code snippets show you how to send an HTML e-mail. We begin by defining the e-mail information such as the from address, to address and the subject. The next step it to create a Properties that will be used to create a mail Session object. Having a Session object we can then create […]
CORE API / NOTES</>↗Core API18 Dec 2013
In the following post you will learn how to read last n characters from a file. The JDK 7 introduces a new SeekableByteChannel interface which allows its implementation to change the position and the size of the byte channel. One of its implementation is the FileChannel class (java.nio.channels.FileChannel). The FileChannel class make it possible to […]
BASIC / NOTES</>↗Basic19 Oct 2013
Summary: This tutorial is about Java Development Kit (JDK) Standard Edition installation guide. After reading and executing this tutorial you will be able to install the JDK and setting the basic configuration for running the Java compiler from the command line. You will also learn how to create, compile and run a simple Hello World […]
ZIP AND GZIP / NOTES</>↗Zip and GZIP27 Sep 2013
In this example you are going to learn how to zip or compress a directory recursively. The zip file format allows us to compress multiple files. We use the java.util.zip.ZipOutputStream to compress the file. Each entry in the zip file is represented by the java.util.zip.ZipEntry class. To compress a directory we must first get all […]