y‰SŽÒzJavaŽ¿–⥑ ..
[2ch|¥Menu]
208:189
07/05/06 22:07:18
>>207
‚±‚¤‚Å‚µ‚傤‚©H

synchronized public void mouseDragged(MouseEvent evt) {
if (shapeBeingDragged == null) return;
int x = evt.getX();
int y = evt.getY();
Dimension cs = this.getSize();
int maxw = cs.width - shapeBeingDragged.width;
int maxh = cs.height - shapeBeingDragged.height;
if (x < 0) x = 0; else if (x > maxw) x = maxw;
if (y < 0) y = 0; else if (y > maxh) y = maxh;
shapeBeingDragged.moveBy(x, y);
repaint();
}

synchronized public void mouseReleased(MouseEvent evt) {
if (shapeBeingDragged == null) return;
int x = evt.getX();
int y = evt.getY();
Dimension cs = this.getSize();
int maxw = cs.width - shapeBeingDragged.width;
int maxh = cs.height - shapeBeingDragged.height;
if (x < 0) x = 0; else if (x > maxw) x = maxw;
if (y < 0) y = 0; else if (y > maxh) y = maxh;
shapeBeingDragged.moveBy(x, y);
shapeBeingDragged = null;
repaint();
}
URLØÝ¸(a-draw.com)


ŽŸƒy[ƒW
ÅVƒŒƒX•\ަ
ƒXƒŒƒbƒh‚ÌŒŸõ
—ÞŽ—ƒXƒŒˆê——
˜b‘è‚̃jƒ…[ƒX
‚¨‚Ü‚©‚¹ƒŠƒXƒg
¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ
‰É‚‚Ԃµ2ch

5385“ú‘O‚ÉXV/271 KB
’S“–:undef