Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

AWT / CATATAN</>
AWT19 Apr 2010

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

The example code below shows you how to print a file using the default registered application’s print command for the corresponding file type. As an example, on Windows notepad.exe is the default application for printing a .txt file. To print a file using the default registered application we call the java.awt.Desktop.print(File) method. The print() method […]

Wayan · 1 menit baca
AWT / CATATAN</>
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 menit baca
AWT / CATATAN</>
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 menit baca
AWT / CATATAN</>
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 menit baca
AWT / CATATAN</>
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 menit baca
AWT / CATATAN</>
AWT05 Jan 2010

How do I turn on the Scroll Lock button?

The program below show you how to turn on the Scroll Lock button programmatically. Setting the locking state to Boolean.TRUE activate the Scroll Lock. package org.kodejava.awt; import java.awt.*; import java.awt.event.KeyEvent; public class TurnScrollLockOn { public static void main(String[] args) { // Gets the default toolkit. Toolkit toolkit = Toolkit.getDefaultToolkit(); // Update the locking state for […]

Wayan · 1 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.