Adding resize handles to a rectangle to resize and drag in a canvas

Hi
I am having difficulty for the last couple days in getting a rectangle in java 2d to addshape handles to the corners which will allow me to resized the rectangle and then and dragged within the canvas using these handles. Also to get the shape on the canvas I will be clicking a button for the shape Rectangle to appear on the canvas in the first instance. I do not understand where I am going wrong.
I am using the format of g2D.drawRect(10,10,50,50 ) for example to demonstrate my shape.
Thanks in advance

Search for
draggable tjacobs01
and
resizeable tjacobs01
these are my classes for doing what you're talking about. They work on components so you'll either have to switch your rectangles to components or adapt this code to non-component objects. It becomes more tricky because of the mouselistening.
usage:
Component c = ...
new Draggable(c);
new Resizeable(c);
parent.add(c);

Similar Messages

  • Resizable and drag & drop window

    Hi!
    I need to build a window with title bar and close button to
    display an internal movieclip (mc is in the same movie). Window
    must be custom resizable and drag & drop. I don' t want to use
    window component. Please, help me. Thanks in advance...

    Here.
    You can work out the rest of the kinks. Good Luck.

  • Resize and Resample in Photoshop CC

    Hi.
    I use Photoshop since 1997 and jump from CS5 to CC this week. What I used to do sometimes is taking a 150dpi image and need to make it 72dpi, BUT I really want it to change pixels dimension. In PS CS5 I just needed to go to "Image Resize" and change 150 do 72dpi, and PS kept the Cm/Inches dimensions but changed pixels. Is exactly what I need to do. I PS CC it doesn't work, if I change dpi it will only change image size in Cm/Inches.
    And example, I have an Illustrator file, 800x800px. I export it as 150dpi JPG, opens in PS. It will show an image like 1667x1667px 150dpi. I want to change it to 72dpi so my JPG will be 800x800px again.
    Some people will say: "but why don't you already export from ILL as 72dpi?". Because I sometimes need those images in 150 and sometimes in 72. So I prefer to have a 150dpi image and resize to 72 if I need instead the opposite.
    Do you know if there is a way in PS CC to solve it?
    Thanks,
    Luiz

    DPI PPI  and an image's DPI resolution setting and Inkjet Printers DPI Resolution setting ???
    Dots Per Inch is an old printers term that came about when images were printed black and white using little dots of inks fined dots finer sharper images it density of dots size of dots image like news papers.  Later color image usinf 4 colors CMYK...
    Pixels Per Inch a term use about displays color pixels are three color Red Green Blue their geometry layout varies and some have even added a fourth yellow component  again its a density size display are manufactured with a single PPI density.  Different displays panels have their manufactured PPI. Most desktop LCD panels today have a ppi around 100.  Displays do not support your Image Files DPI resolution setting the display pixels their PPI size.  Image sizing on displays is done by scaling  the numbers of pixels in a image a displaying the scaled image not the actual images pixel. Zooming percent....
    Inkjets printers do not print like news papers and the do not use a single drop or dot of ink per image pixel.  The user their higher finer drops of ink to paint in you images larger square pixels. You inkjet printer can print pixels and siy up to the maximum resolution. Your printer DPI setting is a quality setting the higher the setting the finer the pixels will be painted in.  Higher quality settings are only available on high quality Photo paper for more ink is laid down and requires a special surface to prevent ink running pixels together regular paper would receive to much ink and be more a blotter paper.
    Image DPI setting defines/sets the image Pixel size without changing a single pixel in am image you can print the image any size you want by changing the size of its pixels.

  • Resizing and/or Moving the JFrame on the Screen

    Is there any way to resize a JFrame when the undecorated property is set to true.
    I would like to have a JFrame that is both undecorated and resizable.
    Similarly, I was also wondering how to move the JFrame on the screen if the
    undecorated property is set to true since there is not Border to select the
    JFrame to initiate the Move.
    Thanks!

    yes... setSize(), setLocation().
    And if you want the user to be able to do it with the mouse, you need to add a border to the rootpane to prevent anyone adding things over the whole rootpane, and add a mouse listener to it to catch mouse click and drag events and do the calculations.
    If you look at the BasicInternalFrameUI, or some thing in there should have some code that does the same thing.

  • My homescreen won't resize and I can't access anything because everything is too big to navigate.  Help.

    My homescreen won't resize and I can't access anything because everything is too big to navigate.  Help.

    Double-tap the screen with three fingers to disable Zoom.
    To turn off Zoom go to Settings > General > Accessibility > Zoom and turn this Off.

  • Adobe camera raw window won't resize and can't reach buttons

    When I open an image from bridge into adobe camera raw 6.1 (Photoshop CS5) on my laptop, the camera raw window fills all of the screen (top to bottom) and the buttons at the bottom of the window are below the task bar. Thus I can't open the image in photoshop except by hitting the enter key. I can't reach the open, etc buttons. The window won't resize and there are no icon/buttons in the right upper corner to go to/from full screen. When I hit the icon in the top right hand menu bar in ACR (to go to full screen size) the window then fills the whole width of the screen in addition to the height, but no matter what I do I can't get the height of the window to shrink, so that I can access the icons at the bottom of the screen. What am I missing? Thanks

    Don't worry about turning aero off just yet.
    There are two key first questions:
    What is your screen resolution (width in pixels x height in pixels)?  Right-click on desktop, choose Screen Resolution.
    What setting have you chosen for the display size (Smaller, Medium, Larger) in the Display dialog?  Right-click on desktop, choose Personalize, then Display.
    -Noel

  • Skew, Warp, Resize and Nest a video in Photoshop???

    I would like to know how to skew, warp and resize a video inside of photoshop cs4.  I would also like to know how to nest multiple video files into one file.
    I am new to Photoshop, I am looking for some tutorials but unable to find any.
    Thanks

    Marian, thanks for the advice.
    Thou I understand your point, very well about screwdriver vs hammer, that was not my question in my post.  I asked a straight forward question about how to Skew, Warp, Resize and Nest a video in Photoshop.  Not which is the best software to use for this task.
    If you know the answer, share the knowledge, is this not what this forum is for or am I in the wrong place???  Before suggesting which tool is best for me to use, try understanding what I want to build first.  This makes all the difference. 
    As I have already proven to myself I don’t need a new tool to accomplish the task I had at hand.  If I took your advice, I and my company would have wasted money on a software that we did not need in the first place.
    Understand your client needs first before giving advice.  Sometimes a hammer is all it takes, if you use right.
    I don’t need to study more on video production, this is not my job.  All I wanted to know was how to edit a video in Photoshop.
    I hope we are not off on the wrong foot because I feel I could learn a lot from you but you need to take the time to understand the question before shooting from the hip with an answer.

  • How can I resize and reposition the Date Created window for All windows?

    When setting view options for a finder window set to list view, I cannot get column resizing or positioning to hold. When making those changes, the option for "All Windows" automatically shifts to "This window only" and it then does not hold.
    How can I resize and reposition the Date Created column for All WIndows?

    Hi Harmz,
    Try dragging this file to the Îesktop & reboot...
    /Users/YourUserName/Library/Preferences/com.apple.finder.plist

  • My PSE 13 resizing and move tools have stopped working.

    Suddenly, my resizing and move tools don't work. I get the box but am unable to move sides or whole image. Any suggestions? Thank you.

    Hi,
    Please try resetting your tools from Photo Bin flyout menu.
    1. Open Photo bin.
    2. Click on Fly Out menu
    3. Click on option Reset all Tools
    4. Relaunch Editor13
    and see if it helps.
    Thanks,
    Anwesha

  • Resize and crop images to a specific width and height

    Hi,
    I want to convert images to thumbnails with a 'standard' format - I need all images to have the same width and height.
    So I need to resize and then crop the images. Is this possibe with JAI? Are there other libraries which can do this better?
    I've read about ImageMagick - are the Java interfaces to ImageMagick good?
    /best regards, Håkan Jacobsson - System developer in Sweden

    Duplicate posting, answers are here
    http://forums.sun.com/thread.jspa?threadID=5419291
    Pleas don't duplicate unless you note that you have done so and provide pointers to the duplicates - as I'm sure you're aware. . .

  • When I have resized and saved an image in Photoshop (CS, version 8.0 for Mac) using image size, why is it so large when I open it in preview or another image viewer? Has it actually saved according to the size I specified?

    When I have resized and saved an image in Photoshop (CS, version 8.0 for Mac) using image size, why is it so large when I open it in preview or another image viewer? Has it actually saved according to the size I specified?

    You want to view the image at the Print Size, which represents the size that shows in the Image>Resize Dialog.
    View>Print Size
    Since screen resolution is almost always lower that the print resolution (somewhere between 72 and 96 usually), images will always look bigger on the screen, unless you view them at print size.
    (apple Retina displays have a much higher resolution than normal screens, closer to the average print size resolution)
    more info:
    Photoshop Help | Image size and resolution

  • Photo resizing and publishing

    I think I know the answer but want to be sure. If I drag a photo file to a page and publish it is automatically resized correct? I just don't mean just in dimensions but also as to file size and resolution. I have many files that are large tiff files at 240 ppi. Also, can RAW files be published?
    Thanks,
    BB

    Why ask when one can test it :
    http://www.glasslantern.com/RAWpository/
    I downloaded a Canon CRW file.
    Safari adds the tiff extension. Remove it after download.
    Drop the huge file on iWeb.
    Resize it to fit the canvas.
    Publish.
    iWeb makes a JPEG.
    Nurse, who's next?

  • How to resize and edit multiple photos then save all at once?

    Photoshop CS6
    MacBook Pro
    ================
    Hi I have a bunch of product photos that I need to resize to a square (1200x1200). I thought I might be able to import them all into Photoshop, resize them to fit the canvas.... center them all, one by one (not all photos are centered, this is my other issue) and then save them all at once. I have done all the above but cant figure out how to save each layer, as their respective layer name (ie. default photo name) with out flattening the layer and manually saving each one, one by one.
    I thought you could do something similar when you do batch watermarks but I cant figure out how to save as it wasnt a recorded action since all photos had some individual tweaking to center them on the canvas after I did a group (transform) resize.
    I hope this make sence. Thanks in advance.

    bump

  • Scrollbars, artboards, resizing and other minor tweaks offer

    I hope Adobe reads these forums, so here i post some bugs to fix, minor tweaks and my personal wishes for Illustrator. I guess many of them are not so hard to fix, but will make Illustrator much better.
    BUGS:
    - fix alt-scroll bug in pixel preview (viewport jumps to unpredicted locations)
    - layers panel becomes black when dragging a layer and scrolling at the same time (and the panel has enough layers to scroll)
    MINOR TWEAKS:
    - recolor artwork on the fly when dragging sliders in the color panel (not after releasing mouse button)
    - option to hide edges of inactive artboards only
    - resize crop areas to both sides (like drawing objects) when pressing alt
    - NORMAL scrollbars
    - in Appearance panel when clicking an eye and dragging mouse down/up toggle visibility of lower/upper items, but not dragging the item (make behavior same as in layers panel)
    - chahge value of numeric fields on hover and drag (not on click and drag, like in Photoshop)
    - when resizing, snap objects to their original size and position even when snapping is turned off
    - not squeeze/streth text when resizing area type
    - make hexadecimal field in color picker dialog 3 pixels wider so that all 6 characters fit in it
    - make status bar remember my choise of what to show
    - undo/redo functionality inside live color dialogue (!!!)
    - in view menu the word "show" shouldn't change for "hide", but a tick should appear/disappear
    - apply gradient by clicking with the gradient tool on an object
    - fonts preview in the drop-down menu in control panel
    - make stop button actually stop the progress when an effect is applying
    WISHES:
    - Photoshop's actions panel
    - right-click menu is really useful why not use it and put more often used commands in there like flip horisontal/ vertical when an arrow tool is active
    - fireworks' pathfinder
    - gradient stroke
    - labeling of crop areas (and possibly everything a slice has)
    - zoom and pan art when a dialogue window is open (like in Photoshop)
    Also SVG support back to Bridge.
    PS. And make this site usable in Opera. I could type text in this textarea only after disabling all styles for the page.

    I hope Adobe reads these forums, so here i post some bugs to fix, minor tweaks and my personal wishes for Illustrator. I guess many of them are not so hard to fix, but will make Illustrator much better.
    BUGS:
    - fix alt-scroll bug in pixel preview (viewport jumps to unpredicted locations)
    - layers panel becomes black when dragging a layer and scrolling at the same time (and the panel has enough layers to scroll)
    MINOR TWEAKS:
    - recolor artwork on the fly when dragging sliders in the color panel (not after releasing mouse button)
    - option to hide edges of inactive artboards only
    - resize crop areas to both sides (like drawing objects) when pressing alt
    - NORMAL scrollbars
    - in Appearance panel when clicking an eye and dragging mouse down/up toggle visibility of lower/upper items, but not dragging the item (make behavior same as in layers panel)
    - chahge value of numeric fields on hover and drag (not on click and drag, like in Photoshop)
    - when resizing, snap objects to their original size and position even when snapping is turned off
    - not squeeze/streth text when resizing area type
    - make hexadecimal field in color picker dialog 3 pixels wider so that all 6 characters fit in it
    - make status bar remember my choise of what to show
    - undo/redo functionality inside live color dialogue (!!!)
    - in view menu the word "show" shouldn't change for "hide", but a tick should appear/disappear
    - apply gradient by clicking with the gradient tool on an object
    - fonts preview in the drop-down menu in control panel
    - make stop button actually stop the progress when an effect is applying
    WISHES:
    - Photoshop's actions panel
    - right-click menu is really useful why not use it and put more often used commands in there like flip horisontal/ vertical when an arrow tool is active
    - fireworks' pathfinder
    - gradient stroke
    - labeling of crop areas (and possibly everything a slice has)
    - zoom and pan art when a dialogue window is open (like in Photoshop)
    Also SVG support back to Bridge.
    PS. And make this site usable in Opera. I could type text in this textarea only after disabling all styles for the page.

  • When dragging an image onto a fresh canvas, the resizing feature presnaps the image into the canvas size. I can confirm that this has not happened to me in previous projects. I've also tested this problem by making a new larger document size and dragging

    Contexts: I am very competent with GFX and have worked on many projects.
    When dragging an image onto a fresh canvas, the resizing feature presnaps the image into the canvas size. I can confirm that this has not happened to me in previous projects. I've also tested this problem by making a new larger document size and dragging in the same render. It snaps again. I don't want to re-size from the canvas dimensions, I want to resize from the render's original dimensions.

    Ap_Compsci_student_13 wrote:
    ok sorry but doesn't sscce say to post the whole code?the first S is Short, and yes, it needs to be all the code needed to illustrate the problem and let use reproduce it. If you were developing a new Web framework, your example might be short, but for a student game it's very long.

Maybe you are looking for

  • Error while creating a setup package .

    Hi ALL, We are trying to create a setup package (SP20 client)  for our application after assinging the device configurations their roles and conditions to the Hierarchy Group which we created It gives the following error while creation of the setup 

  • Is sg 200-50 interface completely compatible with any particular browser?

    Is there a recommended browser for this switchbox?  I have the latest versions of IE, Google Chrome and Firefox.  The results I get trying to use them is as follows: 1.  IE 11:  Can log in, but text is missing all over the place. 2.  Firefox:  Cannot

  • LG MKJ-4065-3801 LCD TV remote programming instructions.

    Need instructions on how to program the remote for LG MKJ-4065-3801 LCD TV.  Need to program it to control Toshiba DVD player. Don't find any instructions or codes in the owner's manual or on the LG support site.

  • Is Portege R500 3G compatible with Vodaphone?

    Does anyone know about the internal 3G on the R500-3G125 as I can find no detailed information anywhere? My boss is attracted by the internal unit, having had problems with an external stick modem. I am trying to find out if it will take our existing

  • CS5 - remembering last pre-sets?

    I changed the last project's sizes and color to B&W and specific sizes. Now when I just started a new project - desktop- it opened the new color project in B&W and at distorted size. Any help would be appreciated. Michael