Dealing with one ActionListener

Hi,
I have a class which contains the GUI of my program.
Inside this class I implement ActionListener and have a method actionPerformed(EventAction e)
Previously, two buttons in the class have used the actionPerformed method and the method has distinguished between the two using source.getText(). However I now want this method to react to the user clicking a menu item. The problem is that the menu item's name changes (it's a Most Recently Used File list) so I can't rely on checking it's text to know what to do.
I need to use an internal actionPerformed() method because the resulting action needs to use a method contained in that class, but am not sure if there's a way of getting Java to tell me the type of object that has been clicked on or any extra information.
Thanx

Try using the actionCommand.
  jmenuItem.setActionCommand("Memory 1");
  public void actionPerformed(ActionEvent ae)
    String command = ae.getActionCommand();
    if ("Memory 1".equals(command))
  }I think the action command should remain the same if you specifically set it, even after changing the item's text.

Similar Messages

  • WARNING - You are dealing with one of the most clueless of the clueless. My PC (I/N Explorer?) is blocking my download. HELP!

    WARNING - You are dealing with one of the most clueless of the clueless. My "system" is blocking my FF download attempt. HELP! ?? re the below - URL & troubleshooting info.
    Tim Crouch [email protected] 727-424-7733

    Hi, papineaubill!
    Welcome to The Canon Forums, and thank you for your inquiry!
    We appreciate your participation, though we need to let you know that the Canon Forum is hosted and moderated within the United States by Canon USA. We are only able to provide support for Canon products manufactured for and used within the US market.  If you live outside the United States, please click here and select your country or region for your support needs.
    Feel free to discuss Canon products sold outside of the United States, but please be aware that you will not receive support directly from Canon USA.
    Thanks for choosing Canon!

  • "Selecting All" while dealing with one album

    I have a question. When I am in the newest display mode in iTunes 10 (where the album/album art is on left side of the screen followed by name of the tracks on the right. I have to hold Ctrl + click each individual track because I want to select certain tracks to paste my album art. What I really want to do is to click and drag the mouse cursor simply over the tracks I want to add album art. Is there a easier way to select things other that having to click individual tracks?

    First, go to View > as List.
    Then use the search bar to your advantage. Type the name of the artist for the album at the top right. This will only show the songs pertaining to that artist/album. Then just Ctrl + A and edit multiple items and go from there
    Hope that helps.

  • Dealing with DB table-entries in ABAP OO

    Hi everybody,
    in ABAP-Reports (normally) we have deal a lot with DB table entries.
    Is there a "state of the art" for doing this with ABAP OO?
    An easy example:
    Asuming I want to select table  entries into an
    internal table from BUT000.And than I want to write: the entries.
    How would this look like in ABAP OO?
    show the internal ZTable be my object?
    or should every BUT000-Table-record be my object?
    Regards Mario
    null
    Message was edited by:
            Mario Müller

    Hello Mario,
    A very good question. This is what is called as modeling.
    I shall give you an approach into this. There is no right and wrong way of doing it. Probably, only a more desriable or better way !!
    How you model it depends on what your object is.
    If you have an internal table of sales orders, still in real world the services or methods are on a single sales order. So the object here is a single sales order.
    => I would model the class to deal with one sales order. (this more or less answers your question)
    2. Just to take this a little further.
    What I would do is have 3 different layers of abstraction.
    A UI class, a business layer class and a DB class.
    UI class can only talk to business class, business can talk to DB class. And the DB class is a static class.
    The UI class is only responsbile to do the display job.
    The UI will display multiple sales orders for eg, so u have an internal table of instances to the business layer.
    The business layer itself does validation, processing for each sales order.
    The business layer can also have soem static methods (or class methods) to select multiple records from Database. This is static, as it is not acting on one sales order, but you are returning multiple. This method should simply call a method of the DB layer.
    The DB layer is meant only to read from DB and write to DB.
    Hope this helps. Remember to reward points, if it does.
    For more highlights into this, refer to some material on design approach or design pattern.
    Best Rgds,
    Prashanth.
    SAP.

  • How does one deal with transparency in a placed file in InDesign?

    I suppose this may seem elementary, but I'm relatively new to it so here goes:
    First off, my print shop says that placed images should be in EPS format. I'm creating my files in Illustrator and some of them use a gradient mask to fade an object away. When saved as an EPS, the gradient mask shows as a white box instead of fading into the background. When I copy/paste my Illustrator image into a new Photoshop file, save it as a PSD, bring that PSD into Illustrator and save it as an EPS, the whole file is in a white box.
    Example. I want those aisle markers to not be in white boxes.
    http://i.imgur.com/lZjtu.jpg
    How does one deal with transparency in a placed image in InDesign?
    Thanks.

    If possible, one finds a new printer who can handle your files properly and doesn't insist on .eps.
    What format are you delivering to the Printer? If it's anything other than PDF (and that's at their request) all the more reason to reread the first sentence. Why on earth are you moving things from Illustrator to Photoshop and back to Illustrator? Either one of those will save as .eps (ugh), though you need to use a clipping path for transparent areas coming out of photoshop (don't really know how Illy handles it when you say to save .eps with transparent background), but you are FAR better off with either native .AI or .PSD, both of which support transparencey, unlike .eps.If yo are delivering PDF, as you should be, it makes no difference to the printer what format the placed content uses (and it shouldn't matter to him even with native files unless he's hopelessly stuck in the 90s).
    In any event, when importing from Illustrator, make sure to show the import options and check the transparent background box.

  • [svn] 4804: Bugs: LCDS-548: add code to deal with contentType="application/ xml" with one parameter (avoid

    Revision: 4804
    Author: [email protected]
    Date: 2009-02-02 17:56:22 -0800 (Mon, 02 Feb 2009)
    Log Message:
    Bugs: LCDS-548: add code to deal with contentType="application/xml" with one parameter (avoid
    name/value encoding in that case)
    LCDS-405: baseURL on HTTPMultiService should accept URLs which start with "/"
    Added convertParametersHandler and convertResultsHandler function hooks to RemoteObject
    to support framework code which wants to modify the service behavior.
    Moved "properties" from rpc/http/AbstractOperation to rpc/AbstractOperation so we can use
    it for customizing the handling of remote object results
    Couple of minor ASDoc fixes and one tab -> spaces change
    Doc: minor asdoc edits
    QE: LCDS QE will verify the bugs in this one
    Reviewers: Mete, Pete, Seth, Ed reviewed different parts of this checkin
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-548
    http://bugs.adobe.com/jira/browse/LCDS-405
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractInvoker.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractOperation.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/AbstractOperation.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPMultiService.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/Operation.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/RemoteObject.as

    Hello,
    How about this as an alternative:
    Use a functional global which has 3 cases:
    1. open config file - it opens the config file and reads the contents into a string (which is the functional global data), and you only do this one time at the beginning of the program.
    2. edit config data - it edits the string, which are really the contents of the file, but doesn't worry about writing to the file.  you could even get fancy here, and allow an array of tags and an array of values as input, and it would go update/edit all the tags to have the corresponding values.
    3.  close config file - it writes the current string data (the functional global data) to the file and closes it.
    Using the functions in the string palette, I think you'll find most of the code for that module/functional global will be easy to write.
    I hope this helps!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • How should one deal with sub-projects?

    Hello to all!
    Let me first clarify my title-question.
    On my current project I faced software malfunction [FCPX quitting] when I reached 17 minutes of building the video on the timeline. [As a reference, allow me to call this 17-minute part of the video in making as the main project.]
    Remembering from an earlier thread [? Mr. Russ being the contributor], I opted to continue the project as a separate project which I seek to call as the sub-project  Now even this sub-project is of a 14 minute duration and I have need to start a sub-project 2.
    I would now like to be guided as to how to deal with these sub-projects while editing the video and after finishing the project.
    Firstly, while editing. My present plan is to complete the project's video utilising as many sub-projects as needed, and then add the sub-projects to the main project. This done, I intend to add voiceover for the completed project. During this process, my questions are this...how do I add the sub-projects onto the main project? If I select and copy/paste the sub-project, it gets added as 'connected clips'...this is okay if one can export the project as such. But, when a voiceover has to be added, further retiming of the clips are called for and at this stage problems arise. Now, as I am writing this, it is striking me that I could make this added sub-project as a secondary storyline, get done with the retiming after the voiceover is added, and export the project. Have not done this before and would like guidance from senior contributors in this issue.
    Secondly, when the project is exported and is being archived, do I need to have all the sub-projects or delete them to save drive-space?
    Thanks in advance.
    Have a great day.
    Dr. Somanna

    Thanks Karsten for this further instructions. The present project I am working on is being done as a race against time. Faced a problem when dealing with a stack of generator clips one upon the other and each clip being given different commands regarding changes in position and rotation. Beyond the 17 minute mark, one click upon the parameter in the inspector window, and the application quit. When this quitting became a regular feature, I just remembered a thread in which one contributor wrote that he usually divides his projects into 10 minute bits before making up the whole project. Not willing to spend time further on this problem, being in a very 'creative frame mode' I simply continued working upon the project by starting up a 'sub-project'.
    Regards and take care.
    Dr. Somanna

  • My computer died and I had to buy another one.  Now I can't sync my ipod classic.  What is the deal with this?  I added songs about three months ago and it was fine.  Now it won't sync.  It says it has a duplicate file.

    My computer died and I had to buy another one.  Now I can't sync my ipod classic.  What is the deal with this?  I added songs about three months ago and it was fine.  Now it won't sync.  It says it can't sync because there is a duplicate file.

    There are server problems right now with iMessage effecting some users.  See http://www.apple.com/support/icloud/systemstatus/.

  • Hi, my Iphone 6 dropped in water, and couldn't save it back although I tried with rice bag. So,how much would be cost if I can exchange with new one? Please kindly drop message about how to deal with it. Thank you.

    Hi, My Iphone 6 " iOS 8.1"  is dropped in water, and couldn't save it back although I tried with dryer and also put it in rice bag for 3 days. The flash light was still on even though the screen shows up nothing at all when i try to switch on after 3 days I put in the rice bag. So,how much it would be cost if I can exchange with new one? Please kindly drop message about how to deal with it. Thank you.

    Out of Warranty replacement on iPhone 6 is $299 US, adjust for your location.
    It is highly suggested that you make a Genius Bar appointment to avoid delay
    if going to an Apple store.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/

  • Just installed Lion on one of my macbooks.  2nd macbook has tiger.  Have two iphones, both 3G.  Trying to decide how to deal with icloud.  I have mobile me working well now.  How should I deal with icloud while still with 2 3G iphones (mine

    I have 2 macbooks (mine & my wife's).  I just loaded osx Lion on my macbook. We have 2 iphones.  Both 3G.  I have two separate mobile me accounts that are working fine.  What is the best way for me to deal with icloud as long as we have two 3G iPhones?

    This is a user forum I feel you need to deal with Adobe customer services or support chat did not work in you case.

  • How to deal with changing in Make-to-order style sales order?

    Hi, SAP experts,
    our situation and requirement:
    my client use make-to-order style to create sales order, normally one item in sales order.
    And this item stand for a dummy material, which include several components.
    Limited with material purchase delivery schedule, sales orders need to be made as planned sales
    orders to drive MRP to run out material requirement in ahead. Therefore, planned sales orders will
    often changed as final assigned customer request.
    1. Could be a possible to define components level to release sales order?
    2. If components in sales orders is replaced or added, even whole sales order released, production order initialized, how to deal with it?
    Scenario one: components in sales order added, modified in sales order, which will automatically create another production order for replacement action? if not, how to do?
    Scenario two: components in sales order replaced, how this sales order requirement transfer to production order?
    3. what about costing calculate for this changing?
    Thanks for your kindly help in advanced,
    Zhou Zhen

    Don't forget, this include both concrete inner classes as well as any anonymous inner classes you create, like
    myButton.addActionListener(new ActionListener()
      // Yada Yada Yada

  • Literally the worst customer support experience I've ever had to deal with -- Why don't they let their customers speak to supervisors on demand?

    Call 1: I spoke to them to see if I was eligible for an upgrade. It turned out they had accidentally counted a temporary phone switch to an old device as an upgrade. The representative was extremely slow minded and took over an hour to read through my notes and process what I was saying happened, consulting with his supervisor multiple times. He claimed to have noted everything and told me I had to go to a verizon store to verify in person that I was still using my original phone, and that then I would be able to get an upgrade immediately.
    Trip to the store: Drove an hour only to be told by the store rep that there were NO NOTES on my account about the issue and there was nothing he could do to help me and that I'd have to call customer support again. The store was closing in 20 mins and customer support seems to take 45 minutes minimum to resolve anything, so I left.
    Call 2: Asked a woman to speak to a supervisor about the guy who wasted 2+ hours of my life and gas money. She put me on hold for a long time, came back and said they were all busy right now, would I like to leave my complaint with her? I said no thank you, I will keep waiting. She said ok, and proceeded to hang up.
    Call 3: Asked a different woman to speak to a supervisor, she put me on hold for a long time and then told me that since I wasn't an authorized user I could not speak to one... lol ok. Had a family member call and authorize me.
    Call 4: Asked a guy to speak to a manager. He insisted on taking the complaint himself. Why would I trust someone to take a complaint about their colleague possibly sitting a few desks away when many of them have proven to be incredibly incompetent already? It sounded like we were making progress... then he hung up too.
    Call 5: Asked yet another woman to speak to the manager. She demanded a reason, I told her it was to make a complaint and she told me about a dozen times that the managers would just tell her to take the complaint. I insisted, she refused... finally I threatened to close all of our accounts unless she let me speak to a manager. She said they couldn't right now since the office was closing soon, but that one would call me within 24-48 hours. I'd bet my life savings that never happens. At that point I tried to talk to her about the original upgrade issue, and she said her system had suddenly crashed and that I'd have to call back the next day...  Seriously???
    Absolutely unreal how horrible their customer support is. Will be switching to T-Mobile immediately.

    Having worked in customer service, I have some experience with this kind of situation.  Reps are typically trained to make all attempts to handle complaints by themselves, because there are obviously many more reps than supervisors.  They're usually REQUIRED to fully authorize the account and to get the whole situation from the customer prior to referring you to a supervisor.  One of the biggest problems is that many customers think that demanding a supervisor is a way to guarantee you will get what you want.  If the reason for your request to escalate isn't a valid one, the supervisor won't give in to you either.
    There are plenty of times in my own experience, especially as a brand new rep out of training, that I took a long time to research and get an understanding of the issue.  Yes, I wasn't moving at light speed, but that doesn't make me an idiot.  It means I was trying to gather as much info s possible to try and deal with the issue. But I had plenty of customers tell me I was stupid and to transfer them to my supervisor, simply because I took longer than their patience could tolerate to get all the details I needed.
    I have never had a job that I executed flawlessly day in and day out.  Maybe you have and that's why you can't tolerate a person taking a little longer to wrap their head around the issue, but I'd rather doubt it.
    I also don't think you will find reps who work at light speed and utilize a magic wand to fix people's issues at T-Mobile, either, but I guess it never hurts to try.
    Just to clarify: I do not work for Verizon and never have.  I worked for a residential phone and internet company.

  • How to deal with several itunes users in a house

    I will try to be brief but explain what I don't know how to configure.
    We have three children. We have 5 laptops that work wirelessly, and we have music and photos all stored on a shared NAS drive. We moved our iTunes music folder successfully to it when we set up.
    1. We set everyone's folder location, under preferences, to the folder on the NAS drive.--- It won't stay. With any reboot or interruption in signal it switches back to the individual computer's hard drive. This is a pain, because every time you reset it, you have to wait for 30 gigs of music to update. This has been asked before and no one answers it. Is it a bug and is Apple aware?
    2. I understand that we can "share" our libraries. But how do we deal with the issue of individual family members purchasing songs from iTunes? As in, I would like to add songs my teen bought to my ipod, but how do I know if there is new music beside asking them to "log" all their purchased so I can manually look for them. We can't just sync every time. They have nanos, and I don't want to have to weed through Christmas music, audio books, and Kidz Bop each time and delete them. What about someone finding they are not "authorized" to play a song? We can have 5 authorized no? I tried to drag something from a shared library onto an ipod and it wouldn't let me.
    Please help. My last question dropped to page three by the end of the day with no response.

    I guess then I need to read more about my NAS drive, because it is always on. I read in another thread about the same issue the question was asked, "Is your NAS drive mounted?" I have no idea what that means. There was other ideas of making alias of the NAS iTunes folder and putting in on the laptop's dock, but I didn't quite understand that either.
    I thought NAS was a rapper. Well, I have no idea what a NAS drive is. But it should have no influence on iTunes' behavior. If that drive is always on and visible on your Desktop (= "mounted"), iTunes shouldn't change its settings re. its Library.
    It would be easier to draw all this instead of explaining, but, well, we are not that far yet.
    0: If you set up on all Macs that iTunes stores its files on one drive, iTunes should not change this on any of them as long as it is always on, as you said. If it does, thought, something is wrong. Don't ask me, what.
    Ok, just to make this even more complicated, LOL if each person has their own laptop and ipod, and everyone in the household has used their 5 authorizations on each other's computers, then theoretically, when everyone accesses the itunes library they should be able to copy the songs onto their devices?
    1: You can play all your music on this external drive from anywhere in the house.
    2: You can activate the DRM files on every Mac in the house and play them.
    3: You canNOT use one iPod on more than one Mac, regardless if the music is DRM or not. iPod 1 is associated with Mac A, iPod 2 with Mac B etc. If you change that, all music from iPod 1 will be deleted before the music from Mac B will be copied to it. So, it's always 1:A, 2:B etc., not iPod 1 : Mac A & B & C... Otherwise, your iPods would be regular external hard drives from which you could copy tons of music to someone else's PC, which is illegal. That's why all the music on an iPod is made invisible. And even after making it visible with special utilities (I tried that once), you won't be able to recognize which song is which. CDs are not stored together, etc. Apple would not have got the permissions for the iTunes Store / iPods from the music industry if it was the perfect utility for illegal music sharing.
    Did I savvy what you meant?

  • How can I create unique partnerships to deal with like EDI messages?

    I have an EDI to Application partnership setup currently that deals with translating MEDRUC type EDIFACT messages to a mainframe format. The setup is
    Sender = PARTNERA,
    Receiver = PARTNERB
    DocType = MEDRUC.
    In the Input EDI tab the
    Sender Qualifier ID = ZZ:PARTNERA
    Receiver Qualifier ID = ZZ:PARTNERB
    Standard = EDIFACT
    Version = D
    Release Number = 97B.
    Use UNG to locate partnerships = No
    EDIFACT messages contain all this information in their UNB and UNH segments which is where SunONE IS B2B looks to then match against the relevant partnership. My problem is this does not go to enough granularity for me to distinguish uniqueness for the second partnership I need to create.
    The problem is the "Association assigned code" field in the UNH for EDIFACT messages is not catered for anywhere in the partnership details area. This means then that whilst my existing partnership deals with Simplified Billing Claim MEDRUC's which is Association assigned code = SBC20, I can't create an EDI to Application partnership for PARTNERA and PARTNER B to cater for Two Way Gap Claiming MEDRUC's which are Association assigned code = TWC10, ie the two messages are D97B MEDRUC type messages only distinguished from each other by this Association assigned code.
    Any ideas how can I then create a unique EDI to Application partnership for this TWC10 MEDRUC message?
    What I am thinking I will have to do is make this second partnership Application to Application and create a custom service to wrap the MEDRUC message with a HREC/TREC and use the parameters in the HREC to dictate the DocType rather than use the UNB/UNH segments in the MEDRUC?

    Hmmm. It looks like way back when the decision was made on how specific the keys had to be, they didn't get quite specific enough for your case. I'm not super experienced with EDIFACT but I'll throw out some suggestions based on my HREC and X12 knowledge.
    A. Could you handle both instnaces through the same partnership, but alter the map to create unique outputs based on the two different types? At least of the cards would need to be handled through Route, but you could have that picked up by a simple Outprep / Gateway Service list that put the data where you wanted it.
    B. Before Parse, run a custom service that is capable of inspecting for which type of data it is, then modify one of the key fields in place to find the Second partnership. Really getting adventurous, maybe you could alter keys in the UNG to make the distinction. This assumes that you don't have both types of documents in the same interchange.
    C. Your idea may be workable. Can you give some more detail on the make-up of the Service list and the destination/processing of the two differnt types of MEDRUC?
    Thanks.

  • How to update multiple Sales Orders with one IDOC using IDOC_INPUT_ORDCHG

    Hi Gurus,
    Here's my scenario:
    Consider there are 2 Sales Orders for same Purchase Order -
    Open Quantity
    Sales Order 1
    Article A1
    1
    Sales Order 2
    Article A2
    1
    Say if I want to change Open Quantity of both SO 1 & SO2 by dispatching 1 Quantity each for Article A1 and A2 via ORDCHG, observed that in Include LVEDBF0N, XVBAK-VBELN is checked for only 1 Sales Order.
    Whether it is possible to update multiple SOs with one IDOC using IDOC_INPUT_ORDCHG?

    Hi,
    Check out this link, this deals with the problem you are facing.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/802f0ed1-a17a-2c10-7db4-d515a5b047ed
    Regards,
    Runal

Maybe you are looking for

  • Java applets won't run on Safari???

    I have reinstalled Java twice, and it still won't run any Java applets. It just sits there with the cup logo and the arrow on either side. It works fine on Firefox but not Safari. Help?

  • Cannot connect to internet with static IP

    Hello, As the title says I cannot connect to the internet while using either the 'DHCP with manual address option.' or the 'Manually' option in my network preferences. I know I have both the Subnet Mask and Router numbers right, and have tried a diff

  • Variables in text

    When using Captivate 5 why does the text style change when I add a variable? For some reason it seems to make the font thinner and shift it down on the screen. This means that I can't align anything based on what I see in design mode. I have to run t

  • Crosstab Query re Grouping Data into Value Ranges

    Hi I am trying to analyse some data in a Crosstab & have a query re grouping. The data contains sales transaction info such as selling price, quantity etc. I would like to create a grouping in the Crosstab based on a sale price range (eg £0 - £10, £1

  • Problem with importing raw files

    i get this weird pink artifact in a horizontal line down all my rw2 files. im using a macosx leopard pshop extended 5.1 , camera is a gh2 panasonic , can anyone tell me whats wrong please? im new to photoshop/digital photography.