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.

SWING / NOTES</>↗
Swing06 Jun 2009

How do I create JSpinner component with date value?

The SpinnerDateModel allow us to display and select date information from the JSpinner component. By default, the initial value of the model will be set to the current date. To change it we can call the setValue method of the JSpinner object. package org.kodejava.swing; import javax.swing.*; import java.awt.*; import java.util.GregorianCalendar; import java.util.Calendar; public class JSpinnerDate […]

Wayan · 1 min read
SWING / NOTES</>↗
Swing03 Jun 2009

How do I create a JSpinner with a SpinnerListModel?

This example show you how to create a JSpinner component and pass a SpinnerListModel as the available values of the JSpinner component. The SpinnerListModel can hold a value of collections object and a simple array of object instance. package org.kodejava.swing; import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class JSpinnerCreateDemo extends JFrame { public […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing31 May 2009

How do I create a JSpinner component?

JSpinner is a single line input field with two buttons (arrow up and arrow down) that allow us to select a value like number or object from a sequence value. It looks like a combobox without a drop-down. In the following example we create the default JSpinner that will give us a spinner to select […]

Wayan · 1 min read
JDOM / NOTES</>↗
JDOM31 May 2009

How do I get mixed content of an XML element in JDOM?

The following example demonstrates how to read mixed content of an xml element. A mixed content can have more than one type of content such as text (Text), comment (Comment), CDATA (CDATA) or some child elements (Element). You also see that we can remove the mixed content from the element by calling the remove method […]

Wayan · 3 min read
JDOM / NOTES</>↗
JDOM29 May 2009

How do I build XML CDATA sections in JDOM?

This example demonstrates how to add CDATA section into an xml document. A CDATA section indicates a block that shouldn’t be parsed. To build a CDATA section just wrap the string with a CDATA object. package org.kodejava.jdom; import org.jdom2.CDATA; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.JDOMException; import org.jdom2.input.SAXBuilder; import org.jdom2.output.Format; import org.jdom2.output.XMLOutputter; import java.io.IOException; import java...

Wayan · 2 min read
JDOM / NOTES</>↗
JDOM28 May 2009

How do I set XML element’s text content in JDOM?

This example show you how so set text content of XML element. Using JDOM we can easily insert text such as HTML tags without worrying about escaping the tags. JDOM will automatically do this conversion. package org.kodejava.jdom; import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.JDOMException; import org.jdom2.input.SAXBuilder; import org.jdom2.output.Format; import org.jdom2.output.XMLOutputter; import java.io.IOException; import java.io.StringReader; pub...

Wayan · 2 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.