How to handle doubleclick mouse event in java

i want to handle double click mouse event in java
i use getClickCount() function
but i want that on onetime click show othere windows
and on doubleclick show diif. window
but problem is that onetime is occuer always if u click doubleclick

Maybe post some code so we can see what, if anything, you are doing wrong.
Examing the results of a call to getClickCount() is the correct way to detect a double click.

Similar Messages

  • How to handle Text  change event in text box in SAP B1

    Hello Expert...
    How to handle Text  change event in source.
    Please define the Event when i change the text in textbox..
    currently i am using the Lost focus event but it is only occur when tab focus lost from that text box.
    So please required solution ASAP..
    Regards,
    Abhinav Lalpurwala
    Edited by: Abhinav Lalpurwala on Aug 5, 2011 3:19 PM

    Hi,
    Catch the et_VALIDATE event, when InnerEvent = False and ItemChanged = True.
                If pVal.EventType = BoEventTypes.et_VALIDATE Then
                    If pVal.InnerEvent = False And pVal.ItemChanged Then
                        'TODO Your code here...
                    End If
                End If
    Regards,
    Vítor Vieira

  • How to handle double click event in a text control

    Hi,
       Will u please send me information on handling double click events inside text control and also about locking and unlocking of DB tables for updation.
    Regards,
    Praba.

    Hi Prabhavathi,
    Here is how you handle double click events in Textedit control.
    1)Create a custom control in screen (say TEXT_CONTROL)
    2)In main program,
    a) Declarations:
    data: obj type ref to cl_gui_custiom_control.
          text type ref to cl_gui_textedit.
    b) Create the instance of custom container
    c) Create the instance of textedit control.
    3)Now to handle double click events , create a local class as follows.
    class shail_event definition.
    public section.
    methods:
    handle_doubleclick for event dblclick of cl_gui_textedit .
    endclass.
    class shail_event implementation.
    method handle_doubleclick .
    here do the coding for handling the double click.
    endmethod.
    endclass.
    4) Create an instance of the handler class(ie.ZSHAIL_EVENT).Let it be named hand.
    5) Define varibles for event.
    DATA: i_events TYPE cntl_simple_events,
          wa_events TYPE cntl_simple_event.
    SET HANDLER hand->handle_doubleclick for text.
    wa_events-eventid = cl_gui_textedit=>event_double_click.
    wa_events-appl_event = 'X'. "This is an application event
    APPEND wa_events TO i_events.
    6)
        CALL METHOD texte->set_registered_events
          EXPORTING
            events                    = i_events
          EXCEPTIONS
            cntl_error                = 1
            cntl_system_error         = 2
            illegal_event_combination = 3
            OTHERS                    = 4.
        IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    These are the basic steps needed for handling events in Textedit control.You can go to SE24 and type CL_GUI_TEXTEDIT to find the associated events of the class.
    If you want the program, kindly send your mail-id so that I can mail it to you.
    Regards,
    Sylendra.

  • 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..

  • How to handle form close event or escape key press event for user defined f

    Experts,
    Please let me know how to handle form close event or escape key press event for user defined form...
    Thanks & Regards,
    Pravin.

    Hi
    You can catch the form close event like this
    If ((pVal.FormType = 139 And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)) And (pVal.Before_Action = True)) Then
          Try
                   SBO_Application.SetStatusBarMessage(pVal.EventType.ToString())
          Catch ex As Exception
                    SBO_Application.SetStatusBarMessage(ex.Message)
            End Try
          End If
    Hope this helps
    Regards
    Arun

  • 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);
    }

  • How to capture Wnidows(OS) event from Java program

    Hi,
    I am developing one application , in that if the user didn't do any thing in 15 mins,i need to log out from my application(not windows).Here i need to check Java event as weel as windows(OS) events also.Any one knows how to capture the OS events??

    I want to know the status of mouse and keyboard(Windows 2000).If the status of the mosue or keyboard doesn't change from 15min i need to log of the java application.

  • How to throw the mouse event to a upper level component?

    For example: a panel using absolute layout, and there is a label on it.
    Now when mouse clicked on the label, i do not want the label but the panel to get the mouse event , so that i can get the mouse click point's x and y in the panel.
    How to implement it?
    Thanks a looooooooooooot for ur help
    Best Regards

    try this
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Testing extends JFrame
      public Testing()
        setSize(100,75);
        setLocation(300,200);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        final JPanel p = new JPanel();
        JLabel lbl = new JLabel("Click Me");
        lbl.setToolTipText("OK");
        lbl.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        p.add(lbl);
        getContentPane().add(p);
        lbl.addMouseListener(new MouseAdapter(){
          public void mousePressed(MouseEvent me){//match method name
            p.dispatchEvent(me);}});
        p.addMouseListener(new MouseAdapter(){
          public void mousePressed(MouseEvent me){//with this method name
            System.out.println("Panel clicked");}});
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • Capturing desktop mouse events in java

    hi,
    i want to capture mouse events running outside JVM,how do i get
    it.example if click on some application for opening it.how will i get it in my java prog.
    bye

    There is an example,it works well .
    import java.awt.*;
    public class CatchMouse {
         public static void main(String[] args) {
              int limit=10;
              Point mp=null;
              for(int i=0;i<limit;i++){
                   mp=MouseInfo.getPointerInfo().getLocation();
                   System.out.println(mp.x+","+mp.y);
                   try{
                        Thread.sleep(500);
                   }catch(InterruptedException ie){
    }I hope it can help you.

  • How to handle value change events of select list in custom component?

    My HelloUIComp code...How to handle events for "Select"...if i choose option1 from select then one text box is to be displayed in custom component and if i choose another option then some other text box is to be displayed in custom components...
    public class HelloUIComp extends UIComponentBase {
        public static final String account="custom.account";
        public static final String RENDERER_TYPE = null;
        HtmlCommandButton button = createButton();
        //HtmlSelectOneMenu select=createSelect();
        public void processDecodes(FacesContext context) {
             Calling the lifecycle method "processDecodes" on the
             internal button is absolutely critical to create action events
             button.processDecodes(context);
             super.processDecodes(context);
        private HtmlCommandButton createButton() {
             FacesContext context = FacesContext.getCurrentInstance();
             HtmlCommandButton newButton = new HtmlCommandButton();
             newButton.setId("Add");
             newButton.setValue("Add");
             newButton.setType("submit");
             //newButton.setOnclick("return func_1(this,event);");
             MethodBinding binding = context.getApplication().createMethodBinding("#{pc_MyProjectView.go}", null);
             newButton.setAction(binding);
                  newButton.setParent(this);
             return newButton;
      /*  private HtmlSelectOneMenu createSelect()
             HtmlSelectOneMenu selectCategory=createSelect();
             return selectCategory;
         public void encodeBegin(FacesContext context) throws IOException {
              String style = (String)getAttributes().get("style");
              String startdate = (String)getAttributes().get("startdate");
              String enddate = (String)getAttributes().get("enddate");
              //String add=(String)getAttributes().get("add");
              ResponseWriter writer = context.getResponseWriter();
             writer.startElement("table", this);
            writer.writeAttribute("border","2","2");
            writer.startElement("tbody", this);
            writer.startElement("tr", this);
            writer.startElement("td", this);
            writer.writeText("Account Category", null);
            writer.endElement("td");
              writer.startElement("td", this);
              writer.writeText("Reg-No", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("Account-No", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("Start-Date", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("End-Date", null);
              writer.endElement("td");
              writer.endElement("tr");
              writer.startElement("tr",this);          
              writer.startElement("td", this);
              writer.startElement("select", this);
            if (style!=null)
                   writer.writeAttribute("style", style, null);
            writer.writeAttribute("name","category","category");
            writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              //to access data
              Account accountObj;
              AccountData accountDataobj;
              List listOfAccounts;
              int noOfAccounts;
              accountDataobj=new AccountData();
              listOfAccounts=accountDataobj.getAccounts();
              noOfAccounts=listOfAccounts.size();
              for(int i=0;i<noOfAccounts;i++)
              writer.startElement("option", this);     
              accountObj=(Account) listOfAccounts.get(i);
              writer.writeText(accountObj.getCategory(), null);
              writer.endElement("option");
              //System.out.println(accountObj.getRegNo());
              //System.out.println(accountObj.getAccountNo());
              writer.endElement("select");
              writer.endElement("td");
            writer.startElement("td", this);
              writer.startElement("select", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("name","regno","regno");
              writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              for(int i=0;i<noOfAccounts;i++)
              accountObj=(Account) listOfAccounts.get(i);     
              writer.startElement("option", this);
              writer.writeText(""+accountObj.getRegNo(), null);
              writer.endElement("option");
              writer.endElement("select");
              writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("select", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("name","accno","accno");
              writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              for(int i=0;i<noOfAccounts;i++)
              accountObj=(Account) listOfAccounts.get(i);
              writer.startElement("option", this);
              writer.writeText(accountObj.getAccountNo(), null);
              writer.endElement("option");
              //writer.startElement("option", this);
              //writer.writeText("00200155", null);
              //writer.endElement("option");
              writer.endElement("select");
              writer.endElement("td");
              writer.startElement("td", this);
              button.encodeBegin(context);
             button.encodeChildren(context);
             button.encodeEnd(context);
            writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("input", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("type","text","text");
              writer.writeAttribute("name","startdate","startdate");
              writer.writeAttribute("value",startdate,startdate);
              writer.writeAttribute("readonly", "","");
              //writer.endElement("input");
              writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("input", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("type","text","text");
              writer.writeAttribute("name","enddate","enddate");
              writer.writeAttribute("value",enddate,enddate);
              writer.writeAttribute("readonly", "","");
              writer.endElement("td");
              writer.endElement("tr");
              writer.endElement("tbody");
              writer.endElement("table");
         public String getFamily() {
              return "HelloFamily";
         }

    NewEclipseCoder wrote:
    How to handle events for "Select"...if i choose option1 from select then one text box is to be displayed in custom component and if i choose another option then some other text box is to be displayed in custom components...Two ways:
    1) submit the form to the server and render the desired textbox depending on the option.
    or
    2) render all textboxes and use Javascript/DOM to display/hide them depending on the option.

  • How to handle Scrollbar's event in the Form Block !

    I want to create three Block like
    Block : X-axis , Source From View
    Block : Y-axis , Source From View
    Block : Cell , Source From Stored Procedure.
    The relation is (X-axis , Cell) , (Y-axis ,Cell).
    Then , if i scroll X-axis or Y-axis Scrollbar , then Cell will change !
    Problem : If X-axis Cursor record does not change , the Cell's Data will not refresh.
    Can tell me how to handle the scrollbar's event , Thank.

    Thank you.
    The Cell's behavior is a matrix , the relation will execute when X,Y record is changed !
    if you move the scrollbar , will chanage block's data , but the cursor record does not change another!.
    If i use JaveBean to handle it , possible ?
    Using Form 6i .

  • How create & handle a new event

    Hi guy,
    i've to create and handle a new event.
    how can I do it ? what classes or interfaces have I to extend and create to do it ?
    where can I find something usefull?
    THX

    Please do not cross-post!

  • How to handle check box events in alv tree.

    hi,
    i am working in CL_GUI_COLUMN_TREE class.Also using Check box. Now i want to handle events for check box . I am new to ABAP Objects.
    Pls expaline in detail or send code
    thanks in advance,
    senthil kumar.r

    Hello Senthil
    Have a look at the sample report
    SAPCOLUMN_TREE_CONTROL_DEMO
    . The crucial points are:
    <b>(1) Register the required events at the control</b>
    * define the events which will be passed to the backend
      " checkbox change
      event-eventid = CL_GUI_COLUMN_TREE=>EVENTID_checkbox_change.
      event-appl_event = 'X'.
      append event to events.
      CALL METHOD G_TREE->SET_REGISTERED_EVENTS
        EXPORTING
          EVENTS = EVENTS
        EXCEPTIONS
          CNTL_ERROR                = 1
          CNTL_SYSTEM_ERROR         = 2
          ILLEGAL_EVENT_COMBINATION = 3.
      IF SY-SUBRC <> 0.
        MESSAGE A000.
      ENDIF.
    <b>(2) Set the event handler</b>
    assign event handlers in the application class to each desired event
      SET HANDLER G_APPLICATION->HANDLE_CHECKBOX_CHANGE FOR g_tree.
    <b>(3) Define and implement event handler method</b>
      METHOD  HANDLE_CHECKBOX_CHANGE.
        " this method handles the checkbox_change event of the tree
        " control instance
        " show the key of the node and the name of the item
        " of the clicked checkbox in a dynpro field
        G_EVENT = 'CHECKBOX_CHANGE'.
        G_NODE_KEY = NODE_KEY.
        G_ITEM_NAME = ITEM_NAME.
        CLEAR  G_HEADER_NAME.
      ENDMETHOD.
    Regards
      Uwe

  • How to handle tab change event in UI shell main area

    Hi,
    I have two tabs(two taskflows) in UI shell main area. one is department tab and another is employee tab. My department tab shows employees department wise. On employee tab I have emplyee table which shows employees jobwise. This employee table has the functionality of adding new record to employee vo as well.
    Now i follow these steps.
    1. by defualt department tab is open.
    2. by clickinng on Tasks menu link i open Employee tab in to main area. Now i have both tabs in main area.
    3. at Employee tab I search all employees job = accountant. It shows the search result well.
    4. Now i add a new record to it and without saving/deleting this record i move to department tab.
    5. at Department tab i search employees where department =20, here no relation b/w job and department.
    6. Now i return to employee tab. my newly added record got disappeared. It is there but does not show in table.
    How to resolve it??
    I have one solution in my mind while changing the tab i can prompt to user "you can not leave the newly added record..either save it or delete it". But how to catch tab change event here? where i can write code to prompt msg to user?
    Pls help.
    Edited by: 900997 on May 6, 2012 4:10 AM

    With apologies for the slow reply, I'm currently travelling.
    Two things to note:
    1) The af:document uncommittedDataWarning flag was designed to stop users navigating away from half entered records. More about this flag can be found here:
    http://docs.oracle.com/cd/E23943_01/web.1111/b31973/af_orgpage.htm#CACDDDFH (see point 4)
    http://www.oracle.com/technetwork/developer-tools/adf/unsaveddatawarning-096556.html
    ....please note our documentation from time to time spells this flag wrong with only one "t" in the word committed, so if you're attempting a bulk search check for this (and I'll raise document bugs to get this fixed in the future).
    2) On addressing the ADF UI Shell, if you're switching between "pages" in the UI Shell, as separate to switching between dynamic tabs within a single page using the UI Shell, the UI Shell will actually restart the currently running task flow in the page you're returning too. You can verify this by implementing an initializer on your task flow with a log message, and watching when the initializer is called.
    In addressing your last question, at this stage I think you need to assess my first answer then come back if you think you sill need to execute the code on the tab click. I also need to know are you talking about the primary level of tabs that represent each page in the UI Shell, or are you referring to the dynamic tabs within a single UI Shell page that hold your task flows?
    CM.

  • How to handle the nonscriptable event by automation plug-in

    from the sdk document, the plug in for eventall just suitable for all the scriptalbe actions. Is there any way to handle the nonscriptable event such as drawing a line on the image ?
    Thanks in advance.

    You might get an answer in the scripting forum:
    http://www.adobeforums.com/webx?13@@.3bbf2765
    or the SDK forum:
    http://www.adobeforums.com/webx/.3bbc5053/

Maybe you are looking for

  • Cannot Open SQL from Data Prep Editor (SQL Interface)

    Hi, When I Open SQL in Data Prep Editor: "There are no data sources defined. Please create one to continue." I create a ODBC connections using the drivers bellow and I obtain always the same message ("There are no data sources defined.."): Oracle in

  • Two ipods on same computer?

    there are two ipods as well as seperate itunes on my computer. i recently had trouble with this, as it deleted all my songs off my itunes. the other itunes on the other file is fine. how can i stop this from happening again?

  • Need help in ViewObject Data Validation

    HI Everyone, I have few queries about ViewObject. I'm working on JDev11gU2 ADFRC. Actually i made an application to upload XLS file to af:table. Everything is working but now I stucked with some functionality. Like - 1. After inserting all rows in ta

  • How to put mail ids in CC and BCC while sending mail through ABAP?

    Hi all, i have created a report which sends the output of the  report to external mail ids. I want to put some email ids in CC or BCC. Please do guide me so that i can proceed with the development. Thanks and Regards, Syed

  • Dynamic where clause for MULTIPLE values

    In the following of dynamic where clause? i have some somewhat different problem. Is a dynamic where clause for multiple values possible? If the inputvariable varCode1,varCode2,varCode3,varCode4 are 0 then show all id's otherwise filter the resultset