Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change Mouse Pointer in Applet

Posted on 1998-05-21
4
Medium Priority
?
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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 tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

721 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