Is it possible to register two same Listener in a component?

Hi all,
Is it possible to register two same Listener in a component and also set the execution hierarcy?

And here some code that seems to workimport javax.swing.JButton;
import javax.swing.JFrame;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class Test {
    boolean firstAdapterCalled = false;
    boolean secondAdapterCalled = false;
    MyFirstAdapter  ma1;
    MySecondAdapter ma2;
    public Test() {
     JFrame frame = new JFrame ("Test");
     JButton butt = new JButton("Press Me");
     frame.getContentPane().add(butt);
     frame.pack();
     frame.setVisible(true);
     ma1 = new MyFirstAdapter();
     ma2 = new MySecondAdapter();
     butt.addMouseListener(ma1);
     butt.addMouseListener(ma2);
    public static void main (String [] args) {
     Test t = new Test();
    class MyFirstAdapter extends MouseAdapter {
     public void mouseClicked(MouseEvent e) {
         System.out.println("Called first adapter");
         firstAdapterCalled = true;
         ma2.mouseClicked(e);
    class MySecondAdapter extends MouseAdapter {
     public void mouseClicked(MouseEvent e) {
         if (!firstAdapterCalled) {
          System.out.println("First adapter not called yet...");
          return;
         System.out.println("Second adapter called");
         firstAdapterCalled = false;
}

Similar Messages

  • HT2731 Is is it possible to register the same apple ID in different App Stores?

    Is is it possible to register the same apple ID in different App Stores meaning in different countries? I have an iPad registered in the Hungarian App Store but now I got an iPhone as well which I want to use in Germany because certain services restricted to the country. Can I use my existing apple ID in the German App Store too or should I create a new one?
    Thanks!
    Tamas

    This link will help you. Click on or scroll down to "Pairing your wireless keyboard with another Mac.  This will generally apply to other Bluetooth devices as well.   http://support.apple.com/kb/ht1809#2

  • Possible to have two tiers listening on port 80 for OAS 10g? -- help

    I would like to have multiple tiers listening on port 80 for my application server. Is this possible?

    2 daemons, both listening on the same port on the same server.... It is not possible, unless:
    1. you have two middle tiers on 1 machine
    2. both middle tiers having the same applications installed
    3. using webcache as loadbalancer
    In any other case: it is just not possible, because the tcp packet knocking at port 80 just doens't know which daemon to choose...

  • Merge of two same items with different Qty in po

    Hi Experts,
    Is it possible to merge two Same items with different Quantity into 1.
    For Eg:- 2 similar  items  with qty 2 & 3 must show 5 qty appearing once.Is it possible through Transnotification what should be the query.
    Mona

    Hi Mona,
    If you want to display a Purchase Order on screen summarized by item, set the "Summary Type"  to "By Item" (by default it is "No Summary"). The PO lines will then be summarized by item with total quantity for each item.
    If you want to display it on the printout then you need to modify the PLD. It is quite easy actually. You can use the Repetitive Area Footer to display the summary of each item and set all fields in the Repetitive Area to be not visible and set the height to minimum height.
    Cheers,
    Marini

  • HT204053 Is it possible to have two (or more) different icloud mail accounts (not alias) under the same apple id? If not what is you best advice for all family members to have their own e-mail and still share the purchases under the same apple id. Thanks

    Is it possible to have two (or more) different icloud mail accounts (not alias) under the same apple id? If not what is you best advice for all family members to have their own e-mail and still share the purchases under the same apple id. Thanks

    mannyace wrote:
    Thanks for the response.
    So I basically won't run into any trouble? I
    There should be no issues. Its designed to work like that.  You don't change Apple IDs just because you get a new device.
    mannyace wrote:
    Thanks for the response.
    Is there any chance that the phones can fall out of sync?
    Unlikely. But nothing is impossible.   Though I don;t see how that would happen. As long as both are signed into the Same Apple ID / iCloud Account they will be N'Sync. (Bad Joke)
    mannyace wrote:
    Thanks for the response.
    If I get a message or buy an app or take a photo on the iPhone 5, how do I get those things onto the iPhone 6?
    If you buy an App, you have 2 ways to get it to the iPhone6: If Automatic Downloads is enabled in Settings->iTunes & App Store, it will automatically download to the iPhone 6 when you buy it on the 5 and vice versa if you buy it on the 6, it will download to the 5.
    Alternatively, you can simply go to the App Store App->Updates->Purchased and look for the App there and download it. Purchased Apps will not require payment again. i.e They'll be free to download to the iPhone 6 once purchased.
    SMS Messages will sync over using Continuity as long as they are on the same Wifi network. Otherwise, restoring the iPhone 5 backup to the iPhone 6 will transfer all messages received up until the backup was made onto the iPhone 6.
    Images, can be transferred either through Photo Stream
    My Photo Stream FAQ - Apple Support
    Or any Cloud service you want such as Dropbox, or One Drive.
    mannyace wrote:
    Also, something i forgot to ask initially: Should I update the iPhone 5 to iOS 8 first or does that not matter?
    If you want the Continuity features as explained above you need to update the iPhone 5 to iOS 8. Otherwise its not all that important.

  • Hi can someone tell me if it is possible to have two accounts (from different countries) in the same laptop?

    Hi can someone tell me if it is possible to have two accounts (from different countries) in the same laptop?

    Hi...
    The issue is that your credit or debit card credentials must be associated with the same country where you reside to make purchases.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article
    Billing policy is the same for both the iTunes as well as Mac App Stores.

  • Is it possible to have two Firefox browsers (3&20) on the same OS?

    I have been using my 3.6.28 Firefox for more than 3 years and still want to use it in the future. Some functions are not working when I visit websites so I need to install the newest as to see them. I have Google Chrome as my second browser but would like to swap it for the latest Firefox. Read on some forum that its not possible to have two Firefox browsers on the same Win OS. Is it possible to have both my old Firefox 3 and Firefox 20 installed on the same Win XP OS as teo different programs?

    Yes it is possible, but you need to create a new profile for the 2nd version.
    http://forums.mozillazine.org/viewtopic.php?f=23&t=2249039

  • Is it possible to have two DADs that access the same database?????

    Hello,
    Is it possible to have two DADs that access the same database?
    One DAD would be password protected with Authentication mode Per Package and the other DAD would not require a password/login
    If it is possible can you also give suggestions about how to do this
    Thanks
    Doug

    I HAD THE SAME PROBLEM WITH SHARING MY LIBRARY WITH MY SON. WHAT I DID WIAS CREATED A LIBRARY FOR HIS USE ONLY. IN ITUNES CLICK--FILE--NEW PLAYLIST AND THIS SHOULD ADD AN UNTILED PLAY LIST IN YOUR SIDE BAR. CLICK ON IT AND RENAME IT. HE CAN KEEP ALL OF HIS MUSIC IN THIS LIBRARY. SELECT ALL OF HIS MUSIC FROM YOUR LIBRARY AND DRAG IT INTO HIS. ONCE THIS IS DONE YOU CAN THEN REMOVE HIS SONS FROM YOU PLAY LIST. MAKE SURE YOU ONE REMOVE IT FROM YOUR PLAY LIST AND NOT DELETE THE FILE.
    HOPE THIS HELPS
    G4   Mac OS X (10.3.9)  

  • Is it possible to run two different versions of Apple operating system (for ex. 10.6.8 and 10.9) on a MacBook Pro, either on the same disk or from an external hard disk? If so, where would I find the details?

    Is it possible to run two different versions of Apple operating system (for ex. 10.6.8 and 10.9) on a MacBook Pro, either on the same disk or from an external hard disk? If so, where would I find the details? (In order to be able to use the older applications no longer supported in 10.9)

    If you want to add a second partition to the internal drive (in Disk Utility, select the drive, then open the partition tab and just click the + button), you should first be sure that you will have enough room to accommodate whatever the second volume will be. I am currently doing this for Snow and Mountain Lion.
    To get to whatever volume is not the startup disk, restart and hold down option/alt at the chime, which will bring up a selection of the two volumes. Use the left or right arrow keys to select it and then hit enter/return.

  • Is it possible to create two correlation id's for same message in BPM

    Hi All
    Is it possible to define two correlation id's for the same correlation in BPM.. intially we defind one field as a correaltion id but in some rare situations we are getting two fiels at time containing the same correlation id then it is generation two instances for them ,but only one instance is executing and another one is in wait mode,in monitoring its showing TBDL (to be deliver mode)...we added one more field as a correlation id in correlation editor, but its not working only the first id is working.
    Seeking your valuable suggestions.
    Thanks.

    Are you correlatiing on a field whose occurence is more one 1(like 0..unbounded).?
    if you want to correlate on the first occurence of that field  then you have to specify in the XPATH.
    try [1] at the end of xpath
    If the field contains a structure, select Multiline.
    refer [this|http://help.sap.com/saphelp_nw04/helpdata/en/ab/13bf7191e73a4fb3560e767a2525fd/content.htm] for how to specify XPATH

  • In my family we have 3IPhones 4S, one IPhone5, one IPad3, one IPadMini and two IPad 4. Is it possible to use the same energieadapter for all of those ?

    In my family we have 3IPhones 4S, one IPhone5, one IPad3, one IPadMini and two IPad 4. Is it possible to use the same energieadapter for all of those ?

    Yes but the iPhone chargers will struggle to charge the iPads ,they need more power than the iPhone chargers produce and with an iPad will charge VERY slowly
    The iPad chargers whether 10w or 12 will happily charge all your devices and Apple confirms the compatibility on the relevant web page.

  • Is it possible to use the same Switch for two different clusters.

    I have 10g Rac setup on windows.
    Now I am planning to install 11gR2 on different servers.
    Is it possible to use the same Switch for two different clusters.

    user9198027 wrote:
    I have 10g Rac setup on windows.
    Now I am planning to install 11gR2 on different servers.
    Is it possible to use the same Switch for two different clusters.
    Yes.  Technically there will not be any conflict as long as the private addresses used by the 2 clusters do not collide, and provided that the switch's port capacity and bandwidth will not be exceeded.
    Your NA (netadmin) can also configure the switch to separate the 2 Interconnects from one another (called partitioning when using Infiniband) - if the switch supports such features.
    A major consideration is not to make the switch, public. That typically cause a range of problems and can have a serious impact on an Interconnect. But using 2 private networks on the same infrastructure should not have the same problems - if configured and implemented correctly.

  • SID Problem : could not register two ABAP systems with same SID

    Dear Expert:
    We have to register two ABAP systems on different host to SLD, and these two systems have same SID.
    We use rz70 to do this,  but we found the lastest registration will overwrite the previous registration,
    that
    means we could register them both in the same SLD. (we checked this in Technical system area).
    How could we do this?  It makes us crazy........
    Thanks very much
    Ray

    Dear Stefan,
    Thanks so much for your anwser.
    But the dilemma is in one SLD we achieved this, but it is only for one case and we could
    not apply this for other systems.
    This is the snapshot in our SLD for techical system:
    Name                                        Host                             Version                                     Last Update
    D01   on eisdq01                     eisdq01                         700                                           2010/12/06 12:45
    D01   on eisdv01                     eisdv01                         640                                           2010/12/06  11:40
    We don't know if this is the illusion that SLD could do this?  But for other systems, e.g two Q systems
    the lastest registration will overwrite the previsou one.
    Thanks very much.
    Welcome suggestions from very guru.
    Ray

  • Is it possible to have two files with the same name on my Zen To

    Hia,
    Is it possible to have two mp3 files with the same name?; I.e if I'm ripping a Bach CD, there are several tracks that have the name preludium, and I hate to do the rename.
    Also, will I be able to sync my Zen so that It will only recieve new files that have been added since I last connected my Zen to my computer?
    regards,
    Fredrik

    I believe same filename is OK because the Zen Player does not really care about filename. As far as I know, the Zen database of the tracks in the player is based on the track information such as Title, Artist, Album and Genre. This means you cannot have two tracks of the same Title, Artist, Album and Genre in the Zen Player.

  • Is it possible to install two SAP system with same SID but different instance numbers on one host?

    Is it possible to install two SAP system with same system ID (SID) but different instance numbers on one host?
    If yes, then how?
    If no, then why?
    Thanks in advance.
    Regards,
    Sarim

    Is it possible to install two SAP system with same system ID (SID) but different instance numbers on one host?
    Yes, it is possible. If one is CI (PAS) and the second one is an AS (AAS). In this case there will be only one database.
    If you are talking about two separate SAP systems with separate databases (Eg: A BI and an ECC) with the same SID then the problem will be with the database (Eg: Oracle)
    The database will be installed under /oracle/SID/112_64 (ORACLE_HOME) unless one database is running on 10 G and in that case the ORACLE_HOME will be /oracle/SID/102_64
    The next issue will be with the SAP file systems like /sapmnt/SID
    The most important problem will be with the switch to the sidadm and orasid users and the conflicts there. If there is a need to stop one of the SAP systems and if you do a switch to sidadm and issue a stopsap command which system will be stopped ?
    These are few of the many problems I can think of.
    So if we are talking about two separate systems with their own databases I would rule out the possibility of having two systems with the same SID.
    Regards
    RB

Maybe you are looking for

  • Editing a PDF file with Acrobat XI pro... some "text" is not selectable and vanishes upon saving

    Hi folks. I've googled around for a few hours, but I'm completely stumped with this one. I'm trying to edit a .pdf file that was generated from Word 2007.  Mostly it edits fine, but for reason some of what appears to be text isn't selectable with the

  • CS4 Resizing in InDesign to odd %'s

    Since I need to resize 4 ads into 27 mostly different sizes ... is there something like there was Resize It (if that is the right name) for Quark ... only for InDesign? So that things size correctly without having to go in and tweek photos and re-mov

  • Use an external screen as primary screen while the lid is open

    is it possible to use an external screen as primary screen while the lid is open on a white MacBook (Lion)?

  • Try to open book in ADE, its not showing up

    Hey all My mom and I use ADE for borrowing library books for our Nook. We have each been using it for a few months, and my mom has been having issues this week. She saved the file from the library and dragged and dropped it into ADE and it wont show

  • Cant access Flash Player

    When I look at currently installed programs Adobe Flash Player is listed. I dont have an icon listed and I cant view anything. It said the download was successful, but im still in the dark. Please help with any suggestions....