How to capture previously clicked button(previous event)?

Hi guyz,
I have frame in which i have different panels. I would like to capture the last clicked button. My objective is to bring a pop-up box(dialog) when anything other than a specific button is clicked in one of the panels. So, i would like to know if i can see what button was clicked previously. Does anyone know?

How to capture previously clicked button(previous event)?Store it somewhere and then you can use it later:
ActionListener previousActionEvent;
JButton b = new JButton();
b.addActionListener(new ActionListener(){
   public void actionPerformed(ActionEvent evt){
      previousActionEvent = evt;
});

Similar Messages

  • How to get "double click" as an event in Module Pool

    Dear Experts,
    Being new to ABAp, I am struck in a problem.
    I want to get double click as an event in my module pool program.
    On the screen I have two input/output fields. The attributes of them are as below:
    1) 1st I/O field Attributes:
    Name: WA_AUFN-A
    Dropdown: List box
    Display: Resp. to DblClk = Checked
    1) 2nd  I/O field Attributes:
    Name: IT_AUF-A
    Dropdown: No drop down box
    Display: Resp. to DblClk = UN- Checked
    I get some data populated in 1st I/O field in list display.
    My Requirement:
    As I select one of the data from the 1st I/O field and double click on it, then what I want is that the same selected data
    should appear in the 2nd I/O field.
    So I want to know how can I capture "Double click as an event".
    Can any1 help me out.
    Regards
    Chandan

    Hi Chandan,
    below is the explanation.
    for example if u have 2 screen fields VBAK-VBELN & VBAK-VKORG.
    VBAK-VBELN has some value say 1000. based on this one u have to fill VBAK_VKORG.
    Data: l_f_field like HELP_INFO-DYNPROFLD,
            l_f_value like vbak-vbeln.
    case pick.
    GET CURSOR FIELD l_f_field.
    with this u will get to know on which field user is double clicked. so, in this case l_f_filed will have a value of VBAK-VBELN
    if l_f_field = ''VABK-VBELN' and
      l_f_value = '1000'. "this is optional, based on ur requirement
    VBAK-VKORG = '0780'. "fill here
    endif.
    endcase.
    Let me know if it is not clear.
    Regards,
    Prasad

  • Flex 3 : How  to capture   right click on DataGrid ??

    I am using Flex 3 . I have some data inside a DataGrid .
    Now when we the user right clicks on Datagrid Item , i want to show an Alert ??How  to capture 
    right click on DataGrid ??
    Please suggest ,thanks

    Thanks for the resonse , I did not understand what is context menu and how it it associated with Datagrid's right click , could you please elobrate ?? Thanks .

  • Is it possible to switch between whether or not the previously clicked button or link remains highlighted when you go back a page?

    When clicking on a link in Firefox, it selects that link and takes the user to the connected page. If the user then goes back a page, different situations happen on different (but identical) computers. On some computers, the previous clicked link stays highlighted/selected and then the Tab key goes to the next link. On other computers, going back clears the previous selected link, in which causes the Tab key to start scrolling through item from the top of this page. Is there a way to set Firefox to do this one way or the other? Is this a Windows issue and not an Firefox issue?

    You can avoid that by opening the link in a new tab with a middle-click.<br />
    The you can close that tab with a middle click on that tab after you are done and go back to the tab with the links.

  • WebEngine: how to capture the click on a link?

    I need some insight into the inner workings of WebEngine: listeners seem to stop firing under certain conditions.
    Problem description:
    In my application I have to open certain urls in a new tab or in a different pane. Following jsmith's proposal in a different thread (Re: How to cancel page loading in WebView? I do the following:
    - Based on the location of the link clicked, I decide if it has to be opened in place, in a new tab, or in a sort of popup pane (similar to a sheet window in MacOS/X as a fake modal dialog attached to the top of the window).
    - To achieve this, I implement a locationProperty listener using "locationProperty().addListener".
    - Inside the listener I use "getLoadWorker().cancel()" to stop the current engine from loading the url ...
    - ... and load that url in a new tab or the popup pane.
    This works fine, but when I return from the other tab or close the popup pane, the location property listener won't fire any more.
    The same applies if I cancel in a stateProperty change listener.
    Workaround:
    As a workaround I can refresh the page using "getEngine().reload()" in a "Platform.runLater" thread, but the flickering is really ugly.
    Analysis:
    It looks as if the cancel comes too late. The first opportunity to capture the click on a link seems to be "getLoadWorker().stateProperty()" where "Worker.State" is "SCHEDULED"; after that fires the listener on "locationProperty()". In either case "getLoadWorker().cancel()" seems to invalidate the listeners.
    I have experimented with another development platform which also uses Webkit. There it's possible to truely cancel out before a link is loaded. So it should be possible in JavaFX as well...
    Question:
    Does somebody know how I can capture the click on a link without redeveloping the web application (which I can't)?
    Cheers,
    Thomas

    If, after calling getLoadWorker().cancel(), you no longer receive location change notifications upon further clicks on links, it looks like a bug. Feel free to file an issue with Jira.
    However, it is probably too fragile to rely on the location property and the cancel method in your case, due to asynchronous nature of page loads.
    Look at the WebEngine.createPopupHandler property. The popup handler will only be called if the page decides that a new window needs to be created, so it may not be able to help you fully solve your problem, but it may be worth a try.
    Otherwise, consider the approach suggested by irond13. Install DOM event listeners on link objects (<a> tags) and do whatever you want in response to click events. You can do it solely in Java, see Re: Controlling what happens when a user clicks on a hyperlink in a WebView and Re: Communicate from WebView to JavaFX scene for details and example.
    Finally, if you do think a more direct callback on WebEngine is a necessity, consider extending http://javafx-jira.kenai.com/browse/RT-17073 or filing a new feature request.

  • How to capture backspave and delete key events

    Hi ,
    i would like perform some javascript code on pressing backspace or delete key.
    initially i thought of adf clientlsitener keypress event.but this is not capturing backsapce key event
    what is the alternate way capture backspace or delete key event?
    please help

    Hi
    the following script cancels the input event when the back key is pressed
           function keyTrap(inputEvent){
             var keycode = inputEvent.getKeyCode();
             if(keycode ==8){
               inputEvent.cancel();
           }Use a clientListener
            <af:inputText label="Label 4" id="it7">
              <af:clientListener method="keyTrap" type="keyDown"/>
            </af:inputText>Frank

  • How to capture when a button and menu item clicked by user?

    Hi,
         I am working in Acrobat 8 professional.
         I want to capture when Comments->Publish comments is clicked by user.
         My requirement is when Publish comments menu item is clicked then one alert have to be displayed.
         Similarly when user clicks Publish comments button then also one alert have to be displayed.
         How can i do this?
         Thanks in advance...

    There is nothing in the Acrobat SDK to really help you.  Your best bet it to use OS-level hooking functions.

  • How to capture the PrintScreen button event in keyboard

    Hi
    The JPanel consists of all components , and finally the panel is added to the JFrame.The problem is to avoid the user by capturing the page through "PrintScreen" button in the keyboard.
    Thank u .

    Hi,
    I believe that you must use JNI to access .dll to do that... you can not use any keyListeners for that!!!
    JRG

  • How to capture OK / Cancel Button response of warning type message in EBS D2K form using Form personalization

    Hi Experts
    We are working on one requirement in which on a standard D2K EBS form based on the response of a warning message we need to perform certain actions using Form Personalization.
    The problem is that we are not able to capture response of OK and Cancel buttons of the warning.
    If any one has come across such scenario, I would request to please share your valuable suggestions. 2898414
    Thank You
    Regards
    Mirza Tanzeel

    Figured out myself that this is mot possible using Form Personalization.
    Only option possible is to try implementing by modifying custom.pll
    Thanks
    Mirza Tanzeel

  • How to read URL by button action event

    Hi,
    Can some one please show me how to add a ...... I call it URL reader to the action of a button of another class?
    Lets say I have a url reader class and the following code
    public void uRLReader() throws Exception {
             // URL concatenation
             String url1 = "http://";
             String url2 = "";
             String url3 = ".google.com";
             URL google = new URL(url1+url2+url3);
             BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                            google.openStream()));
             String inputLine;
             while ((inputLine = in.readLine()) != null)
                 System.out.println(inputLine);
             in.close();
            }Now I also got another class in the same package "class2", it has a button. Similarly, another class which has a JTextField. Now when some one writes 1 and hit the button I want "1" to get inserted into url in "url2" position. In other words any thing that is entered in the JTextField should be inserted into "url2" position.
    I am not very much familiar with java so this is all I could write. I used a string concatenation to break the url. Can some please show me how do I add this to the button of another class and the button to JTextFiled of another class?
    Thank you

    First of all, change your method so that url2 is an argument of the method:
    public void uRLReader(String url2) throws Exception {and remove the declaration of url2 from the body of the method.
    Then, write and ActionListener class (it could be an anonymous inner class) to read the textfield you want, then invoke uRLReader, passing that text as an argument.
    That's basically it.

  • Click event on Autosuggest Listbox. How to capture it ?

    Hello.
    I'm trying without much success to understand how to capture
    the click event on the listbox associated with the Spry Autosuggest
    Widget.
    At this address:
    http://labs.adobe.com/technologies/spry/samples/autosuggest/SuggestSample.html
    it is described how to use the widget. For an istance when
    you type 'Ado' in the first textbox of the page, the listbox (or
    what looks like a listbox) appears with all the possible Adobe
    products beginning with 'Ado'. As the user clicks on a product,
    let's say 'Adobe Acrobat Professional', its description is passed
    to the textbox.
    Fact is, I would like to capture the event of the clicking on
    the Listbox item. Is there a way to obtain that ?
    I would really like to be able to call a JS function when an
    item is selected there...
    I would appreciate any help to solve the problem.
    Regards,
    Newcomsas

    Hi, adding an onClick event handler ist quite easy. my code
    looks like this:
    <div id="VKundenAS" spry:region="dsKunden">
    <div onclick="updateVKundenUUID('{f_uuid}');"
    spry:repeat="dsKunden"
    spry:suggest="{f_name}">{f_name}</div>
    </div>
    Just add the event handler to the corresponding list element
    (here it is a DIV-tag).
    Unfortunately this only works with mouse interaction
    (onClick), if you navigate with the keyboard, no custom JS is
    called. So you have to disable keyboard selection on the
    autosuggest widget, in order to make sure the JS gets called.
    Best wishes,
    Nils

  • How do I use the button states in an action script?

    In my Captivate 8 project I use smart shape as buttons. The buttons have different images presented dependent on the state of the button. I have also created a simple action script that shows what happens when the button is pressed. When the button has been pressed the normal state of the button appear. I, however, want the down state of the button to remain visible util the user presses another button. How do I accomplish this? Is there variables for the buttons different state or how can I create that?
    BR,
    Madeleine

    When you talk about 'actionscript' do you mean advanced or shared actions? You cannot write actionscript within Captivate, only Javascript. If you use advanced/shared actions they'll be converted on runtime to either Actionscript (for SWF output) or Javascript (for HTML5 output).
    The states in shape buttons are the normal way buttons behave (not only in Flash). If you are indeed using shared/advanced actions, and you want the down state to remain until the next shape button is clicked, you'll have to go the way described by iFlashAppsToo. Create shapes that have the look of the down state, make them initially invisible and group all those shapes on one slide. Add two statements to the shared/advanced action (please do use shared actions, you'll save time):
    Hide Group   so that eventual down mimicked states on previously clicked buttons disappear
    Show Im_Downx    to show the down image for that button

  • How to maintain dynamic rows with data when click on Previous button?

    Hi,
    I have 1 aspx page and divided into 3 pages using panels.Each panel has "Next" and Previous buttons
    I have created and deleted dynamic table rows when click on Add button using javascript. whenever i click on Next button it will navigate to same page of next panel.
    when i click on previous button then it goes to previous panel but whatever i have added dynamic table rows in 1st panel that got removed.
    Can u please help me for how to maintain state of dynamic table rows with entered data when click on Previous button?
    How to get dynamic table rows with entered data in previous panel when click on Previous button?
    Please find the below javascript code:
    function insertRow() {
    if (index >= 2) {
    document.getElementById('deleteRow').style.display = "inline";
    else { document.getElementById('DeleteRow').style.display = "none"; }
    var table = document.getElementById("myTable");
    var row = table.insertRow(table.rows.length);
    cell1 = row.insertCell(0);
    t1 = document.createElement("select");
    t1.options[t1.options.length] = new Option('--Select--', '0');
    t1.id = "ddlYear" + index;
    cell1.appendChild(t1);
    for (var i = 1975; i <= 2015; i++) {
    opt = document.createElement("option");
    opt.value = i;
    opt.text = i;
    t1.add(opt);
    t1.style.width = "155px";
    var cell2 = row.insertCell(1);
    t2 = document.createElement("Select");
    t2.options[t2.options.length]=new Option('--Select--','0');
    t2.options[t2.options.length]=new Option('State Board','1');
    t2.options[t2.options.length]=new Option('CBSE','2');
    t2.options[t2.options.length]=new Option('ICSE','3');
    t2.options[t2.options.length] = new Option('Others', '4');
    t2.style.width = "155px";
    t2.id = "ddlCourse" + index;
    cell2.appendChild(t2);
    var cell3 = row.insertCell(2);
    t3 = document.createElement("input");
    t3.id = "txtCity" + index;
    cell3.appendChild(t3);
    var cell4 = row.insertCell(3);
    t4 = document.createElement("input");
    t4.id = "txtInstitute" + index;
    cell4.appendChild(t4);
    var cell5 = row.insertCell(4);
    t5 = document.createElement("Select");
    t5.options[t5.options.length] = new Option('--Select--', '0');
    t5.options[t5.options.length] = new Option('English', '1');
    t5.options[t5.options.length] = new Option('Hindi', '2');
    t5.options[t5.options.length] = new Option('Telugu', '3');
    t5.options[t5.options.length] = new Option('Others', '4');
    t5.style.width = "155px";
    t5.id = "ddlMedium" + index;
    cell5.appendChild(t5);
    var cell6 = row.insertCell(5);
    t6 = document.createElement("input");
    t6.id = "txtSpecialization" + index;
    cell6.appendChild(t6);
    var cell7 = row.insertCell(6);
    t7 = document.createElement("input");
    t7.id = "txtFnl" + index;
    cell7.appendChild(t7);
    index++;
    function DeleteRow(index) {
    var table = document.getElementById("myTable");
    table.deleteRow(index);
    // if (index = 2) { alert("There is no rows added.Please add the new row"); }
    Design:
    <tr style="font-size: 12pt" id="trSecond" runat="server">
    <td colspan="3">
    <table id="myTable" width="100%" border="0">
    </table>
    <tr>
    <td colspan="3" align="right">
    <input type="button" title="Add" value="Add" onclick="insertRow();" />
    <input type="button" id="deleteRow" title="Delete" value="Delete Row" onclick="DeleteRow(this);" style="display:none" />
    </td>
    </tr>
    Thank you.

    Put the button click into an action listener and build the new frame there. The code I have below isn't exactly what you're doing (it's amazingly oversimplified), but it's probably similar enough to get your wheels turning in the right direction.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class sample
         public static void main(String[] args)
              JFrame frame = new JFrame("Sample");
              frame.setSize(400,400);
              Container content = frame.getContentPane();
              content.setLayout(new FlowLayout());
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              final JTextField text = new JTextField(10);
              content.add(text);
              JButton button = new JButton("Send");
              content.add(button);
              frame.setVisible(true);
              button.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        JFrame myframe = new JFrame("Results");
                        myframe.setSize(200,200);
                        Container mycontent = myframe.getContentPane();
                        mycontent.setLayout(new FlowLayout());
                        String mytext = text.getText();
                        JLabel label = new JLabel();
                        label.setText(String.valueOf(mytext));
                        mycontent.add(label);
                        myframe.setVisible(true);
    }

  • My "Restore Previous Session" button is not working anymore. When I click it, nothing happens. How can I fix this?

    When I click the "Restore Previous Session" button on my Firefox home page, nothing happens. It usually restores all of my tabs from the previous session, and now it does nothing.

    Hi cor-el
    After deleting the file, that bug is solved. HOORAY!
    But it seems like it crashes my About:Home page. Now, there's a blank box below the search bar and it is not responding. Can't use it to search etc.
    Does this happen to your FF?
    Thanks. Much appreciated.

  • The restore previous session button is not working on Firefox on any of my three machines. How can I fix this?

    I have a desktop at work, and a desktop and laptop at home and just recently the "restore previous session" button that comes up when I use the desktop icon to start a Firefox Web browser session does not work. It is there and I click it but nothing happens. I have Windows 7 on the two computers at home and thought that is what I had on this computer at work, but it may be Vista. It's not XP.

    Had this trouble myself, just did some research and solved it!
    Go to the '''Help''' menu, go to "'''Troubleshooting Information'''"
    On the new window, click "'''Open Containing folder'''" next to ''Profile Directory'' (This opens the folder on your PC where Mozilla stores some settings, like a tab history)
    In the new Windows Explorer window, Find the file "'''chromeappsstore.sqlite'''"
    You'll want to close Firefox and then '''delete''' that file (don't worry, Firefox will create a new one, and you won't even lose the open tabs)
    Start Firefox again and the button should work!
    (For completeness's sake, the profile folder for windows7 is: C:\Users\Tiberion\AppData\Roaming\Mozilla\Firefox\Profiles\c6xu23fh.default\
    where you replace Tiberion with your own username, and the random characters in the final folder will be different.)

Maybe you are looking for

  • 790FX-GD70 - FREEZES ON POST CODE "08"

    Hi I have just made a new build on a new 790FX-GD70 winki board - on initial start up it's freezing on the POST code "08". Nothing is showing up on the screen at all. Apprently this means: 08 Initializes the CPU. The BAT test is being done on KBC. Pr

  • Error ITS_TEMPLATE_NOT_FOUND when calling a function code from the web

    Hi Experts, I have craeted a simple module pool program and a service for the same in SICF. The module pool has only one screen where I am giving the input to the two fieds 1. year  2. category. when I click on FIND button the result will appear on t

  • How to Upload to Kodak Gallery from 2.1.4

    I currently export photos to a file and then upload to Kodak Gallery using their browse function. When I could use ofoto express I could drag and drop directly from Aperture. Is there anyway to copy directly to Kodak Gallery without having to export

  • How to pull list in alphabetical order using #listgetat? more details in post

    I have images pulling into site but it seems to be pulling them based on most recent added, is there any way to pull by file name alphabetically? I'm not too experienced with CF but I am good with HTML/CSS trying to fix some things on a friends site

  • Messaging problem on 5300

    i have suddenly got a fault on my 5300  with sent messages going into the outbox  but not being sent,also am unable to listen to my voice mail. problem only arose a couple of weeks ago. any advice would be appreciated belindafred