SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

MAIL / NOTES</>↗
Mail31 Aug 2007

How do I send an email message?

To enable your application to send email you can use the JavaMail API, and prior to JDK 1.6 you will also need the JavaBeans Activation Framework. The JAF jar file should be included in your application classpath. package org.kodejava.mail; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import java.util.Properties; publi...

Wayan · 2 min read
SWING / NOTES</>↗
Swing26 Aug 2007

How do I right justified JTextField contents?

To right justified a JTextField contents we can call the setHorizontalAlignment(JTextField.RIGHT) method of the JTextField class. package org.kodejava.swing; import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.WindowConstants; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; public class TextFieldRightJustify extends JFrame { public TextFieldRightJustify() { initComponents(); } public...

Wayan · 1 min read
SWING / NOTES</>↗
Swing22 Aug 2007

How do I format JLabel using HTML?

JLabel text can be formatted using an HTML standard tags. The example below shows you how we can use and HTML font tag to change the font size, color and style of JLabel text. package org.kodejava.swing; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; import javax.swing.WindowConstants; import java.awt.Container; import java.awt.FlowLayout; public class JLabelHTMLStyle extends JFrame { public […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API21 Aug 2007

How do I get an exception stack trace message?

In this example we use the java.io.StringWriter and java.io.PrintWriter class to convert stack trace exception message to a string. package org.kodejava.io; import java.io.StringWriter; import java.io.PrintWriter; public class StackTraceToString { public static void main(String[] args) { try { int result = 10 / 0; } catch (Exception e) { // Create a StringWriter and a PrintWriter […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API21 Aug 2007

How do I read and write data in Windows registry?

The java.util.prefs package provides a way for applications to store and retrieve user and system preferences and data configuration. These preference data will be stored persistently in an implementation-dependent backing stored. For example in Windows operating system in will stored in Windows registry. To write and read these data we use the java.util.prefs.Preferences class. The […]

Wayan · 1 min read
SWING / NOTES</>↗
Swing19 Aug 2007

How do I display an image in JButton?

package org.kodejava.swing; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.WindowConstants; import java.awt.FlowLayout; public class ButtonImageExample extends JFrame { public ButtonImageExample() { initComponents(); } public static void main(String[] args) { SwingUtilities.invokeLater(() -> new ButtonImageExample().setVisible(true)); } private void initComponents() { setTitle("My Butt...

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