event-dispatching

Chrome doesn't fire click event for SVG element (Firefox does)

别来无恙 提交于 2020-01-15 04:35:48
问题 I observe inconsistency/bug in handling click event among various browsers (Chrome, Edge, Firefox). In my JavaScript library that uses SVG I create clickable and draggable rectangles. When I run my snippet in Chrome browser the click event is not firing if 2 or more elements are present on canvas. To check this you need to create at least 2 rectangles on canvas. You can drag them with mouse (Rectangles initial position is the same). Normally rectangle's border become brown if click event was

Whats the appropriate form when dispatching events in AS3?

二次信任 提交于 2020-01-02 13:15:15
问题 I was wondering what the appropriate form was when creating custom events? Should one create a CustomEvent class, and then create a temporary dispatcher in the function, and dispatch the CustomEvent. or is it better to attempt to create a CustomEventDispatcher class, and create the CustomEvent class as an internal class of that class, eg: package { public class CustomEventDispatcher extends EventDispatcher { public function CustomEventDispatcher() { super(new CustomEvent()); } } } class

dispatchEvent not preforming event, but returns true

不问归期 提交于 2019-12-22 17:40:28
问题 On MDC's site they have a cool demo of dispatchEvent that works fine in my chrome 15. I'm trying to take an event object and pass it into dispatchEvent, and have set up a simple case here where you record events as an array then will replay them. In essence, I set up a window listener for click, and then preform window.dispatchEvent(recordedEvent) . I'm unable to determine why my event object from the event listener will not preform the same way as the event from initMouseEvent in the MDC

Firefox 5 dispatchEvent not working

爱⌒轻易说出口 提交于 2019-12-20 02:16:04
问题 I have some code that uses dispatchEvent to simulate clicks and the same exact code works fine in Chrome but doesn't work in Firefox. Here's the code: var evt = document.createEvent("MouseEvents"); evt.initEvent("click",true,true); jQuery("a:contains(Next)")[0].dispatchEvent(evt); I'm clicking on a link that loads another page and the page loads fine in Chrome but Firefox does absolutely nothing when I run this code in Firebug or even when I execute it as a bookmarklet. I've also tried the

Updating swing components correctly?

会有一股神秘感。 提交于 2019-12-18 08:34:39
问题 I'm new to swing, any help appreciated. In this piece of code I'm turning a card over face up, if it turns out that they don't match I want them to turn back face down again. At the moment what is happening: 1. when clicked the first card turns over 2. when a second card is clicked either of two things happen (a) if they are the same they both stay up which is what I want (b) if they are not the same I never see the 2nd card at all as it immediately re-displays the back of the card (and the

Updating swing components correctly?

二次信任 提交于 2019-12-18 08:33:59
问题 I'm new to swing, any help appreciated. In this piece of code I'm turning a card over face up, if it turns out that they don't match I want them to turn back face down again. At the moment what is happening: 1. when clicked the first card turns over 2. when a second card is clicked either of two things happen (a) if they are the same they both stay up which is what I want (b) if they are not the same I never see the 2nd card at all as it immediately re-displays the back of the card (and the

Swing Worker Modal Dialog Won't Close

*爱你&永不变心* 提交于 2019-12-14 02:14:00
问题 I have a SwingWorker thread that launches a modal dialog box (from a property change listener that listens to the StateValue of started) and the swing worker proceeds to do its work. However, it looks like the done method is not called because that is called on the EDT but the swing worker's modal dialog is blocking the EDT. So, I can't close the dialog from the EDT (or from the done method). Right now I'm just closing the dialog from the doInBackground at the end of that method, but that

Sending ArrayCollections via P2P Flex

社会主义新天地 提交于 2019-12-13 18:08:57
问题 I have a question regarding P2P with flex. When passing data between two applications using P2P. I get the following error: warning: unable to bind to property 'piece' on class 'Object' (class is not an IEventDispatcher) I've spent a few days using Google to try and find a solution, but a can't get rid of that error. I've tried using ObjectUtils, direct assignment, and creating a new ArrayCollection WITH the ObjectUtils inside the parenthesis and still can't solve the problem. Purpose of code

Java Swing : How to invoke stopCellEditing() before TreeListeners:valueChanged?

怎甘沉沦 提交于 2019-12-11 03:56:01
问题 This is a follow-up to these earlier questions: How to stop editing with DefaultCellEditor when a separate JBtton is pressed Sun Bug 4724980: JTable: Add API to control what happens to edits when table loses focus. When I use the terminateEditOnFocusLost property, like below, my CellEditor correctly stops editing when the table loses focus: jtable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); It also works with my JButtons. The stopCellEditing() method is called for my

In Java how do I repaint a panel from an actionPerformed thread while it is currently running?

不问归期 提交于 2019-12-07 09:38:27
问题 I have a class (called Class_GUI) which has a panel with lots of buttons on it. Class_GUI has some methods that change the text and colour of the buttons. I have also have a program with the actionPerformed method. When this is called it creates an instance of Class_GUI and repeatedly calls Class_GUI methods, changing the buttons etc. The issue I'm having is that the buttons only display properly once the actionPerformed method has finished entirely whereas I want it to change after each