Solved

Change Mouse Pointer in Applet

Posted on 1998-05-21
4
378 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now