Attaching a mouse event to the SeekBar component's SeekBarHandle

Hi, I'm trying to attach a MouseEvent to the SeekBarHandle inside the SeekBar component.
I've tried this and it doesn't work:
flvPlayer_mc.seekBar = seekBar_mc;
flvPlayer_mc.seekBar.seekBarHandle.addEventListener(MouseEvent.MOUSE_OVER, doSomeThing);
and I've also tried this and it doesn't work:
flvPlayer_mc.seekBar = seekBar_mc;
seekBar_mc.seekBarHandle.addEventListener(MouseEvent.MOUSE_OVER, doSomeThing);
Thanks!

May be this can help you:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00000585.html

Similar Messages

  • Get all mouse events no matter what component the mouse is over

    Is there anyway to get all the mouse events, in for example, an applet? Usually, the only component that recieves the mouse event is the component which is being hoverred by the mouse. Is there anyway to just get all the mouse events without adding listeners to every component?
    Problem:
    Well, the real problem is that I have an Applet, that the componentCount() method returns 0. I want to get all mouse events on the applet, but if I just do a appletInstance.addMouseListener(this), it doesn't recieve the mouse clicks. It does however, get mouse exit and mouse enter events.
    Thanks for any support.

    Use an AWTEventListener:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=727731&start=1

  • How to deal with the mouse events when the thread is running

    Hi everybody,
    I have a problem with my program.
    Now I want to present a picture for some time in the Canvas,then automatically clear the screen, but when the user press the mousebutton or keybutton, I want to stop the thread and clear the screen.
    How can I receive the mouse event when the thread is running?
    Thanks,

    I use my code in a GUI applet.
    I try to use the code tag, it's the first time.
                   Image im=sd.getStimulus(obj);
                   if(pos==null){
                        g.drawImage(im, (w-im.getWidth(null))/2,(h-im.getHeight(null))/2,null);
                   }else{
                        g.drawImage(im, pos.x,pos.y,pos.w,pos.h,null);
                   try{
                        sleep(showtime);
    //                    Thread.sleep(showtime);
                   }catch(InterruptedException e){}
                   if(pos==null){
                        g.clearRect((w-im.getWidth(null))/2,(h-im.getHeight(null))/2,im.getWidth(null),im.getHeight(null));
                   }else{
                        g.clearRect(pos.x,pos.y, pos.w, pos.h);
                   }

  • How to get mouse events inside the components of a JTable

    Hi!
    I have question, I think this is related to very basics of swing, however I couldn't find a solution/answer on the web.
    I have a JMyTable(a descendant of JTable), and one value on a row/column is a special class, ie. MyClass. for this class I registered a cell renderer, MyRenderer. and this renderer returns a JMyComponent, which is actually a descendant of JComponent.
    Now, if I call enableEvents(AWTEvent.MOUSE_EVENT_MASK) in the constructor of JMyTable I get events posted on processMouseEvent method. However, the same doesn't work for JMyComponent. I mean, I call enableEvents, however processMouseEvent method is not triggered.
    Could someone explain/help me with this issue?
    Thanks,
    Ozgur

    Your cell renderer components are just that: renderers. They're not added to the table and do not appear in the component hierarchy. This is because tables may be very large and adding components in would be very resource hungry.
    See here for details
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    If you want to detect events you will need to listen to events on the JTable itself, and use the rowAtPoint()/columnAtPoint() methods to determine the cell. So for instance where you might want mouseEntered() on your cell component you would have to use mouseMoved() on the table and detect when the cursor moves to a new cell.

  • How can I make only the shape active for the mouse events, not the whole box around it?

    I want to create mouse over events for different parts of an image (say of a hard disk drive), so when the user places their mouse over the spindle, say, it will change colour.
    At the moment I have it working however the event is triggered when ever the mouse is in the bounding box of the spindle image. How can I get it to only be triggered when it is above the non transparent part of the image (or symbol)?

    Thanks joris182, but that wont work when there are other objects within the bounding box of the transparent symbol. For example, if I want the sclera to highlight, if I use an invisible shape over it, it will be active even if someone has their mouse over the vitreous body.

  • Mouse Events at the icon in systray.

    My program call library function to add, modify or delete icon into systray.
    Additionaly I'd like to get back information when any mouse event had happen under icon in systray like move mouse, right/left button click etc. to display popup menu (as an standart behaviour).
    I've tried Windows Message Queue, but it only works inside application window area.
    How could I do it ?
    Any suggestions, examples or advises ?
    Rumcajs.

    Requirements    Price: $29.95
     Application Software:
    LabVIEW 7.0+
     Toolkits Software:
     Additional Software:
     Language's:
    LabVIEW
    INVtray LabVIEW Toolkit allows the programmer to create a LabVIEW program that can be hidden from the task bar and accessed through the System Tray.  Comes with a sample VI that demonstrates all the features of the toolkit.

  • How to catch the mouse event from the JTable cell of  the DefaultCellEditor

    Hi, my problem is:
    I have a JTable with the cells of DefaultCellEditor(JComboBox) and added the mouse listener to JTable. I can catch the mouse event from any editor cell when this cell didn't be focused. However, when I click the editor to select one JComboBox element, all the mouse events were intercepted by the editor.
    So, how can I catch the mouse event in this case? In other word, even if I do the operation over the editor, I also need to catch the cursor position.
    Any idea will be highly appreciated!
    Thanks in advance!

    Hi, bbritta,
    Thanks very much for your help. Really, your code could run well, but my case is to catch the JComboBox event. So, when I change the JTextField as JComboBox, it still fail to catch the event. The following is my code. Could you give me any other suggestion?
    Also, any one has a good idea for my problem? I look forward to the right solution to this problem.
    Thanks.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test3
    extends JFrame {
    // JTextField jtf = new JTextField();
    Object[] as = {"aa","bb","cc","dd"};
    JComboBox box = new JComboBox(as);
    public Test3() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    String[] head = {
    "One", "Two", "Three"};
    String[][] data = {
    "R1-C1", "R1-C2", "R1-C3"}
    "R2-C1", "R2-C2", "R2-C3"}
    JTable jt = new JTable(data, head);
    box.addMouseListener(new MouseAdapter() {
    // jtf.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent e)
    System.out.println("-------------------JComboBox mouseclick....");
    jt.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent e)
    System.out.println("-------------------JTable mouseclick....");
    // jt.setDefaultEditor(Object.class, new DefaultCellEditor(jtf));
    jt.setDefaultEditor(Object.class, new DefaultCellEditor(box));
    content.add(new JScrollPane(jt), BorderLayout.CENTER);
    setSize(300, 300);
    public static void main(String[] args) {
    new Test3().setVisible(true);
    }

  • Event case missing mouse events on active-x component

    I am using a Treeview and capturing selections in the tree using mouse events (event structure). I have a problem where approx 3 out of 15 mouse events are not actioned by the event structure - has anyone else had this problem or is there any suggestions?
    Thanks.

    Could you post a copy of your code that demonstates this?
    I have experimented with this control and its events.
    We may be able to help if we have soething to look at.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Calling multiple actions in a single event of the adobe component

    Hi ,
    We have a requirement to call both these events
    Java script
    ========
    1)app.eval("event.target.SAPValueHelp(\"" + this.somExpression + "\");");
    2)app.eval("event.target.SAPCheckFields();");
    on the <b>enter</b> event of drop down list on adobe form.
    Is this is possible or let me know some alternative to fire these two events to webDynpro application ?
    Regards,
    Nanda

    Well, I don't really like these theroretical discussions. Can you attach a simplified version of some of your code?
    There are many other ways to identify the particular control. You could for example search an array of references for the value of the "ctlref" event data node. This would make the code much more robust (your code will fail for example if you (or some other programmer updating your code in a few years!) notices a mispelling and edits the label without also changing the case structure cases).
    LabVIEW Champion . Do more with less code and in less time .

  • How to process mouse event in the Label control?

    I am now tring a MorphFx program which would like implements a Squeak-Like-Morph operation for JavaFX nodes( include shapes, controls and others). currently it is only a prototype on [http://code.google.com/p/wangzaixiang/wiki/MorphFx]
    and there is webstart demo: [http://wangzaixiang.googlecode.com/svn/trunk/LearnJFX/dist/LearnJFX.jnlp]
    and a applet demo: [http://wangzaixiang.googlecode.com/svn/trunk/LearnJFX/dist/LearnJFX.html]
    There is a problem for new created Label control, which dont fire the "onMousePressed" or other "onMouseXXXX" event, and i have not found any way to do that.
    Can somebody tell me how can i add a onMousePressed event to a label and make it works?
    Very thanks.

    I can confirm the same behaviour when you try to capture eg the mouse clicking events on a progress indicator (also MouseMove). These kind of things are a bit useless most of the time in apps, but nevertheless in fact their event listeners should be correctly implemented or otherwise well documented if not. And in my opinion the javaFx API as well as the language specification/documentation can be far more written in details as it is now. So actually I don't know if SUN wanted that kind of behaviour for controls like that or not.
    Somebody from the javaFx SUN team can answer perhaps ?
    PS
    Of course a workaround with shadow node behind works well if the events will propagate through the label. I didn't test it but think this will work.
    -G
    Edited by: guyvo on Jan 19, 2010 1:50 PM
    Edited by: guyvo on Jan 19, 2010 1:55 PM

  • Blocking event for the particular component

    Dear All,
    If we opened the modal dialog, all the other components will be blocked. That means the events generated for those components will be consumed by the EventDispatchThread. But my requirement is blocking speciifc set of components (not all in jvm ). How can i do that. Please help me in this regard.
    Thanks and Regards
    V.S.Saravanan

    You understanding of modal dialogs is not true. This is done otherwise: when you invoke modal dialog to be shown, it's method is invoked, a new new event pump is created and run. This pump services only this dialog, while, since show method is still executing, main pump is fozen. So there is no "blocking of selected components" mechanism availble in that point.
    You may however try to use protected disableEvents method of Component to block events.

  • How do I pass an event up the component hierarchy?

    I have a child component which has a mouse listener and a parent component with a mouse listener. However the child component consumes all the mouse events so the parent doesn't get them.
    Is there a way for a child component to receive mouse events, then decided to pass them back up the component hierarchy so the parent can still receive them too?
    I've spent the last two hours on Google and can't seem to find anything relevant.
    Cheers, Eric

    Unfortunately, you cannot
    override this method since it ispackage-private.
    That was wrong of mine. Package-private members are
    visible to subclasses too (the package access is a
    complete superset of protected access). So you CAN
    override dispatchEventImpl and do your stuff there.
    When I try that the compiler gives me the following warning
    The method SheetElementPlacementComponent.dispatchEventImpl(AWTEvent) does not override the inherited method from Container since it is private to a different package.
    It lets me define the method, but does not let me override it.
    I just wonder why they made dispatchEvent() final,
    when it just calls dispatchEventImpl(), and it is
    not final...
    Another useful method is Component.enableEvents()
    and disableEvents() (which are both protected). You
    can use them to modify the so called event mask of a
    component, which is used to signify which events a
    Component is interested in. Disabled events (= not
    on the event mask) are not delivered to the
    component and the dispatcher skips it, looking for
    parent components which have enabled the event. For
    example, if you have a JButton in a scroll pane and
    you scroll the mouse wheel on the button, the event
    is dispatched to the scroll pane, even though it
    occurs over the surface of the button. That's
    because a button is not interested in mouse wheel
    events.
    You can use that hack the following way: In the
    mouse listener for your child component, after you
    have done your work, disable mouse events for the
    component and then post the event again (invoke
    dispatchEvent(theEvent)). That way, the event should
    be delivered to the closest parent that is
    interested in mouse events. This is done
    synchronously, so after all listeners for the parent
    components have finished, the dispatchEvent() method
    returns in your listener for the child component.
    Then you re-enable mouse events on the child
    component in order to receive the next mouse event.
    I don't know if this works or if it has any side
    effects, but it's worth a try...I can't call dispatchEvent() because it creates an infinite loop resulting in a stack overflow. It tried calling((JComponent) getParent()).dispatchEvent(e); but this does not help either, the parent never gets the event.
    Hope this helps you more :).
    Greets,
    MikeSorry, I still can't find a way around it other than to redesign my UI.
    FYI I created a bug report and Sun have assigned it Bug Id: 6571453. Everyone please vote on this if you think it's a cool feature request.
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6571453
    Cheers, Eric

  • Inappropriate mouse event coordinates in the WebKit of HTMLLoader/StageWebView

    Hi,
    We have a desktp application which incorporates an HTMLRichTextEditor (implemented in HTML/JS and loaded into AIR).
    We have run into a big problem with text selection though. It seems that the both the HTMLLoader and the StageWebView are passing wrong mouse coordinates to the WebKit when the cursor is outside of the component.
    I've created a sample application which uses mx:HTML (which is a wrapper of the HTMLLoader) and a WebView class (a wrapper aroun StageWebView reference to which is given here).
    The application is located here in Dropbox. The source code of the app is here.
    The app was built with Flex 4.6 and ran in AIR 3.7
    The sample app has a WebView which loads loremipsum and HTML loading some dummy local HTML page. The HTML page uses the JS->AIR bridge to report the mouseevents to a function in AIR. In the snapshot below the selection was started from the first row and then slowly continued to the left. As soon as it reaches the green area the selection changes unexpectably. As it can be seen in the bottom right -> the WebKit has received a mouse event with incorrect coordinates. The reported mouse coordinates seem to be the mouse coordinates within the green component and the selection behaves like that. If the mouse is moved to the blue - the selection changes again (according to the coordinates in the blue area).
    The component which uses the StageWebView behaves in absolutely the same way.
    I'd assume that I have to post a bug but I decided to post here at first.
    I've tried a few workarounds in order to stop and ongoing selection or to change it's behaviour but none of them with any relevant success. Even disabling mouse children for the entire application has no effect on the selection once it's started.
    Any help and/or comments would be much appreciated.
    Thanks !

    Thank you for the heads up.  Do you know if this is a recent change in behavior with AIR (ie. does this occur in previous versions)?  Regardless, could you please open a new bug report on this over at bugbase.adobe.com? 
    Once added, please post back with the URL so that others affected can add their comments and votes and I can follow up internally.
     

  • Having picked up a mouse event, pass it to parent component.

    This is further to my table cell hover, which is otherwise working.
    I track the mouse accross the table using an invisible child component, and when the mouse leaves it, move the child onto the new cell position.
    The problem is that, while the mouse is over the invisible component, that component is grabbing all the mouse events. My table also wants to detect mouse events (though it's interested in clicks).
    The obvious thing is, after they've been dealt with and the child component level, to transfer the events to the table (having mapped the mouse coordinates). However all the processEvents methods in components like JTable are protected.
    I suppose I could extend JTable and add a method to get arround protected, but that's nasty, especially since a lot of my JTables are already subclassed.

    I had to do just this. I have JLabel's in a JPanel. The JPanel is in a LayeredPane. When I mouse over the JLabels, they grab the mouse events... which I don't want. I want the LayeredPane to get it.
    So in the JLabel, I do:
          * Don't send to parent what you don't have to. Things like tooltips will
          * be broken if this is not handled carefully...
         public void mouseClicked(MouseEvent e) { }
         public void mouseMoved(MouseEvent e) { }
         public void mouseEntered(MouseEvent e) { }
         public void mouseExited(MouseEvent e) { }
         public void mouseReleased(MouseEvent e) { machine.dispatchToParent(e);}
         public void mouseDragged(MouseEvent e) { machine.dispatchToParent(e);}
         public void mousePressed(MouseEvent e) { machine.dispatchToParent(e);}(the "machine" above is a JPanel). Now in the JPanel, aka "machine", I do:
    Point point; int comp_x, comp_y; // for component with respect to this machine
    public void dispatchToParent(MouseEvent e) {
         point=((JComponent)e.getSource()).getLocation();
         //System.out.println("Dispatching: " + e.getX() + " " + e.getY());
         //System.out.println("Component position: " + ((JComponent)(e.getSource())).getLocation());
         if (e.getButton() > 0) MsgIFrame.println("ME at: " + comp_x + "," + comp_y + " button: " + e.getButton() );
         if (e.getButton() > 1) {
              popup(e);
              return;
         comp_x=(int)point.getX(); comp_y=(int)point.getY();
         comp_x+=this.getX(); comp_y+=this.getY();
         e.translatePoint(comp_x, comp_y);
         room.getLayeredPane().dispatchEvent(e);
    }Above, the "room" is a JInternalFrame with a LayeredPane inside it, as you can see. I do a little translating so the LayeredPane gets the event in its coordinate space, not those of its Components.

  • Iocane: poison the rodent (simulate X11 mouse events from keyboard)

    Iocane: the colorless, oderless, tasteless poision that will rid your system of its rodent infestation.  Though no promises about its effectiveness against Rodents Of Unusual Size.
    Iocane simulates mouse events from the keyboard.  Iocane can be passed a few parameters which - ideally - could each have a key binding in your favorite window manager.
    If iocane is called with no parameters it starts in interactive mode (which currently lacks documentation ... hey, I just wrote this this morning).  In interactive mode the directional arrows or h/j/k/l keys move the mouse cursor.  The number keys simulate button presses (1 = left button, 2 = middle, 3 = right).  The page up and page down keys simulate mouse wheel activation.  "q" quits from interactive mode returning any grabbed keys to their normal behavior.  Key bindings are all controlled from a simple rc file.
    Iocane can also be passed a series of commands on the command line or the filename for a script file with a list of iocane commands.  Iocane can also read command from its standard input.
    Iocane is conceptually similar to some functions of xdotool, but iocane should work under any window manager (or no wm at all), is much smaller, and the interactive mode allows for a sequence of many actions without the program having to start up and close down many times in rapid succession.
    Please report bugs or feature requests here.  Iocane is currently 127 lines of C, and it will remain small; in other words, features will only be added if the can be added without substantially increasing resource use.
    EDIT: Version 0.2 is now in the AUR
    Last edited by Trilby (2012-11-03 02:23:15)

    Any arbitrary number of buttons should be easy enough to simulate - provided the Xserver actually responds to events with that button number.  An update I'll push to github tomorrow will include a few changes, including buttons 1-9, but if there is need/desire I could increase that.  Sticking to 1-9 allows for the computationally cheaper hack of converting a string to a number by simple substracting 48 from the value of the first character; numbers greater than 9 would require the use of atoi() or some funky conditionals.  In the grand scheme of things this is fairly trivial, but unless there is a real reason to use more than 9 mouse buttons I'd prefer to keep the lighter code.
    Passing a window name and getting it's coordinates is possible but after considering it I've decided it wouldn't fit well in iocane.  The reason being that to do a half-arsed job of it would be pretty easy.  To do it properly, however, it would take quite a bit of scanning through recursive calls to XQueryTree, polling atoms/wmhints, matching strings, checking for subwindows in the case of reparenting window managers, and a bunch of other nonsense ... all to get two coordinates.
    However iocane will play nicely with any tool that will provide those coordinates from a given window name, so I can imagine and invocation such as the following to move the mouse 10 pixels right and down from the top left of a window - lets call it FlamingSquirrel - and simulate a click there:
    iocane $(cool_app FlamingSquirrel) : move 10 10 : button 1
    Currently that could only be done from a command line invocation, not from a script or interactive session, as it requires shell processing for the command substitution.  I can add support for this type of invocation in scripts and interactive mode as well.  Then all you need to do is find (or write) a program that will give coordinates for a window given a title/name.  I suspect such a program probably exists out there, or if you are comfortable with C, I could give you the starting framework for it as I made something that would have much code in common for another task on these forums (it's in jumpstart.c in the "misc" repo on my github).
    In fact, you could use the following
    xdotool mousemove --window FlamingSquirrel 0 0 && iocane offset 10 10 : button 1
    Though if you are using xdotool anyways, I'm not sure if iocane would serve much of a purpose, unless you just prefer iocane's syntax.
    Last edited by Trilby (2012-11-01 00:21:14)

Maybe you are looking for

  • Title Bar stuck under the Menu bar and I cannot select and move it.

    I often arrange windows around the desktop and sometimes I inadvertently push a window up too far and the title bar gets under the menu bar. Once I let go of the arrow, the title bar is too far under the menu bar and I can no longer reach it to move

  • How to create a new sales order to internal requisition?

    Hi, All Need help!!! How to create a new sales order to internal requisition? The internal requisition has generated order sales but this has already been canceled, so I need to create a new sales order to the same internal requisition. How to releas

  • ICloud Driver folder will not open in Finder on click

    Hi, Everything's working great for me, except for one thing: 1. I open Finder 2. I click on iCloud Driver from the left pane. Nothing happens. To open iCloud Drive I: 1. Open Finder 2. Right-click on iCloud Drive and select "Open in New Tab". Only th

  • Adobe Acrobat automatic update

    Acrobat automatically downloaded an update that I don't want to install. How do I keep the update that is already downloaded to my computer from installing. There is a pop up window that asks me if I want to install the update. I would like to delete

  • Trial Photoshop elements

    Elements 13 trial download.I am an Elements 10 user and wanted to evaluate Elements 13. I downloaded and set up a trial Elements 13. The CR2 RAW files are missing from the Elements 13 setup. How do I import all my Elements 10 files, including their C