Solved

Change Mouse Pointer in Applet

Posted on 1998-05-21
4
384 Views
Last Modified: 2008-03-03
Anyone knows how to change the mouse pointer in a Java Applet using JDK 1.0? (Using 1.1 is easy).
0
Comment
Question by:pengch
  • 2
4 Comments
 
LVL 4

Expert Comment

by:evijay
ID: 1221324
Frame has a method setCursor in 1.0.2 which you can use to set the cursor for given frame.
              Your applet should create a frame and set its cursor.

              Applet doesnt have any method to set the cursor  in 1.0.2 !!

              Vijay







0
 

Author Comment

by:pengch
ID: 1221325
I want to change the mouse pointer winthin the applet area, not in a frame.
0
 
LVL 2

Accepted Solution

by:
anguslai earned 100 total points
ID: 1221326
the function setCursor() is belongs to Frame Object. In Java Applet, We have to get a
instance of frame object by using getParent() (One of your applet's parent is Frame in an applet), then call the setCursor() as following:
----------------------------------------------------------------------------------------
Object theFrame=null;
   
theFrame=getParent();

 while(!(theFrame instanceof Frame) && theFrame!=null) {
       theFrame=((Component)theFrame).getParent();
 }

if (theFrame!=null) {
           ((Frame)theFrame).setCursor(Frame.HAND_CURSOR);
}
0
 

Author Comment

by:pengch
ID: 1221327
Thanks, that works!!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 64
Configure a Bean in an XML file 4 42
servlet and mdb, jms error 1 38
Notify sent to other threads in Java 9 34
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question