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.

AWT / NOTES</>↗
AWT19 Apr 2010

How do I edit a file using the default registered application?

For editing a file using the default registered or associated application we can do a call to the java.awt.Desktop.edit(File) method. In the code snippet below we will edit a PNG file. Using the edit() method of the Desktop class will open the default registered application for PNG files. For example on Windows there could be […]

Wayan · 1 min read
AWT / NOTES</>↗
AWT16 Apr 2010

How do I open a file using the default registered application?

If you want to open a file using the default registered or associated application for those files you can use the Desktop.open(File file) method call. In the example below we’ll ask the Desktop class to open a text file. package org.kodejava.awt; import java.awt.*; import java.io.File; import java.io.IOException; public class RunningDefaultAppOpen { public static void main(String[] […]

Wayan · 1 min read
AWT / NOTES</>↗
AWT15 Apr 2010

How do I launch user-default mail client application?

Here is an example using the java.awt.Desktop class to open user’s default mail client application. There are two methods provided, the mail() and the mail(URI uri) methods. When specifying the URI to the application will be opened with the message field filled with the mailto information. You can refer to the following document for the […]

Wayan · 1 min read
AWT / NOTES</>↗
AWT14 Apr 2010

How do I launch user-default web browser?

The code below show you how to browse a website using the user’s default web browser. To get the default web browser you can use the Desktop class browse(URI uri) method call. package org.kodejava.awt; import java.awt.Desktop; import java.io.IOException; import java.net.URI; public class RunningDefaultBrowser { public static void main(String[] args) { URI uri = URI.create("https://kodejava.org"); try […]

Wayan · 1 min read
APPLET / NOTES</>↗
Applet10 Apr 2010

How do I get and display an image in Applet?

To display an image in an applet we first need to obtain the image object itself. A call to applet’s getImage(URL url, String name) method help us to create an image object from the specified URL of the image. For displaying the image on the applet’s screen we draw it in the paint() method using […]

Wayan · 1 min read
APPLET / NOTES</>↗
Applet05 Apr 2010

How do I get Applet’s document URL?

The code snippet below show you how to get the URL of the document (HTML, JSP, etc.) where the Applet is embedded. To obtain this document URL we use the getDocumentBase() method call provided by the Applet class. In the paint() method below we use the getDocumentBase() to create a URL as a link to […]

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.