View RSS Feed

Java AWT

Java Abstract Window Toolkit (AWT)

  1. Robot class Control functions

    by , 03-04-2012 at 11:46 AM
    Robot class uses these control functions:

    Mouse control functions

    void mouseMove(int x, int y):To coordinate (x,y), mouse cursor is moved by using this function. At screen’s top corner (left), coordinated are shown.
    Java Code:
    void mousePress(int buttons)
    void mouseRelease(int button)
    Button clicks are performed by this function pair. Input arguments are as following:
    java.awt.event.InputEvent.BUTTON1_MASK   // left mouse button 

    Updated 03-04-2012 at 12:07 PM by Java AWT

  2. How to use Robot class in Java?

    by , 03-04-2012 at 11:43 AM
    For controlling the keyboard or mouse, class java.awt.Robot will be used. Any kind of operation regarding mouse or keyboard can be performed once one has the control over mouse & keyboard. Usually such class type is used while doing test automation.

    Robot class which handles the keyboard events will be shown up by using this code. If this code is run, a notepad will be opened to write down “HI MY FRIEND”.
    Java Code:
    import java.awt.AWTException; 
    import java.awt.Robot;
  3. Robot Class

    by , 03-04-2012 at 11:42 AM
    In many applications, like self running demos or test automation, the Robot class is used. It is required in those circumstances where keyboard control as well as mouse is needed. “Native system” input events are generated by the class robot. The basic purpose is to facilitate the Java platform’s automated testing implementations.

    Generation of the input events by the Robot class is totally a separate thing as compared to the posting of the events to AWT components or event queue. ...
    Tags: robot class Add / Edit Tags
  4. System Tray Helpful Features

    by , 03-04-2012 at 11:40 AM
    • Method setImage() is used to show the changed status of an application in your program. Its syntax is as following: trayIcon.setImage(updatedImage);
    • Tooltip can be obtained or set for Traylcon. When mouse is at Traylcon, it will be shown. For an operating system, it gets displayed that is dependent at the time period.
    • trayIcon.setTooltip("I'm busy. Go away.");
    • For Traylcon, auto size property is present. Image is fitted as well as auto sized by it. By default, it’s set to false.
    Tray , Java AWT
  5. Implementing Tray Icons

    by , 03-04-2012 at 11:39 AM
    One or more than one instances could be added of java.awt.TrayIcon to the System Tray. Removal or addition methods are used to add/remove the Traylcons. Presentation of tray icon is basically the Traylcon which can be removed or added, from any SystemTray. The functionality of the Traylcon is more as compared to what has been shown in tray. Following can be present in it.

    1. AWT “popup menu”
    2. Set of listeners associated
    3. Text tooltip

    Many MouseEvenets are generated ...
    Tags: tray icons Add / Edit Tags
    Tray , Java AWT
  6. Accessing the System Tray

    by , 03-04-2012 at 11:37 AM
    System tray could be accessed by the Java. In Java, class java.awt.SystemTray presents the system tray, for desktop. The static method SystemTray.getSystemTray() calls the operating system’s System tray.
    SystemTray.isSupported() is used for checking whether it provides support, before its access. It throws in case if it doesn’t support or is not checked for support.

    1. Just one SystemTray’s instance is present in Java application.
    2. SystemTray’s
    Tags: system tray Add / Edit Tags
    Tray , Java AWT
  7. What Is the System Tray?

    by , 03-04-2012 at 11:35 AM
    At desktop’s bottom, a specific area named as “the system tray” exists. Operating system user always has the access to this area.

    1. Referred as system tray in KDE.
    2. In windows, it is also known as Taskbar Status area.
    3. It is known as notification area in case of a Gnome desktop.

    This area is accessed as well as shared all times in any operating system, by all applications.
    The given figure illustrates the system tray at Linux as well as MS ...
    Tags: system tray Add / Edit Tags
    Tray , Java AWT
  8. How to create a system tray for your application

    by , 12-09-2011 at 07:46 AM
    Since Java SE 6, programmers can add an icon for their applications in the system tray area of the operating system. A common usage scenario of the system tray is having a popup menu showing when users right click on the icon. The popup menu presents to users with common tasks that the application provides. When users double click on the icon, they will access the default action of the program. The screenshot below depicts a tray icon and popup menu of an application in the Taskbar notification ...

    Updated 12-09-2011 at 04:38 PM by Java AWT

    Tray , Java AWT
Page 3 of 3 FirstFirst 123