SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

JSON-JAVA / NOTES</>↗
JSON-Java06 Feb 2022

How do I read values from JSONObject?

A JSONObject is an unordered collection of key-value pairs. To read values from the JSONObject we can use the get(String key) and opt(String key) methods. These generic methods return an Object, which you can cast to a certain type. There are also typed get and opt methods to read value in specific type such as […]

Wayan · 3 min read
JSON-JAVA / NOTES</>↗
JSON-Java05 Feb 2022

How do I convert Java Object to JSON?

To convert Java objects or POJOs (Plain Old Java Objects) to JSON we can use one of JSONObject constructor that takes an object as its argument. In the following example we will convert Student POJO into JSON string. Student class must provide the getter methods, JSONObject creates JSON string by calling these methods. In this […]

Wayan · 2 min read
JSON-JAVA / NOTES</>↗
JSON-Java05 Feb 2022

How do I create JSON from a Map?

In the previous example we use JSONObject to directly put key-value pairs to create JSON string, using the various put() methods. Instead of doing that, we can also create JSON from a Map object. We create a Map with some key-value pairs in it, and pass it as an argument when instantiating a JSONObject. These […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing13 Jan 2022

Filtering JList Component Models

Filter items in a long list are often accomplished using the JTextField component. As the user inputs into the JTextField component, the set of items shown in the list is narrowed to just those things that correspond to the input received from the user. It is necessary to utilize two elements to implement this function […]

roma.paybis · 10 min read
JSCH / NOTES</>↗
JSch04 Jan 2022

How do I connect to an SSH server using JSch?

To connect to an SSH server using JSch (Java Secure Channel), you need to perform the following steps: Steps to Connect to SSH Server Using JSch Add the JSch library to your project dependencies. If using Maven, add the following dependency: <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.55</version> </dependency> If not using a dependency manager, download jsch.jar and […]

Wayan · 4 min read
E-ICEBLUE SPIRE / NOTES</>↗
E-iceblue Spire16 Jun 2021

How do I mail merge Word document in Java?

The following example will show you how to use the E-iceblue‘s free Spire.Doc for Java to perform mail merge operations on MS Word documents. Create Maven Project and Add Dependencies Create a maven project and add the following dependencies and repositories in your project’s pom.xml file. <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/P...

Wayan · 3 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.