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</>
AWT09 Mei 2009

How do I get the location of mouse pointer?

MouseInfo provides methods for getting information about the mouse, such as mouse pointer location and the number of mouse buttons. package org.kodejava.awt; import java.awt.*; public class MouseInfoDemo { public static void main(String[] args) { int i = 0; while (i < 10) { // Get the location of our mouse x and y coordinate using […]

Wayan · 1 menit baca
AWT / CATATAN</>
AWT17 Apr 2009

How do I get screen’s display mode information?

This example shows graphics devices display mode information such as the display width, height, refresh-rate and bit-depth. This information can be obtained from GraphicsDevice.getDisplayMode() method which return an instance of java.awt.DisplayMode. We can also get the size of a screen using the following example How do I get my screen size?, but this example can […]

Wayan · 1 menit baca
AWT / CATATAN</>
AWT14 Apr 2009

How do I get number of available screens?

This code shows how to get number of available screen devices on the local machine or local graphics environment. We obtain the number of screens by getting the length of array returned by GraphicsEnvironment.getScreenDevices() method. This process can produce a HeadlessException to happen if we try to run this code on a machine that doesn’t […]

Wayan · 1 menit baca
AWT / CATATAN</>
AWT06 Feb 2008

How do I create mouse event using Robot class?

In this example we are automating the process of creating mouse event using the java.awt.Robot class. package org.kodejava.awt; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.InputEvent; public class MovingMouseDemo { public static void main(String[] args) { try { Robot robot = new Robot(); // Move mouse cursor to 200, 500 robot.mouseMove(200, 500); // Press the mouse button […]

Wayan · 1 menit baca
AWT / CATATAN</>
AWT05 Feb 2008

How do I get the color of a screen pixel?

The example here show us how to get the color of a pixel in the screen. We use the Robot.getPixelColor(int x, int y) method to obtain the Color of the pixel. package org.kodejava.awt; import java.awt.Color; import java.awt.Robot; import java.awt.AWTException; public class ColorPickerDemo { public static void main(String[] args) { try { Robot robot = new […]

Wayan · 1 menit baca
AWT / CATATAN</>
AWT04 Feb 2008

How do I create key press event using Robot class?

In this example we use the java.awt.Robot class to generate a key press event. We can call the keyPress(int keyCode) method to produce this event. package org.kodejava.awt; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; public class CreatingKeyboardEvent { public static void main(String[] args) { try { Robot robot = new Robot(); // Create a three seconds […]

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.