public void mouseDragged(MouseEvent e) { // System.out.println("Dragged"); double beatWidth = sp.beatWidth; beatWidth += (double) ((double) e.getX() - (double) startX) / 5.0; if (beatWidth < 1.0) beatWidth = 1.0; if (beatWidth > 256.0) beatWidth = 256.0; // System.out.println("beatWidth = "+beatWidth); sp.beatWidth = beatWidth; startX = e.getX(); // sp.update(); this.repaint(); }