|
||||||
| Java Tutorials Tutorials and Code for Java |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
This is more of a sample than a tutorial. I will provide you with the code to create a custom cursor, and explain the funtions used by refrencing the Java Documentation.
Note, for this to work you need an image called cursor.gif in the same directory as your compiled file. Lets start with the code, and work backwards: Java5 Code:
For now i will focus on the codeblock wich makes the custom cursor possible: Java5 Code:
-- Line 1 Lets start with the Toolkit: Toolkit (Java 2 Platform SE v1.4.2) And look at the getDefaultToolkit function: Toolkit (Java 2 Platform SE v1.4.2)) -- Line 2 The image class: Image (Java 2 Platform SE v1.4.2) And the toolkits get image function: Toolkit (Java 2 Platform SE v1.4.2)) -- Line 3 The point class: Java 2 Platform SE v1.3.1: Class Point -- Line 4 The cursor class: Java 2 Platform SE v1.3.1: Class Cursor The create custom cursor function: Toolkit (Java 2 Platform SE v1.4.2)) -- Line 5 This is self explanatory. Note you do not have to use a JFrame. You could set custom cursors for JButtons, ect...
__________________
Quote:
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| questions about java games | stack | Java Help | 3 | 07-02-2007 05:35 PM |
| MS-SQL deadlock and hang the Java application | reachpradeep | Database & Database Programming | 1 | 03-11-2007 04:20 AM |
| Java Facts | techni68 | Java Help | 0 | 01-17-2007 01:41 PM |
| John's Java Tutorial Index | John | Java Tutorials | 0 | 01-11-2007 03:05 PM |
| Java Help Files | xXHalfSliceXx | Java Help | 3 | 11-28-2006 11:30 PM |