コード例 #1
0
 public void mouseClicked(MouseEvent e) {
   x = -1;
   y = -1;
   width = -1;
   height = -1;
   drawable.repaint();
 }
コード例 #2
0
 public void mouseDragged(MouseEvent e) {
   if (x == -1) {
     return;
   }
   width = e.getX() - x;
   height = e.getY() - y;
   drawable.repaint();
 }