±Û¾´ÀÌ :À±°æ±¸ 2000³â 6¿ù 02ÀÏ 15:30:47
In Reply to: ¸¶¿ì½º Æ÷ÀÎÅ͸¦ ³»°¡ ¿øÇÏ´Â ¸ð¾çÀ¸·Î ¹Ù²Ù°í ½Í½À´Ï´Ù.. posted by ¹ÚÀç¿Ï on 2000³â 6¿ù 02ÀÏ 15:16:42:
Toolkit.createCustomCursor(Image, Point, String) throws IndexOutOfBoundsException À̶ó´Â ¸Þ¼Òµå°¡ JDK 1.2ºÎÅÍ Á¦°øµË´Ï´Ù.
°£´ÜÇÑ ¿¹Á¦ÀÔ´Ï´Ù.
import java.awt.*;
public class CustomCursorTest extends Frame {
public CustomCursorTest() {
setSize(100,100);
show();
Image image = this.createImage(30,30);
drawCursor(image.getGraphics());
Point point = new Point(0, 0);
String string = new String("myCursor");
Cursor cursor = this.getToolkit().createCustomCursor(image, point, string);
setCursor(cursor);
}
private void drawCursor(Graphics g){
g.setColor(new Color(0,255,0));
g.fillRect(0,0,30,30);
g.setColor(new Color(0,0,0));
g.drawLine(1,1,10,20);
g.drawLine(20,1,10,20);
}
public static void main(String[] args) {
new CustomCursorTest();
}
}