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.

CORE API / NOTES</>↗
Core API29 Apr 2006

How do I get path / classpath separator?

OS platform has a different symbol used for path separator. Path separator is a symbol that separate one path element from the other. In Windows the path separator is a semicolon symbol (;), you have something like: .;something.jar;D:/libs/commons.jar While in Linux based operating systems the path separator is a colon symbol (:), it looks like: […]

Wayan · 1 min read
SWING / NOTES</>↗
Swing27 Apr 2006

How do I make a centered JFrame?

If you have a JFrame in your Java Swing application and want to center its position on the screen you can use the following code snippets. The first way is to utilize java.awt.Toolkit class to get the screen size. The getScreenSize() method return a java.awt.Dimension from where we can get the width and height of […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API23 Apr 2006

How do I get environment variables?

Environment variables are a set of dynamic values that can affect a running process, such as our Java program. Each process usually have their own copy of these variables. Now we would like to obtain the available variables in our environment or operating system, how do I do this in Java? Here is a code […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC20 Apr 2006

How do I insert a record into database table?

In this example you’ll learn how to create a program to insert data into a database table. To insert a data we need to get connected to a database. After a connection is obtained you can create a java.sql.Statement object from it, and using this object we can execute some query strings. package org.kodejava.jdbc; import […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC15 Apr 2006

How do I create a connection to database?

This post is about an example for obtaining a connection to MySQL database. For connecting to other database all you have to do is change the url to match to url format for a particular database and of course you have to register a correct JDBC driver of the database you are using. Here are […]

Wayan · 3 min read
AWT / NOTES</>↗
AWT11 Apr 2006

How do I create a beep sound?

package org.kodejava.awt; import java.awt.*; public class BeepExample { public static void main(String[] args) { // This is the way we can send a beep audio out. Toolkit.getDefaultToolkit().beep(); } } Using Runtime.exec() method we can do something like the code snippet below to produce beep sound using powershell command. try { Process process = Runtime.getRuntime().exec( new […]

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.