Click 2 buttons by clicking on 1 button

I have button A and button B. When the user clicks on button
A, I want button B to be clicked at the same time. Is there a way
to tell button B to click if button A is clicked?

Add an ActionListener to your buttons and in the actionPerformed method see which button was pressed and do the stuff.
public void actionPerformed(ActionEvent ae) {
     if(ae.getActionCommand().equals("Cancel"))
        myWindow.setVisible(false);
} like that..

Similar Messages

  • How to Capture the event when minimized button is clicked of a JFrame?

    Hi All,
    In my SWING application, I want to do something when the minimized button is clicked. But not able to understand how to do that.
    My basic requirement is like that, if I minimize the JFrame, it should be minimized to system tray with an icon. Again when the icon is clicked, the frame should be maximized in the Windows.
    Also, how to make my JFrame visible/invisible. If I close it, then the process will got killed... that I don't want to happen. Should I us setVisible(true/false) for the frame... Please suggest...
    Thanks,
    Ujjal

    There could be some mistake in my basic understanding... Anyway this is what I wrote...
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    public class WindowIconify extends JApplet
         JFrame jf;
         JPanel jp;
         public void run()
              jf = new JFrame("test");
              jf.setSize(200,200);
              jp = new JPanel();
              jp.setBackground(Color.BLACK);
              jf.add(jp);
              jf.setVisible(true);
         public boolean handleEvent(Event event)
              if ( event.id == Event.WINDOW_ICONIFY)
                   System.out.print("iconifying");
              return true;
         public static void main(String args[])
              WindowIconify wi = new WindowIconify();
              wi.run();
    }

  • Visual Studio 2008 Crashes when I click on the [Main Report Preview] button

    I started with Crystal Reports Basic that is bundled with Visual Studio, and then downloaded and installed the free trial of Crystal Reports Developer 2008, and the Visual Studio Integration Manager, the issue has not been affected.
    After adding a crystal report to the project and using the wizard to set it up, and adding a Crystal Reports Viewer to a form I encountered these two (perhaps related) problems.
    1)      When I click on the [Main Report Preview] button at the bottom of the report editor for Visual Studio crashes without any error message and needs to be restarted.
    2)      When I set the viewer  Report Source property to the report via the drop down the following error occurs:
    a.       u201CUnable to find the report in the manifest resources.  Please build the project and try again.u201D
    b.      Building the project has no affect and the same error reoccurs repeatedly.

    The original version of CR 2008 did not work with .NET 2008. If your version is 12.0.0.549, you need to apply SP0:
    https://smpdl.sap-ag.de/~sapidp/012002523100007528552008E/cr2008_sp0.zip
    then I'd highly recommend SP 3:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    If your version is higher than 12.0.0.549, apply SP3 and try again.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • I have been trying to upload more music to my iphone 3gs but whenever i try to even click on the artist or name buttons in itune they dont get highlighted or anything all i can do is play music from my phone through itunes ...

    i have been trying to upload more music to my iphone 3gs but whenever i try to even click on the artist or name buttons in itunes they dont get highlighted or anything all i can do is play music from my phone through itunes ... if you know of anything i have done wrong plz tell me how to fix (besides restore)

    Success!! There truly is a light at the end of the tunnel. Apple support really did come through and I am successfully back into my account. Ready to purchase more music. I followed the instructions, with patience I thought I lost, submitted my problem, someone emailed me back within two days and all is now perfect. Thanks again Apple.
    To all the frustrated users out there, don't lose hope!!!

  • Purchased a new Apple TV and the remote double clicks each time I press the button. It worked fine during set up and for the first two days.  I have since moved it and this problem started. Restarted,reset,unplugged,change remotes, no change.Help please.

    Purchased a new Apple TV and the remote double clicks each time I press the button. It worked fine during set up and for the first two days.  I have since moved it and this problem started. Restarted,reset,unplugged,changed remotes, no change. Latest software update. This is really annoying.  iPhone remote app works just fine.  Any suggestions?

    That's one of the weird things.. it recognizes it maybe 10% of the time. And usually, only after I do the two-button reset. Problem is.. since it won't charge above 2%, anytime I try to do a restore or anything like that using iTunes, my device shuts off and I lose whatever progress I'd made.
    So, an update... after reading through a bunch of similar complaints (there are literally 1000's of them so there's NO WAY this isn't somehow ios7 related, thanks a lot APPLE ) I decided to try a restore in recovery mode. After 3 hours and several disconnections... I ended up having to just set it up as a new iPad, as the restore did nothing. Weirdly though... as I was doing the restore in recovery mode.. I noticed I'd gotten up to a 10% charge.. higher than it's been since September, so after setting it up as a new device, I turned it off and plugged it in using the wall charger. 2 hours later and I was up to 38%. Still not great, as my iPad, before ios7 could've fully charged twice in the amount of time it took for me to now get 28% more of a charge. And that's with a fully cleaned out device.. so that really ***** and I'm now more confused than ever.
    But I'm gonna leave it overnight charging and see what I come up with tomorrow. Sadly, when I paid $600 for it in February, I never expected to have to play "wait and see" with it...

  • When I open a slde show in New Yahoo Mail I can't get back to Yahoo. When I click on the "back to Yahoo" button, the screen freezes with a gray cast over it and I have to use the back button and forward button to get back to my inbox.

    This problem started immediately after I upgraded to Firefox 9.0.1
    If I open my inbox in my New Yahoo Mail, then open an email with attachments and then open the attachments to "view as a slide show"....I can't close the slide show and return to the email by clicking on the "return to Yahoo" button. If you click on it, it returns to the first pic shown, and if you click on it again, the pics disappear and a gray haze appears over most of the screen but none of the features under the gray screen work. I have found that if I hit the back page and then forward page buttons, I can get back to my inbox eventually, but this is a terrible "pain in the ass"!

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode

  • Creating a plot on a java Frame when a button is clicked

    hi
    I want to create a plot in a java application in a frame when a button is clicked.I mean to say a
    a plot between two single dimensional arrays one as x-axis and the other as y-axis. Can u please suggest me with an example
    Thank u

    JFreeChart

  • Tried purchasing iTunes music. Put in my apple id and password then i was directed to a 'Terms and Conditions' page. I checked the box then clicked the 'accept' button next page read 'your Session has timed out '  try again  with a Done button to click on

    Tried purchasing music from the iTunes Store. When the window popped up I put in my apple id and password. Then I was directed to a 'Terms and Conditions' page. I checked the box next to the 'Yes I agree to these terms and conditions' - then clicked the 'accept' button next page read 'Your Session has timed out. Try again.'  with a 'Done' button to click on. Oh the same thing happens when i try to download  free iTunes. Yes I have tried & tried it again I even logged off and singed back in-- no joy 
    After accessing my iTunes account I was not able to change anything like my credit card number when I tried and was sent right to the 'Your session has timed out. Try again.'
    The last time I purchased any anything was on September 25th 2011 and the 'terms & conditions' page was last updated on October 12, 2011
    Does anyone have an idea to what is going on with my iTunes version 9.2.1 (5) and I can not upgrade to a higher version my iMac does not have the intel processor chip.Thank you for your time and help with this matter. You are greatly appreciated 

    I am having the same problem also! I posted on here about it, but no one has responded with ideas. I called technical support and e-mailed them, the only suggestions they gave was for the to turn off my firewall. But I didn't change anything, so it shouldn't suddenly stop working. Maybe this is just an iTunes issue? But it doesn't even recognize my account anymore, and I cannot log in now.
    If you happen to get an answer, will you please let me know what works for you?
    Thanks!

  • SRM RFx Response - How to check if a button is clicked or not

    Hi All,
    This is rani.  Im very new to SAP.
    Im into my first project, in which im having an Immediate enhacement.
    In SRM Portal, I need to logged in as bidder to create a bid response.
    "Participate" button is there, i need to clicked that button, this is mandatory.
    So how and where to check whether the button is clicked or not.
    else i need to raise the error message in BBP_DOC_CHECK_BADI and some fileds needs to be grayed out.
    The webdynpro component is FPM_OIF_COMPONENT.
    Can u please help me out in this regard.
    Thanks in Advance,
    Rani.

    Hi  Rani ,
    In SRM 7.0 the system variables ( sy-ucomm & sy-Tcode ) will not work .
    if you want the action code  triggered in the  Webdynpro screen inside the BADI: BBP_DOC_CHECK_BADI
    kindly study the SAP Note 1334202 - How to get current action ID and transaction group
    Below piece of code will give you the action Id in side the badi
    DATA: lo_trans_context TYPE REF TO /sapsrm/if_transaction_context,
            lv_action        TYPE /sapsrm/pdo_action_type,
            lv_tcode         TYPE /sapsrm/transaction_group.
      lo_trans_context = /sapsrm/cl_transaction_context=>/sapsrm/if_transaction_context~get_instance( ) .
      lv_action = lo_trans_context->get_current_action( ). "  replacement for sy-ucomm
      lv_tcode  = lo_trans_context->get_transaction_group( )." replace ment for sy-tcode
    kindly go through the SAP note provided .
    Regards
    Chinnaiya P
    Edited by: chinnaiya pandiyan on Jun 27, 2011 7:34 PM

  • How to check if a button is clicked or not

    Hi All,
    This is rani.  Im very new to SAP.
    Im into my first project, in which im having an immediate enhancement.
    In SRM Portal, I need to logged in as bidder to create a bid response.
    Participate button is there, i need to clicked that button, this is mandatory.
    So how and where to check whether the button is clicked or not.
    else i need to raise the error message in BBP_DOC_CHECK_BADI and some fileds needs to be grayed out.
    The webdynpro component is FPM_OIF_COMPONENT.
    Can u please help me out in this regard.
    Thanks in Advance,
    Rani.

    HI,rani;
       you can use the FM  :BBP_PD_BID_GETDETAIL ,you will get the detail of the Rfx ,and check the status of the Rfx !
       Alex

  • How to Create a Dynamic http address that opens the Explorer Window for a List Item When a Button Is Clicked--Currently Trying to Make this Work with Javascript

    I have created a button (via Content Editor) that uses JavaScript to open the Attachments folder of a list item in the Explorer Window in SharePoint 2010. The purpose is to have drag and drop functionality for each list item, having multiple attachments.
    The button works but opens the "Attachments" folder containing all of the other folders for each list item (one folder per item). It seems that when you add an attachment to a list item, SharePoint numbers the folder based on the item's ID. What
    I'm trying to do is take the JavaScript I have and have it run when a button is clicked in a custom form. When it runs, I'm trying to get it to open the "specific" folder for the list item. I have had success creating a hyperlink in the list that
    does this; however, the link WILL NOT work until I use the Content Editor created button that runs JavaScript, that prompts me to click OK to my profile certificate, and then opens the Attachment folder. After that occurs, I can use my hyperlinks without issue
    because I'm no longer prompted to click OK for my cert.
    So I'm trying to take the JavaScript I have and place it in a list item form (custom form) and have it run when a form button is clicked. The problem is I have very little knowledge of JavaScript (did I mention little?) and
    "don't know how to take the "http:" address I have in the script and append to it the list item ID, according to the record I have open."
    So that for any record I open, the script will grab the corresponding record ID (or list item ID) and append it.
    Here's the script I'm working with (which I didn't create but am grateful for):
    <style>
    .httpFolder {behavior:url(#default#httpFolder);}
    </style>
    <script text = "javascript">
       function fnOpenFolderView(){
       oDAV.navigateFrame("https://server/collection/site/subsite/Lists/Sublist/Attachments","_self");
    </script>
    <div id = "oDAV" class = "httpFolder"/>
    <input type = "button" value = "Open Attachment Folder" onclick = "fnOpenFolderView()"/>
    The above script, in the Content Editor, creates a button that opens the Attachments folder for the corresponding SharePoint list.
    JackSki123

    Hello Thriggle,
    Thank you for pointing that out. I appended your "GetUrlKeyValue" to the end and it worked. That said, I noticed it doesn't run as smoothly as when I simply click on the Content Editor button I created that resides on the SharePoint List
    ASPX page (not the form). The Content Editor button has the same code, minus the "GetUrlKeyValue". I click it; I get prompted to choose my cert; it opens right up.
    Now go to the ASPX Display form where I dump the code in a table cell. Button appears in cell; I click it; wait; wait; I get prompted for cert; it opens. Do I need some sort of "throttle" for the JavaScript? For instance, I thought before running
    JavaScript, you reference the library first. This code doesn't do that. I'm wondering if there's something more I need to make this run smoothly. Thank you both for getting me this far. 
    JackSki123

  • I have set up my airprint wifi printer which works perfectly with the HP eprint app. However, when i view an email and click on the top right arrow button and select "PRINT" on my ipad nothing happens????...

    I have set up my airprint wifi printer which works perfectly with the HP eprint app. However, when i view an email and click on the top right arrow button and select "PRINT" on my ipad nothing happens????...
    Also, when im viewing websites and i find something i wish to print, same again, if i simply click on the print option at the top right of the screen nothing happens... the only way I can print is if i copy the weblink of the site page then click on my HP eprint app and paste the web link, then select print, it prints off fine.. but its it such a pain to keep copying and pasting links or screen dumping emails just to print...

    Just to recap, this is a collection of ports I have collected over time for people who needed this information when setting up the HP ePrint app so that they could view their email from within the app.  I am certain other applications also need this information.  Although lengthy, I could not find a more comprehensive place to retrieve this information.  Feel free to post additional information, faulty information, or other related topics below as this is simply a collection of data and it would be practically impossible to test all of them. Thank you!
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • How can I set a value in a field before create when a New button is clicked

    Hi,
    I am using
    JDeveloper 10.1.3.1.0.3984 and
    JHeadstart 10.1.3.1 release 10.1.3.1.26
    I have one group and there is a detail group under that group.
    From main group to detail group there are 3 field relating those groups.
    field1
    field2
    fieldSEQ (auto-generated by database trigger)
    These 3 fields are PK.
    In the detail group, there is a New button. So, when the New button is clicked, it tries to create the record with those 3 fields value as those are coming from main group. As a result it's giving the duplicate error as that record already exists in the table.
    But I don't want to create the record with that SEQ as that will be created in the trigger.
    How can I set the SEQ temporarily any no. (-1) before create when the New button is clicked?
    Can anybody help?
    Thanks
    Syed Jabbar
    University of Windsor
    Windsor, ON, Canada

    Hello Syad,
    What I would suggest is setting the sequence number at the creation of the entity object (so in the create() method) by using the database sequence. This way it will always be unique.
    So something like:
    protected void create(AttributeList AttributeList) {
    super.create(AttributeList);
    SequenceImpl sequence =
    new SequenceImpl("KCP_SEQ", getDBTransaction());
    setFieldSeq( sequence.getSequenceNumber());
    If this still does not solve it: please go to the ADF Forum since this problem is an ADF problem, not a JHeadstart problem.
    Regards,
    Evert-Jan de Bruin
    JHeadstart Team.

  • Everytime i click on the view in itunes button/link on the itunes website so that i can download apps, nothing happens. I accendentally  clicked on the button other than open itunes and now i cant fix it

    everytime i click on the view in itunes button/link on the itunes website so that i can download apps, nothing happens. I accendentally  clicked on the button other than open itunes and now i cant fix it

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Go to Settings>iTunes and App Stores and sifnout and sign back in
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.

  • How to get a node  in a Jtree on which right mouse button is clicked

    I am dealing with a situation in which whenever tree component is clicked by right mouse button I am needed to get the tree node on which right mouse button was clicked.

    MouseEvent e = ...
    TreePath path = tree.getPathForLocation(e.getX(), e.getY());
    Object nodeClickedOn = path.getLastPathComponent();Or something along those lines.

  • How to use the SSO functionality when a button is clicked in Adobe Form?

    I have an offline interactive form - when the user clicks on a SUBMIT to SAP button, it asks for user id and password.
    However he user does not have a password to log into SAP directly - he will be logging in via Single Sign On.
    Can you please advise on how to achive this functionality?
    1. Click on a SUBMIT to SAP button on the Adobe Form
    2. Take this info and get the Single Sign On token from SAP portal
    3. Use this ticket/token and log into SAP ECC or validate this info within SAP ( for this 3rd step - probably use function module SUSR_CHECK_LOGON_DATA?)
    Thanks

    Hi
      I think you want to know the row number, in this case , what i would suggest is , in the action ,there is a parameter WDEVENT , which gives you the complete row where you clicked.
    In WDEVENT , you have GET_CONTEXT_ELEMENT method as well as GET_DATA method to fetch the data and it doesnt require any lead selection.
    Thanks
    Anzy

Maybe you are looking for

  • Blackmagic preview & built-in line out audio?

    Esteemed fellow editors, In Final Cut Pro, I can preview video on my NTSC monitor using my Blackmagic Intensity card, and preview audio using my Mac's built-in output or built-in line output. Does anyone know how to do this in Premiere? Thanks!

  • My Webdyno appl is not displayed? deployed successfully.

    Hi all, My appl is to connect to backend R/3 and retrieve the results from there.For this I have developed a WD FlightList appl. Deployed successfully using SDM. Before runing,I should bind the logical name of R/3 to that of SLD. I did it in Webdynpr

  • Weblogic 5.1 SP4 Hangs in stress test

    Hi, I am trying to stress test my application. I am using Weblogic 5.1 SP4 JDK 1.2.2 on Windows NT. The stress test client creates 20 threads and makes simultaneous requests to the Weblogic Server. This hangs the server completely. I am not able to p

  • Why can't I, or how can I, update Photoshop Elements 11 to open D7100 RAW files?

    I purchased Elements 11 via the App Store, and cannot find a way to update the software so that the newest version of ACR (7.4) will work with it. Some places seem to say that if I puchased through the App Store then I can only update the programme w

  • MacBook Pro is VERY slow after Mountain Lion upgrade

    Hello folks, I have a MacBook Pro that was running very well before I upgraded to Mountain Lion...since then it runs worse than a Windows machine. The configuration is as follows: Model Name:          MacBook Pro   Model Identifier:          MacBookP