#navi(../)
*Cursorオブジェクトの生成 [#l60ded0f]
>編集者:[[Terai Atsuhiro>terai]]~
作成日:2005-01-24~
更新日:&lastmod;

#contents

**概要 [#c4de6873]
新しいカスタムカーソルオブジェクトを作成します。

#screenshot

**サンプルコード [#x837b7d6]
 BufferedImage bi2 = new BufferedImage(
                       32, 32, BufferedImage.TYPE_4BYTE_ABGR);
 Graphics2D g2d2 = bi2.createGraphics();
 g2d2.setPaint(Color.red);
 g2d2.drawOval(8, 8, 16, 16);
 g2d2.dispose();
 lbl2.setCursor(getToolkit().createCustomCursor(
                                bi2,new Point(16,16),"oval"));
 label2.setIcon(new ImageIcon(bi2));

-&jnlp;
-&jar;
-&zip;

**解説 [#k25e265f]
Toolkit#createCustomCursorメソッドでカーソルオブジェクトを作成します。上記のサンプルでは、32*32のバッファの中心に、直径16ptの円をかき、中心がカーソルのホットスポットとなるようなカーソルを作っています。

//**参考リンク
**コメント [#qecf5901]
#comment