Updating window components WHILE dragging the mouse

How do I update a whole window (JFrame), including it's components, during the following scenario:
1. mouse pressed - on any of the window's boundaries
2. mouse moved to a final position.
Currently the components of the window do not change until i stop moving the mouse.
I can't yet find an Event for clicking the mouse on the window's borders.

Check out my Resizeable code. This may be exactly what you are looking for. I've also included code for Draggable, which you might be interested in
You are welcome to have and to modify this code, but please do not take credit for it as your own work.
==========================================
     public static class Draggable extends MouseAdapter implements MouseMotionListener {
        Point mLastPoint;
        Component mDraggable;
        public Draggable(Component w) {
            w.addMouseMotionListener(this);
            w.addMouseListener(this);
            mDraggable = w;
        public void mousePressed(MouseEvent me) {
               if (mDraggable.getCursor().equals(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR))) {
                    mLastPoint = me.getPoint();
               else {
                    mLastPoint = null;
          private void setCursorType(Point p) {
               Point loc = mDraggable.getLocation();
               Dimension size = mDraggable.getSize();
               if ((p.y + RESIZE_MARGIN_SIZE < loc.y + size.height) && (p.x + RESIZE_MARGIN_SIZE < p.x + size.width)) {
                    mDraggable.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        public void mouseReleased(MouseEvent me) {
            mLastPoint = null;
        public void mouseMoved(MouseEvent me) {
               setCursorType(me.getPoint());
        public void mouseDragged(MouseEvent me) {
            int x, y;
            if (mLastPoint != null) {
                x = mDraggable.getX() + (me.getX() - (int)mLastPoint.getX());
                y = mDraggable.getY() + (me.getY() - (int)mLastPoint.getY());
                mDraggable.setLocation(x, y);
     public static class Resizeable extends MouseAdapter implements MouseMotionListener {
          int fix_pt_x = -1;
          int fix_pt_y = -1;
        Component mResizeable;
          Cursor mOldcursor;
          public Resizeable(Component c) {
               mResizeable = c;
               c.addMouseListener(this);
               c.addMouseMotionListener(this);
          public void mouseEntered(MouseEvent me) {
               setCursorType(me.getPoint());
          private void setCursorType(Point p) {
               boolean n = p.y <= RESIZE_MARGIN_SIZE;
               boolean s = p.y + RESIZE_MARGIN_SIZE >= mResizeable.getHeight();
               boolean w = p.x <= RESIZE_MARGIN_SIZE;
               boolean e = p.x + RESIZE_MARGIN_SIZE >= mResizeable.getWidth();
               if (e) {
                    if (s) {
                         mResizeable.setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
                         return;
                    mResizeable.setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
                    return;
               if(s) {
                    mResizeable.setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
                    return;
          public void mouseExited(MouseEvent me) {
               if (mOldcursor != null)
                    ((Component)me.getSource()).setCursor(mOldcursor);
               mOldcursor = null;
        public void mousePressed(MouseEvent me) {
               Cursor c = mResizeable.getCursor();
               Point loc = mResizeable.getLocation();
               if (c.equals(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR))) {
                    fix_pt_x = loc.x;
                    fix_pt_y = loc.y;
                    return;
               if (c.equals(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR))) {
                    fix_pt_x = loc.x;
                    fix_pt_y = -1;
                    return;
               if (c.equals(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR))) {
                    fix_pt_x = -1;
                    fix_pt_y = loc.y;
                    return;
          public void mouseReleased(MouseEvent me) {
               fix_pt_x = -1;
               fix_pt_y = -1;
          public void mouseMoved(MouseEvent me) {
               setCursorType(me.getPoint());
          public void mouseDragged(MouseEvent me) {
               Point p = me.getPoint();
               int width = fix_pt_x == -1 ? mResizeable.getWidth() : p.x;
               int height = fix_pt_y == -1 ? mResizeable.getHeight() : p.y;
               mResizeable.setSize(new Dimension(width > 1 ? width : 1, height > 1 ? height : 1));
     }

Similar Messages

  • Disabling 'Show window contents while dragging' also disables window snap - is there a workaround?

    When I disable 'Show window contents while dragging' in Performance Options, it also automatically disables the ability to snap windows the left and right and corners by dragging them. I have an older computer, and disabling this really improves the performance,
    but I'd really like to keep the ability to snap the windows around, as it's one of my favorite features.
    Is there a way to just disable showing window contents while dragging without disabling the window snap feature?

    Hey there. I've been trying to figure out why my snap wasn't working, and this is the only post I've found that mentioned it.
    I found snap wasn't working on my machines sometimes and realised it happens after I start an RDP session which disables the "show window contents while dragging" option, but then doesn't seem to enable it properly after the session ends.
    When I check the option, it is already ticked, so I need to untick and re-tick, then apply and snap starts working again.
    I don't know if there is any connection with the "Prevent windows from being automatically arranged when moved to the edge of the screen" option under the mouse ease of access settings.
    It does seem like a new issue though as it doesn't happen under Win8

  • Show Windows contents while dragging disabled after standby

    I have noticed that the option "Show windows contents while dragging" gets disabled after I close the lid to put the machine into standby (hibernation disabled) and then open it again. Does anyone know what to do in order do disable that annoying feature?

    The way to solve this problem, is demonstrated by the following code:
    JDesktopPane desktopPane = new JDesktopPane();
    desktopPane.putClientProperty("JDesktopPane.dragMode", "outline");This will then set all of the internal frames to outline mode when the frames are dragged instead of sluggishly drawing the components with the internal frames when dragged.
    Hope this helps
    Riz

  • Error while dragging the table

    Hi Folks,
    I am getting the following error while dragging the model table on to the diagram tab(creating an interface).
    Any Ideas??????
    java.lang.NullPointerException
         at oracle.odi.interfaces.interactive.support.clauseimporters.ClauseImporterDefault.importClauses(ClauseImporterDefault.java:87)
         at oracle.odi.interfaces.interactive.support.actions.InterfaceActionAddSourceDataStore.performAction(InterfaceActionAddSourceDataStore.java:124)
         at oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions.performAction(InteractiveInterfaceHelperWithActions.java:845)
         at oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions.performAction(InteractiveInterfaceHelperWithActions.java:821)
         at oracle.odi.ui.OdiSdkEntityFactory.dropSourceDataStore(OdiSdkEntityFactory.java:523)
         at oracle.odi.ui.etlmodeler.diag.dragdrop.DiagramNodeDropHandler.dropObjects(DiagramNodeDropHandler.java:150)
         at oracle.diagram.framework.dragdrop.handler.DelegateChooserDropHandler.dropSelected(DelegateChooserDropHandler.java:386)
         at oracle.modeler.dnd.ModelerTCDropHandler.access$001(ModelerTCDropHandler.java:69)
         at oracle.modeler.dnd.ModelerTCDropHandler$3.run(ModelerTCDropHandler.java:288)
         at oracle.modeler.dif.GraphicAdder.addImpl(GraphicAdder.java:387)
         at oracle.modeler.dif.GraphicAdder.addAndLayoutImpl(GraphicAdder.java:372)
         at oracle.modeler.dif.GraphicAdder.addSelectAndLayout(GraphicAdder.java:348)
         at oracle.modeler.dnd.ModelerTCDropHandler.dropSelected(ModelerTCDropHandler.java:284)
         at oracle.diagram.framework.dragdrop.handler.DelegateChooserDropHandler.drop(DelegateChooserDropHandler.java:150)
         at oracle.diagram.framework.dragdrop.DefaultDropPlugin.drop(DefaultDropPlugin.java:115)
         at oracle.modeler.dnd.ModelerDropPlugin.drop(ModelerDropPlugin.java:100)
         at oracle.diagram.framework.dragdrop.DropTargetHelper.drop(DropTargetHelper.java:188)
         at oracle.diagram.framework.dragdrop.ManagerViewDragAndDropController$MyDropTargetListener.drop(ManagerViewDragAndDropController.java:802)
         at java.awt.dnd.DropTarget.drop(DropTarget.java:434)
         at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:519)
         at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:832)
         at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:756)
         at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:30)
         at java.awt.Component.dispatchEventImpl(Component.java:4508)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4481)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4312)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4163)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4481)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
         at java.awt.EventQueue.access$000(EventQueue.java:84)
         at java.awt.EventQueue$1.run(EventQueue.java:602)
         at java.awt.EventQueue$1.run(EventQueue.java:600)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:616)
         at java.awt.EventQueue$2.run(EventQueue.java:614)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thanks in advance
    R

    Did you tryed to refresh your model or delete and re-import it ?

  • HT5096 where is the administrator window when I drag the folder "Backups.backupdb" from the old hard drive on the new one?

    where is the administrator window when I drag the folder "Backups.backupdb" from the old hard drive on the new one? At the moment when I try to do it, the window that appear doesn't allow me to continue. it only says "the volume has the wrong case sensitivity". thanks

    Although the documentation says you can copy Time Machine backups in the Finder, it's very slow and sometimes doesn't work at all.
    Launch Disk Utility, open the built-in help, and search for the term "Duplicate." Follow the instructions. All existing data on the destination volume will be erased. That shouldn't be a problem, because you don't want to mix backup and non-backup data on the same drive anyway. Turn Time Machine OFF in its preference pane while copying the volume.

  • Error message "update was terminated" while cancelling  the billing documen

    Hi Experts,
    Kindly can you advise on the following issue. We are getting the error message  "update was terminated" while cancelling the billing document using transaction code VF11.
    Note: The accounting document associated with the billing document is not posted and also note that we have done a check with the Basis team who has confirmed back stating they are seeing the udpate error for the user "    ". The log says that the  update was terminated because the user was trying to enter some duplicate records into the database.
    We could observe that the cancellation document is not created and also we have confirmed with the FI that they still continue to have the billing document open in the customer balance statementu2026
    Thanks for your help,
    Mithun

    HI Mithun ,
    Check if that billing document is there in VFX3 . If it is there then try to clear it from there and then try to reverse it.
    Hopefully it will be done.
    Regards,
    Nikhil

  • I'am using iphone 5 i tried to update the ios 8.0.2 using the shift key in itunes update @ windows 8 i have the file which i downloaded, but it says that firmware version is not compatible. what can i do for it . help me friends

    i'am using iphone 5, i tried to update the ios 8.0.2 using the shift key in itunes update @ windows 8 i have the file which i downloaded, but it says that firmware version is not compatible. what can i do for it . help me friends

    Hello vinoth1986,
    After reviewing your post, I have located an article that can help in this situation. It contains a number of troubleshooting steps and helpful advice concerning update issues:
    If you can't update or restore your iPhone, iPad, or iPod touch
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • Heads up display for viewport pixel size while dragging the bar!

    Would be a great feature to display the active viewport size in a heads up display while dragging the bar so we can accurately determine the size of viewport to select. Love this program and can't wait for Version 1 and all that's to come!
    Tom

    Hi Thomas! This is a good idea! Thanks for this!

  • Hide Window Contents While Dragging in OB3?

    I know it was possible with OB2 (session.screen0.opaqueMove: False) but is there a hidden command somewhere that does the same thing in OB3?
    Maybe it has something to do with the <drawContents> command?
    Thanks.

    hi
    I am sorry my description was not so precise as it should be.
    Our applications use MDI window system manager where the document windows always are displayed within the MDI application window frame.
    An Application window is OK. Problem is with the document windows.
    Only a frame of a document window is moving while I am dragging it to some other position by the mouse.
    The content of the window appears at the new position when a mouse button is released.
    This behaviour is new for me at web based forms. The same operation acts differently at the old application (client/server forms 6i).
    A dragged document window is moved with its content.
    regards
    Petr

  • Update LIKP table while saving the output type in VT02N transaction

    Hi All,
    I have a requirement where i have to update Delivery Priority(LPRIO) field in LIKP table while saving the output type in VT02N transaction. I am not able to use the BAPI "BAPI_OUTB_DELIVERY_CHANGE" or FM "WS_DELIVERY_UPDATE" because, when we save the output type the programs that are configured in NACE are triggered in update mode and hence i will get a roll back error.
    Let me know other ways of updating the table at the time of saving output type for shipment transaction VT02N.

    This could be a result of one of the following reasons:
    1: Incorrect smart form/routine assigned in the output configuration (NACE)
    2: Serial number range of the delivery expired
    3: The default settings of the user (SU01) processing the delivery is missing the default printer name.
    Hope this is helpful
    Manish

  • Update one column while getting the value in another column

    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.

    jsun wrote:
    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.Two statements != two database calls.
    At least not in terms of SQL.
    JDBC requires a 'statement' but in SQL (depending on the data source) that can include multiple statements. An obvious example of this is a stored proc but there are other ways as well.

  • Since Firefox 5.0 update I get the update window popping up all the time. I keep installing the update but it just keeps happening.

    I keep getting the update window even though I have installed the update.

    If you want to stick with the 3.6 line, you can get the latest version here:
    http://www.mozilla.com/firefox/all-older
    I don't know how Macs work, but this article might help: [https://support.mozilla.com/en-US/kb/Installing%20Firefox%20on%20Mac Installing Firefox on Mac | How to | Firefox Help].

  • Update Rule error while loading the data

    Hello All,
    I tried to do the init load for the datasource 2LIS_02_VAKON (Sales Document Condition), But it error's out in the Update rule saying:
    Short text: Error when generating the update program
    Long Text:  Diagnosis
         An error occurred during program generation for InfoSource 2LIS_11_VAKON
         and InfoProvider 0SD_C15 . This may be extrapolated to incorrect update
         rules.
    Procedure
         Check and correct your update rules and then generate the update program
         again. You can find help on the error in the error log.
    The update rule looks very fine. I even deleted it and re created, but no success..... Please give me your thoughts abt it..... Any suggestions will be great for me.....

    Hello Gokul,
    I could'nt see any analyse button in RSMON. This is the only error message I could get from the Process monitor:
    Short text: Error when generating the update program
    Long Text: Diagnosis
    An error occurred during program generation for InfoSource 2LIS_11_VAKON
    and InfoProvider 0SD_C15 . This may be extrapolated to incorrect update
    rules.
    Procedure
    Check and correct your update rules and then generate the update program
    again. You can find help on the error in the error log.
    Do you expect something else ? Also I went through your OSS note, they are asking to apply support pack 18. Is this a serious issue to apply SP? Because in Quality and Prod it loads fine......
    Please let me know your idea

  • Express Document:Update was terminated while processing the Order via VA02.

    Hi,
        User was trying to process order for orderlines say for Eg POSNR 20 to 400 for a particular order,He ended up with Express document :Update was terminated error.When i Checked in SM13 for the update termination errors,I got the following error.
    VI: 200 Item status (document &, item &) is missing.
    I checked the order (POSNR 20 to 400 ) in VBUP  table and the entries were missing for this order (Posnr 20 to 400 ).
    Appreciate you'r Inputs.
    Thanks
    Rakesh.

    Hi,
    Can you please send the detail message in express document.
    Apps

  • Wait Cursor not showing while moving the Mouse

    I have a JFrame application. In that JFrame i have a Jdialog (login screen). After entering user name and password, i am setting the Wait cursor (hour glass) for the JFrame and JDialog. When the mouse cursor is inside dialog, it is properly showing the wait cursor. I can able to move the mouse within dialog.
    But When I move the mouse outside the dialog i.e inside JFrame, the wait cursor goes off. It shows default cursor. Even I have set the wait cursor to JFrame.
    What may be the problems? If any body knows, please expaling.
    Advance thanks for early reply.

    if any knows the solution, please post it.

Maybe you are looking for

  • External 4k monitor says no signal from display port

    HELP... I have a late 2009 27" iMac running 10.10.2 Yosemite, i bought an ASUS PB287Q 4k monitor to extend my desktop. I have connected it by MDP to DP and the Mac recognises the ASUS, shows it as a display and tells me how it is connected but the di

  • How to create a password with JTextField

    Hi, I need to create a password field on the JTabbedPane. I can create a TextField and setEchoChar to make it a password field. However it is not working well with the rest of the JComponents. Can I do this on a JTextField? I could not find the funct

  • Select * query with alias

    Hi there, I want to retrive all the field with select * from table query but i just wnt to give alias for one column is there any ways to do this?

  • Add rows to query result?

    Is it possible to add rows to a SQL query's result, similar to the COMPUTE command in SQL*Plus? That is, for example, when the value for column A changes, add a row after the previous row (the last one before column A changed) to show the sum of the

  • IPod music not supported

    my new iPod Hi-Fi seems not support my old version iPod click wheel, what's wrong? iTunes related?