Dropped events

Hi,
I've created a Swing GUI application with Netbeans. The main frame holds a grid of JPanels, arranged in a GridLayout. I would like the following to work: If I click somewhere on one of the JPanels with the left button, a counter should be incremented whose value is displayed in a JSpinner which in turn belongs to the selected JPanel (i.e., every JPanel in the grid has such a spinner). A click with the right button should decrement the counter.
I've already implemented this by simply creating the necessary event listeners and methods (mouseClicked()) with the Netbeans IDE.
The problem is that it does not work reliably. Generally it works fine, but if I'm too fast with the mouse, events seem to get dropped and nothing happens. How can I make the GUI more responsive?
Thanks in advance
Martin

I find it strange that there's a difference in the event handling of mouseClicked and mousePressed.it's not a difference in event handling, it's what generates the event.
mousePressed will always fire, as will mouseReleased.
if the x and y coordinates of the mouseEvent for mousePressed is
identical to those of mouseReleased, then mouseClicked event fires.
so, move the mouse 1 pixel (up or down), and mouseClicked won't fire.
to check the order, add a mouseListener to something and in the 3 events put a System.out.println(...)
you will see that the order of firing is
mousePressed
mouseReleased
mouseClicked (if it fires)

Similar Messages

  • How to use the drop event of the tree control in LabVIEW 8.20?

    Hi,
                I am using the two tree controls in my application to provide a option for the user to drag and drop item from one tree to the other.  I have to validate the user selection. I tried to capture the user drop event  using the event structure. The problem I am facing is, I am not able to drop the item even though i have wired a constant true to the filter(Accepted?) in the event case. I have enable the property(Allow droping) in the right menu of the tree control also.
              While configuring an event case for (drop, drag entered and some thing like this) only I am getting the problem otherwise it is working fine.  
    What do i need to do to caprture the drop event ?
    Is there any way to avoid the item duplication while droping a new item in the tree control ?
    or how can i do this?
    Thanks,
    Pandiarajan R

    Hi Pandiarajan,
    I hope you are doing well today! There is a lengthy discussion on the Tree Control Drag & Drop feature at this forums post including contributions from the developer of the Drag & Drop feature:
    Tree Control Drag & Drop in LabVIEW 8
    By avoiding item duplication, do you mean that you don't want the same item to be in the old tree control or do you not want more than one item in the new tree control?
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Why does my ical keep dropping events.

    For a while now my ical has been changing the title of certain events to "new event".  Now it has started dropping events intermittently.  With my leaky memory I am not able to remember everything I put in.  Can anyone help?
    We run two imacs in our house and one ipad.  Our son, who is away at school also syncs via a MacPro and an ipad.  This is all done via Mobile me.
    Thank you in advance.
    Brad

    Brad,
    Try changing System Preferences...>MobileMe>Sync>"Syncronize with MobileMe" to something other than "Automatically." I would recommend trying "Every Hour."

  • ADF Drag and drop event inside the single af:treetable

    Hi Experts,
    I have a af:treeTable in my ADF web project and i would like to implement the drag and drop event to the same tree table for supporting my sample test project use case. Currently i am facing some issue to get the source tree node and the destination tree node of the drop and drop event inside my drop listener method. How can i get those object since i need to perform some business operation inside the listener. Please note that i am not using ADF BC4j in my project. The service layer is implemented as EJB and it's being called from the backing bean.
    Looking forward some guide lines to resolve this issue from you experts.
    Thank you.

    It's not a perfect solution, but a work in progress that i'm currently using in my backing bean:
    private RichTree navTree;
    private void exitContainers() {
    boolean success = false;
    while (!success) {
    try {
    navTree.exitContainer();
    } catch (Exception e) {
    success = true;
    private void clearDisclosedRowKeys() {
    if (navTree != null && navTree.getDisclosedRowKeys() != null) {
    RowKeySet rks = navTree.getDisclosedRowKeys();
    Iterator rksIter = rks.iterator();
    while (rksIter.hasNext()) {
    exitContainers();
    List<Integer> rowkey = (List<Integer>) rksIter.next();
    List<Integer> newRowkey = new ArrayList<Integer>();
    for (Integer row : rowkey) {
    if (navTree.isRowAvailable(row)) {
    navTree.setRowIndex(row);
    navTree.enterContainer();
    newRowkey.add(row);
    } else {
    // Row is no longer available
    break;
    if (newRowkey.size() == 0) {
    rks.remove(rowkey);
    } else {
    rowkey.clear();
    rowkey.addAll(newRowkey);
    Whenever you make a 'delete' or 'move' in the tree, call clearDisclosedRowKeys(), it will remove anything that's no longer valid, so your tree won't collapse, and you won't get the error anymore.
    I took out my logging and debug statements, but essentially this just gets all the rows, checks to see if they're valid, and if so creates a new RowKeySet with the valid rows in it.
    Of course make sure you have the setNavTree and getNavTree accessor's created and that they're bound in your JSFF, otherwise navTree will always be null.
    I haven't yet found a way to 'nicely' find out if you're at the top level container, so i'm relying on an Exception to occur to give me that information, if anyone knows a better solution please feel free to share it.

  • Listening to Drag and Drop event from the extension panel

    How is it possible to detect a drop event from a Layer to a text field in a panel developer using the SDK?
    Drag and drop operation between panel elements are not the issues, but drag and drop from Photoshop and the panel might be an issue.
    Is it possible to implement them?
    If yes, could I be redirected to the documentation topic or can someone post some code snippet ?
    Thanks

    What model of camcorder is your video from and what resolution is it?
    What operating system are you using? Have you ensured that you have the latest version of Quicktime, per the program's requirements?
    Do not convert your video. The program will best with video directly from a camcorder, and converting it may will turn it into a format that it may be LESS likely to work well with.

  • Drag Drop Event

    Hello All,
    Can I trap the Drag and Drop event of a file from desktop through Scripting for Adobe Bridge.
    Thank you all in advance.
    Regards
    Farzana.

    I haven't seen such an event available to the scripts. I have an event handler and when I turned on my own logging to output all the events that I see, I didn't see any drag/drop events when I tried that operation. That doesn't mean there isn't someother way to do this, but it wasn't obvious to me through normal event handling.
    --John

  • How to handle the drop event

    Hi everyone,
    Now I'm developing the function about drag-drop source(image & text) from Panel Tree to the document.
    I also have a look at the basic drag/drop & Panel Treeview, but all of them is not the source code mentions to how to handle the drop event, almost about drag event only.
    Now when user Drags(image, text) from PanelTreeView(example) and drops them to document and then new page Item contains source(image, text) created, so I want to get the page item after drop event.
    so anyone know about this please give me suggestion
    thanks so much.

    i dont think you can.
    ~~~~~~~~~~~~~~~~
    --> Adobe Certified Expert
    --> www.mudbubble.com
    --> www.keyframer.com
    ~~~~~~~~~~~~~~~~
    keyoke_za wrote:
    > Hi,
    > How can I get my flash movie to handle the drop event
    when dropping objects from outside the flash window.
    > Thanks for your help..

  • ICAL periodically drops events

    ICAL periodically drops events that I have booked into it.  Anyone experiencing this problem?

    I've got the same problem, except I am synced through mobileme. I was working on my iMac (OSX 10.7. 2GHz Intel) and just watched three events disappear at once from iCal. Two of the events were in my 'personal' calendar. I edited these and set them under my 'work' calendar. Then I created a third event under my 'work' calendar. All three disappeared a second later. I have had this issue at least a dozen times in the past month.
    The weird thing: the events have disappeared from my iMac and my MacBook Pro, but they are still there in MobileMe online and on my iPhone.
    I tried this and it didn't help:
    In ical, click on iCal menu
    Preferences
    Click on the mobileme account
    Click "-" on the bottom (confirm yes)
    Then click "+" on the bottom
    type in your username/password
    account type is mobileme
    Brutal.
    Then I tried this:
    System Preferences > Mail, Contacts & Calendars
    Click on mobileme account.
    Click "-" and confirm.
    Click "+" and then "MobileMe"
    Enter username and password.
    No bones. Then I tried this:
    System Preferences > MobileMe > Sync > Advanced > Reset Sync Data
    Replace all sync info on this computer with sync info from MobileMe
    Nothing.
    Here's what does work. In MobileMe online, I changed the calendar in one of the three events back to personal. Then all three events reappeared in iCal.
    I hope that this issue will be resolved soon.

  • How to drag and drop events across months while in month view?

    Is there a way to drag an event across months when the view is set to monthly view?  I know the events can be dragged and dropped across the days in the month on the screen, but how can I carry through the end of the month - there does not seem to be a way to move the screen view to the next month while the event is being dragged!

    Hi,
    You can do it with keyboard shortcuts.
    Select the event. Press Cmd+X. Press Cmd and right or left arrow (depending if it is forward or back in months) until you are in the correct month. Press Cmd+V to pase on the same day in the new month.
    Best wishes
    John M

  • Event won't let drop Node, Manual Node won't let drop Event

    Hi, I am using OEM 9.2. I tried to register an event but the target was manually defined, so it went to pending state. I tried to drop the node to rediscover it, but the pending event won't let me. So the event won't let me drop the node and the node won't let me drop the event, so I'm stuck. Can anybody help please?

    Found it, have to bounce the OEM server with the Intelligent Agent stopped!

  • WebView inside JFXPanel: No drag and drop events received

    Hi,
    I'd like to manage Dnd between apps and a Swing application with a JFXPanel which embeds a WebView component.
    Currently, all drops are forbidden on top of the WebView, and I'd like to find a way for the WebView to accept transferable object such as URL...
    Moreover, code like this does not display anything in console. If I create a native JFX application (without JFXPanel Swing layer) the drag events occur.
                    webView.setOnDragDetected(new EventHandler<MouseEvent>() {
                   public void handle(MouseEvent event) {
                        System.err.println(event.toString());
              webView.setOnDragEntered(new EventHandler<DragEvent>() {
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());
              webView.setOnDragOver(new EventHandler<DragEvent>() {
                   @Override
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());                    
              webView.setOnDragDropped(new EventHandler<DragEvent>() {
                   @Override
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());                    
              });I guess JFXPanel catches events, or I missed something...
    If anyone could help, thanks in advance!

    Hi,
    For people who can help, here is the entire code to reproduce the problem.
    JFXPanel seems to consume the DND event, and the JFX WebView component does not receive anything.
    Thanks a lot.
    import java.awt.Dimension;
    import javafx.application.Platform;
    import javafx.embed.swing.JFXPanel;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.input.DragEvent;
    import javafx.scene.input.Dragboard;
    import javafx.scene.input.TransferMode;
    import javafx.scene.paint.Color;
    import javafx.scene.web.WebView;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    public class WebViewInJFXPanel {
         private void initAndShowGUI() {
              // This method is invoked on Swing thread
              JFrame frame = new JFrame("WebView in JFXPanel");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              final JFXPanel fxPanel = new JFXPanel();
              fxPanel.setOpaque(false);
              fxPanel.setPreferredSize(new Dimension(800,600));
              frame.add(fxPanel);
              frame.pack();
              frame.setVisible(true);
              // Init JFX
              Platform.runLater(new Runnable() {
                   @Override
                   public void run() {
                        initFX(fxPanel);
         private void initFX(JFXPanel fxPanel) {
              // This method is invoked on JavaFX thread
              WebView webView = new WebView();
              webView.getEngine().load("http://javafx.com");
              // The following triggers are never invoked once in a JFXPanel
              webView.setOnDragEntered(new EventHandler<DragEvent>() {
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());
              webView.setOnDragOver(new EventHandler<DragEvent>() {
                   @Override
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());
                        Dragboard db = event.getDragboard();
                        if (db.hasString()) {
                             event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
                        event.consume();
              webView.setOnDragDropped(new EventHandler<DragEvent>() {
                   @Override
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());          
                        Dragboard db = event.getDragboard();
                        boolean success = false;
                        if (db.hasString()) {
                             System.out.println("Dropped: " + db.getString());
                             success = true;
                        event.setDropCompleted(success);
                        event.consume();
              Scene scene = new Scene(webView, 800, 650, Color.BLACK);
              scene.setFill(Color.BLACK);
              fxPanel.setScene(scene);
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   @Override
                   public void run() {
                        new WebViewInJFXPanel().initAndShowGUI();
    }

  • Help Converting AS2 to AS3 Drag and Drop Event

    Hi All,
    This is the second post on help for converting AS2 to AS3. This code is used in Captivate to allow a drag and drop action between two areas (User presses down, drags, and releases in a second area - They are not dragging any object). If anyone can help me convert this please let me know.
    Source for Drag and Drop: (Note: Single MovieClip)
    // pause the Captivate movie
    _root.rdcmndPause = 1;
    // when the user's mouse is let go check if there was a successful drop
    _root.onMouseUp = function(){
              // If the source area's center coordinate is nearby the destination area's center coordinate then advance the slide
              if ( Math.abs(_root.sourceX + _root.sourceWidth  / 2 + _root.sourceParentX - (_root.destX + _root.destWidth  / 2)) < (_root.destWidth  / 2) &&
                         Math.abs(_root.sourceY + _root.sourceHeight / 2 + _root.sourceParentY - (_root.destY + _root.destHeight / 2)) < (_root.destHeight / 2) )
                        _root.rdcmndNextSlide = 1;
              } else {
                        // show error movie clip for 2 seconds (60 frames at 30 frames per second)
                        _root.showErrorMessage = 60;
      mc.onEnterFrame = function(){
              // continuously update the source area's coordinates and size
              _root.sourceX = mc._x;
              _root.sourceY = mc._y;
              _root.sourceWidth = mc._width;
              _root.sourceHeight = mc._height;
              _root.sourceParentX = _parent._x;
              _root.sourceParentY = _parent._y;
    mc.onPress = function(){
              // Uncomment following line to have control click capabilities
              //if(key.isDown(Key.CONTROL))
              // when user clicks on the source area click start the drag
                        startDrag(this);
    mc.onRelease = function(){
              // stop drag when user releases the source area
              stopDrag();
    Source for Destination Area (Single MovieClip named destArea)
    // Set a root variable to control when the error message is displayed
    _root.showErrorMessage = -1;
    // Use setCoords variable so we only set the destination coordinates once
    var setCoords = 0;
    destArea.onEnterFrame = function(){
              if (setCoords == 0){
                        // set the destination x, y, width, and height
                        _root.destX = _parent._x;
                        _root.destY = _parent._y;
                        _root.destWidth = _parent._width;
                        _root.destHeight = _parent._height;
              // destination coordinates have been set, change setCoords so it doesn't get set again
              setCoords = 1;
    Code for the Error Message (Single MovieClip named errorMessage)
    // Don't display the error message initially
    errorMessage._alpha = 0;
    errorMessage.onEnterFrame = function (){
              // If the drag and drop method detects a missed drop
              // then show this error message by setting _alpha to 100
              if (_root.showErrorMessage > 0){
                        errorMessage._alpha = 100;
                        // decrementing this variable controls the time the
                        // error message will be displayed
                        _root.showErrorMessage--;
              } else {
                        // Don't display the error message
                        errorMessage._alpha = 0;

    use:
    MovieClip(parent.parent.parent).rdcmndPause=1;
    this.addEventListener(KeyboardEvent.KEY_DOWN,keydownF);
    function keydownF(e:KeyboardEvent):void{
    fscommand("KEYPRESSED", e.keyCode);
    if(e.keyCode==32){
    MovieClip(parent.parent.parent).rdcmndNextSlide=1;

  • Detect Column on mx:Datagrid drop event

    I've been searching for a way to detect the column index when I drop on an mx:datagrid using Flex 4.  I can find the way to get the row index, but not the column.   Is the only way to define an itemeditor for each column, or is there something better (cleaner).
    If it must be an itemeditor, is there an example of one that handles the dropevent out there somewhere?
    I'm reluctant to try the AdvancedDatagrid after seeing all the posting about bugs and poor code quality.

    if it's not necessary for the user to resize the column widths, i'd say use a single column with an itemRenderer, and handle what gets shown inside that.
    if you must use multiple columns, then probably you're going to blaze the trail on performance testing.
    but it sounds like you are asking if you should limit the data to only 10 <items>.
    if so, probably convert the xml to ArrayCollection.  Large XML can freeze an app when the XML is updated.
    then, if you need more optimization after that, you can disclude <items> when converting to arrayCollection

  • Tree Control Drop? Event in LV 8

    Hi,
    I developed one application using LV 7.1 which uses tree control Drop? event.
    using this event I can get and compare source tag and target tag and based on result I can omite the Drag and Drop event.
    But in LV 8 for Drop? event I am not getting Source and Target Tags. Same function how I can implement in LV 8.0?

    Hello,
    There is a lengthy thread on this topic here (including comments from the owner of Drag-and-Drop on the LabVIEW team):
    http://forums.ni.com/ni/board/message?board.id=170&message.id=158683
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • How do I drag and drop multiple files on a control?

    LabVIEW supports dragging and dropping a single file on a path control, and have the path control populated appropriately. I want a user to be able to highlight multiple files (say, from the OS Find File window, or anywhere really) and drop them into a path array control in LabVIEW. I was hoping putting a path control in an array would do the trick, but it didn't. The mouse cursor changes to the "+" icon as it did for a single file, but when I release the button the system just beeps. Is this even doable?
    Thanks, Bob Martin

    I guess I was hoping that the path control would realize it was in an array, and starting with the actual control where the drop occurred (if more than one item of the array is visible) start populating subsequent slots with the other file paths.
    I'm not sure how much work would be involved, but maybe I could make a control in VB that would accept the drop event and output the path array I'm looking for. I've never made a control in VB for LabVIEW before, so I'm leary of how much time that would take. I'll add this to my list of "things to do that never seem to get enough priority to do."

Maybe you are looking for