Results 1 to 2 of 2
  1. #1
    Preethi is offline Member
    Join Date
    Jan 2008
    Posts
    83
    Rep Power
    0

    Default Limiting the Dragging area

    My Panel size is 1700.I have drawn some rectangles on it and i have implemented mouseDraggedEvent for those rectangles.Now,i want to restrict the motion of the rectangles,so that it should move beyond 300 at its left and 1700 at its right.can anyone help me..

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    As your code moves the rectangle, check where the rectangle is located and if it's outside the limits stop moving it.

Similar Threads

  1. Scaling-ache and mouse dragging
    By willemjav in forum Java Applets
    Replies: 19
    Last Post: 07-19-2008, 01:17 AM
  2. Area Add
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 12:07 AM
  3. Area Subtract
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 12:07 AM
  4. Limiting the capacity of a cell of JTable
    By rameshraj in forum Advanced Java
    Replies: 0
    Last Post: 03-24-2008, 03:20 PM
  5. Limiting size of ArrayList
    By ravian in forum New To Java
    Replies: 3
    Last Post: 01-29-2008, 07:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •