Mousewheel -- How to get Event in a mouseListener.

Hi, i'm trying to scroll a table in a JScrollpane (with JViewport) by using the Mousewheel like you are used to in the windows enviroment.
My problem is that the Button_Mask2 is only triggered when you press the mouseWheel
like a Button.
So which modifiers must i check to get the correct Event for the Mousewheel.
Thanks in advance.
Michael
PS.: Please excuse my bad english.

Hi, thanks. But I'm using jdk1.3 at the moment.
Is here any possibilty in jdk1.3.x, or do i have to
move to jdk 1.4 which is still Beta yet.I'm affraid not. In jdk1.3 you can catch only mouse pressed, released, clicked, entered and exited events with the MouseListener interface, and mouse dragged and mouse moved events with the MouseMotionListener interface. If you can I suggest to use jdk 1.4. It has lots of new features.

Similar Messages

  • How to get event when app is minimized.

    How to get event when app is minimized in only windows app, not phone version.

    Hi,
    Suspending Event will be called when a windows store app is minimized. It will not hit the Suspending Event when minimised while debugging, So you need to trigger it manually from the VisualStudio Toolbar.
    Also Read
    Application Lifecycle for windows apps
    Pradeep AJ

  • How to get event when any library object added to indesign doc?

    I want to do some operation when any library object is added to doc. So please tell me how to get event when any library object is added to the doc. better provide some code snippet.

    Daves61,
    I need to clarify what kind of event you're interested in.
    1. When you click once on page/spead widget in the Pages panel and only widget becomes selected. The layout window remains unchanged. OR
    2. When you doubleclick on page/spread widget the selected master spread appears in the layout window.
    In the first case you work with Pages panel.
    Have a look to file PageTransitionsPanelObserver.cpp from SDK. 
    PageTransitionsPanelObserver::LazyUpdate()
    In the second case you work with Layout window.

  • How to get event.target/event.currentTarget for HTML-5 canvas for click handler

    Hi,
    I hope everyone is doing great.
    I belong to Actionscript background and just started on Flash CC HTML-5 canvas.
    How to get event.target or event.currentTarget in Flash CC for HTML-5 canvas for click event.
    Like we used to do it in AS 3.0
    btn.addEventListener(MouseEvent.CLICK , go);
    function go(evt:MouseEvent){
       trace(" evt - "+evt.currentTarget); // It will let us know the clicked target
    For  HTML-5
    btn.addEventListener('click' , go.bind(this));
    function go(evt){
       console.log(" evt - "+evt.????t); // what is the correct syntax here?
    Thanks,

    Hey guys found the answer from stackoverflow
    it is - evt.target

  • How to get event press ESC when plugin's GUI is flashUI

    Hi all
    I implement my plugin use GUI is FlashUI (CSExentersion suite).
    when I pressed ESC. My GUI close imidately.
    I want to check whe n ESC press. But I can't get event pressed key for ESC
    I think that my GUI close from Illustrator. But I don't know how to get event press ESC.
    Thank for your help.

    Put a trace() to print the keyCode into the stage's keydown handler and run your extension in debug mode of flash builder, you can check whether ESC is pressed or not.
    However, I don't know how to prevent extension from closing neither.

  • How to get event.columIndex on dragstart (before the actual drag)

    Hi there,
    I would like to know how to get event.columnIndex (ListEvent) when a drag starts within a datagrid.
    I need the index to get the value from a selected cell in a datagrid.
    It works with the itemClick handler (but then I have to click before dragging) on the datagrid but the DragEvent does not have a columIndex for de underlaying datagrid.
    Please advice and thanks.
    Grtz

    The dragStart event is a subclass of a MouseEvent that can be used in
    mouseEventToItemRenderer

  • Acrobat SDK: How to get events and write event handlers in c#

    I am trying out to get events from a pdf doc and handle it in my c# code with the samples that come with Acrobat-SDK. 
    I am yet to understand how I can do it. I am yet to discover the class that provides me the events. All the classes currently expose methods only. It might be that I am missing something for sure.
    Can somebody help?
    My use case is:
    the user will open a pdf doc and my application (or my app can trigger opening the pdf doc)
    when the user selects some text from the pdf doc, my app should get the event
    My event can handle the selection and get the selected text.
    Put a bookmark on the selection in the pdf doc (with additional attributes)
    the pdf doc retains such bookmarks when the pdf is saved.
    bookmarks in the pdf should be available for edit.
    A different app/code should be able to parse and retrieve these bookmarks along with the additional attributes of the bookmark.
    I hope, I have not asked too much.

    There are no “event handlers” for C# in the Acrobat SDK.  You will have to “poll” for things such as selected text.
    Also, I don’t know what sort of “additional attributes” you are thinking about, but that may or may not be possible from C#.

  • How to get event target?

    I've registered the following Hide event: 
    app.notifiers.add("Hd  ", ...file path);
    Now, how can get object that triggered the event?  [app.active document.activeLayer]  only give me the 'selected' layer.  This obviously does not work in a scenario where the user hides a layer that is not selected.
    I would appreciate any help!

    Action Manager does not have direct access to objects in the Object Model. It has it's own classes and object. Sometimes there can be a more direct access than by name. If the event descriptor had the layer index or ID you could use that instead of the name.
    Sorry, when I threw this together for you I only tested hidding layers that were not the activeLayer. I don't think the reason the alert is empty is because the top layer was hidden. I think it's because the activeLayer was hidden so the actionReference is different.
    Try this( seems to work for me with both )
    try {
        if (arguments.length >= 2) {
        var desc = arguments[0];
        var event = arguments[1];
        // make sure it's the hide event
        if (event == charIDToTypeID('Hd  ')) {
            // get the list of what was hidden
            var list = desc.getList(charIDToTypeID('null'));
            // get the actionReferences from the list
            var ref = list.getReference(0);
            var psClass = ref.getDesiredClass();
            // make sure it was a layer that was hidded
            if(psClass == charIDToTypeID('Lyr ')){
                // check to see what is in the reference
                var dataEnum = ref.getForm();
                // should either be an enum if activeLayer
                if(dataEnum == ReferenceFormType.ENUMERATED) {
                        alert(app.activeDocument.activeLayer.name);
                }else{// or the layer name
                    alert(ref.getName());
    } catch (e) {
      alert( "Error: " + e + ":" + e.line );

  • How to get event from message?

    Hi,All:
    I write a run-time interface by CVI, I use TS_EngineRegisterUIMessageCallback to register my callback function, but when message passed to the callback function, as the type is struct IDispatch but not CAObjHandle, I don't know how to read event from message.
    Can you help me to solve it? Thanks
    Chang Zhang

    Hello Chang-
    If your question is simply how to obtain an object handle from an object of type IDispatch, have you investigated the function "CA_CreateObjHandleFromIDispatch"? I would recommend you look over the testexec.prj that is installed along with the TestStand engine (the CVI Operator Interface) and inspect how we handle our callbacks, this may help you understand how to go about emulating the behavior in your own project. To see this particular function in use it may be most helpful to look in the file 'engine.c' and inside the function UIMessageDeferredCallback here you will see the IDispatch pointer being handled and decoded for use by the TS engine.
    Regards,
    Elaine R.
    Applications Engineering
    National Instruments
    http://www.ni.com/ask

  • How to get events from Jtextpane editable with graphic drawn on it ??

    HI,
    I have a Texpane with some string drawn on it at some interval according to scale.
    How do I get the event of click on it and make that particular character editable.

    Try adding a mouselistener to the pane
    appu

  • How to get event 'out of the class'

    I have been reading myself silly about this, I either don't get it or it is very difficult.
    What I want to do:
    1) setup
    2) show panel
    3) handle input in panel
    4) once valid
    5) "get out"
    6) display other panel.
    I can go all the way to 4.
    But I can't get "out" of the panel.
    All I can guess/understand is that I have to trigger an event that will be handled below/outside this panel.
    Has anybody some idea how to do this? Maybe a link to some example code?
    There is tons to read about event handling but the (only) part I understand is about events within classes just as all the examples are (One panel two buttons, two pictures etc)
    I guess the only option I might envision is dividing by zero and catching the error outside the panel.
    That would be bazooking a mosquito, but it also shows what I try to implement.
    I'd be so happy to understand this part of the 'java system' ...
    (please understand that I don't want 'cardlayout', I want to understand what I need to do)
    Much thanks for any help!

    Thank you for your suggestion.
    My problem is that I am (feel?) stuck within the panel.
    So to put it differently, I cannot build a child panel with a button (in the child) that will have the parent pane change color. This as my 'code focus' is within the child panel and I cannot 'activate' code outside it.
    I am totally confused now as to how java works.
    So I cannot write a parent pane with a child pane where the child tests for a name and if the name is correct the child will be removed and some code will put in another child pane with fi a picture.
    This seems so utterly basic to any programmers needs, but I cannot find one example - or I have gone blind looking for it. In my code if I want to read the input field I have to handle it within the child pane, if I want to change child panels I need to do that in the parents panel code. But I can't change the code focus. So the child needs to generate an event that the parents can act upon, but there are no examples while I actually expect tons of examples. So maybe I don't speak 'Java'.
    This meaning that I cannot write a stack of panes and remove them one by one using fi the escape key.
    I am just left clueless by Java.

  • How to get event source from value property changed handler?

    I am relatively new to JavaFX, so perhaps this is an easy question to answer. I am creating in Java code several (e.g., 5) ChoiceBox instances. I add a handler for when the value of the ChoiceBox changes. My code:
    ChoiceBox<String> rpmSelector = new ChoiceBox<>();
    ObservableList<String> rpmSelectorItems = FXCollections.observableArrayList();
    rpmSelectorItems.add(ALL_RPM);
    for (Double engSpeed : engSpeeds) {
        rpmSelectorItems.add(String.format("%.0f", engSpeed.doubleValue()));
    rpmSelector.setItems(rpmSelectorItems);
    rpmSelector.getSelectionModel().selectFirst();
    rpmSelector.valueProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> obsValue,
                String oldValue, String newValue) {
           // How can I get the ChoiceBox that was the source of this event?
    });My question is: in the "changed" method, how do I determine which of the ChoiceBox instances had its value changed?
    Thanks!
    Chris
    Edited by: 976245 on May 15, 2013 1:05 PM
    Edited by: 976245 on May 15, 2013 1:05 PM

         My question is: in the "changed" method, how do I determine which of the ChoiceBox instances had its value changed?You have only one ChoiceBox control. Probably you want to get the selected item. If it is the case you can get it through selectedItemProperty(),
    selectedIndexProperty(), and valueProperty()
            rpmSelector.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
                public void changed(ObservableValue<? extends String> ov, String old_val, String new_val) {
                    System.out.println("Selected item is: " + new_val);
            rpmSelector.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> observableValue, Number oldv, Number newv) {
                    System.out.println("Selected index is: " + newv.intValue());
            rpmSelector.valueProperty().addListener(new ChangeListener<String>() {
                public void changed(ObservableValue<? extends String> ov, String old_val, String new_val) {
                    System.out.println("Selected   value: " + new_val);
            });

  • How to get event source in phaselistener

    Hello:
    Is there a way to get the event source in the phaselistener ? I need to get the acion / action listener method name that will be executed for the current request in the phaselistener. Any pointers will be really helpful.
    thanks and regards,
    -- Kannan

    Try:
    JSF<h:commandButton action="#{myBean.actionMethodName}" value="submit" />PhaseListenerpublic void beforePhase(PhaseEvent event) {
        if (event.getPhaseId() == PhaseId.INVOKE_APPLICATION) {
            FacesContext context = event.getFacesContext();
            Set componentIds = context.getExternalContext().getRequestParameterMap().keySet();
            String action = null;
            for (Iterator componentId = componentIds.iterator(); componentId.hasNext();) {
                UIComponent component = context.getViewRoot().findComponent((String) componentId.next());
                if (component instanceof UICommand) {
                    action = ((UICommand) component).getAction().getExpressionString();
                    break;
            // action = #{myBean.actionMethodName}
    }or:
    JSF<h:commandButton action="#{myBean.actionMethodName}" value="submit">
        <f:attribute name="method" value="actionMethodName" />
    </h:commandButton>PhaseListenerpublic void beforePhase(PhaseEvent event) {
        if (event.getPhaseId() == PhaseId.INVOKE_APPLICATION) {
            FacesContext context = event.getFacesContext();
            Set componentIds = context.getExternalContext().getRequestParameterMap().keySet();
            String method = null;
            for (Iterator componentId = componentIds.iterator(); componentId.hasNext();) {
                UIComponent component = context.getViewRoot().findComponent((String) componentId.next());
                if (component instanceof UICommand) {
                    method = (String) component.getAttributes().get("method");
                    break;
            // method = actionMethodName
    }

  • How to get event's application log handle for application log mssg

    Hi,
    I would like to get the application log handle for an event call, can someone pls help.
    Rgds.

    Hello wong ,
    Did u get the solution for this respective query.
    if so can u please send it to me also .
    i am struck over with the similar problem.
    Thanks,
    pavankumar.

  • How to get event name in runtime in the method ?

    i  found that there is a &_WORKITEM.OBJECTTYPE.EVENTS.NAME& element in thw workflow contained. then i do a binding from this element to another element with the same type as &_WORKITEM.OBJECTTYPE.EVENTS.NAME&.
       then in the method i use swc_get_element container 'NAME'  name.
      to get the event name in runtime.
      but when i test it in SWUE, it gives error.  If i remove this statement, it is oK
    ANY advice?

    Hello Gang,
    _WORKITEM is a workitem object
    OBJECTTYPE is its type (WORKINGWI for dialog steps)
    EVENTS is a multiline attribute (all events for this type of object: processed, created and deleted in our case /events of WORKINGWI/)
    I don't think that is what you need.
    You got an error, cause you link a multiline element to a single one.
    If you need an access to the TRIGGERING event name, the best is to bind an event name when it is triggered (or e.g. check an event name in the check FM if it is sufficient for your requirement).
    Regards,
    Michal

Maybe you are looking for