If you make an array of buttons, whats does the listener listen out for?

for example:
JButton [] testButtons [6];
for (int i = 0; i< 6; i++){
  testButton[i] = new JButton[]
  testButton.addActionListener(this)
public void actionPerformed(ActionEvent e){
if(event.getsource) = ??????
I've tryed testButton[i], testButton[1], testButton[]. testButton, ect, but nothing seems to work. What do I need to do?

That looks like a good idea - thanks...
It would also allow a switch-case structure instead of a long chain of if/if-elses...
but would you have to define a long list of ints as variables to refer to for each specific actoin sequence?
like...
int LOAD_FILE=1;
public void actionPerformed(ActionEvent ae) {   int index= ((IndexedButton)ae.getSource()).getIndex();
switch(index){
case LOAD_FILE: //whatever
break;
}[/code
regards,
lutha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • What does the 1 year warranty for the Macbook air cover

    What does the 1 year warranty for the Macbook air cover

    choose your model/region/language at http://www.apple.com/legal/warranty/

  • Related with EDIMSG table.what does the field ACTFLAG stand for in EDIMSG.

    Hi Gurus,
    Can anyone tell me what does the field ACTFLAG flag stand for in EDIMSG table.Does it mean that if the ACTFLAG field = 'X',than the particular release is no more used in SAP.
    Because even if I create a partner profile with MATMAS01 as basic type and seg.release in idoc type = '30A'..i am able to receive IDOC's.whereas the ACTFLAG = 'X' for this particular release in EDIMSG table.
    Your help will be much appreciated.
    Thanks in advance.

    Hi,
    Thanks for your immediate response.
    so you mean that MATMAS01 should not be used as ACTFLAG = 'X' in EDIMSG table.
    Than why can we still generate the IDOC's with release no 30A when SAP is not supporting this release.
    Thanks in Advance.

  • What does the 'SMART' flag signify for a network interface?

    When I run ifconfig on my Mac OSX (Yosemite) my Wi-Fi interface (for example) has these flags:
    en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    What does the 'SMART' flag refer to? I haven't been able to find this in any man pages.

    If you want information at that level of detail, you have to look at the source code for ifconfig:
    http://opensource.apple.com/source/network_cmds/network_cmds-457/ifconfig.tproj/ ifconfig.c
    which in turn refers to if.h:
    http://www.opensource.apple.com/source/xnu/xnu-792.13.8/bsd/net/if.h
    which shows that it refers to the "IFF_NOTRAILERS" bit. The comment reads, "obsolete: avoid use of trailers."

  • What does the acronym PH stand for in the article id number

    Trying to figure out what the different acronyms stand for in the article id number. I know HT stands for how to and TS stands for trouble shooting. What does PH and HE stand for.

    PH refers to product help; these articles are the same as the product's content in the Help Viewer.
    HE articles describe navigating Apple's support system itself.
    (79649)

  • What does the field Inconsistent mean for ABC Analysis for Cycle Counting report

    What does column "Inconsistent" mean for report ABC Analysis for Cycle Counting (T-code MIBC)?  The reason I'm asking is because I see TotalStock values greater than 0, but the Accounting 1 view for Material Master and MMBE both show zero stock.  I do not understand why TotalStock in the report does not show zero.  Can anyone explain how this can happen?
    Note: the report is run for consumption/usage date range.
    Thank you,
    Doug

    Hi,
       MBEW table and MMBE transaction will show the current stock. When you run MIBC report for consumption, the system considers the consumption for the date range given (from MVER table), which may not be equal to the current stock. Refer the KBA:  1817237 - Stock quantities and stock values in MIBC  which explains the system design.
    Regards,
    AKPT

  • What does the prefix FND stands for?

    In oracle application there is a prefix FND for some objects such as FND_USER table. What does it stands for or it's descriptive meaning.

    FND stands for "Foundation", which includes all common applications (Users management for example)
    In the database, the table are stored into the APPLSYS scheme.

  • What does the word "vulnerable" mean for Adobe download

    I want to use Hulu, but my computer says I need to update Adobe Flash. When I click on it, there is the world "vulnerable" next to the download.
    DOES this mean I should not download because it might negatively affect my computer.

    vulnerable means oudated plugins and its susceptible for attack.
    So you need to update your plugin/software to the latest version.

  • What does the acronym SDPM stand for?

    I know SDPM has to do with user messaging. The schema owner of the metadata schema for the stuff is ORASDPM, but what does SDPM stand for?
    Thanks.

    This info is from the PM group:
    SDP is a legacy acronym for Service Delivery Platform.
    Messaging (User Messaging Service - UMS) was a component under the SDP umbrella, hence the "M" in SDPM is for Messaging in the schema name for UMS.
    (So, SDPM is "Service Delivery Platform Messaging.")
    By the way, the schema name has been changed for 12+c+. In 12+c+ it is called UCSUMS, short for User Communication Services / User Messaging Service. User Communication Services is the umbrella under which UMS and another component, OWLCS (Oracle WebLogic Communication Services), fall.

  • What does the extension aspx stand for?

    I have a file that was sent to me...and now I cannot open it! The extension is aspx, and I would like to know what that stands for? What program do I need to open this file in the correct format? Thanks
    Merry Christmas to you all!

    Hi,
    Please check the following link:
      http://pcsupport.about.com/od/fileextensions/f/asp​xfile.htm
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • What does the VPN function do for me?

    I have a VPN function on my iphone what is it for?

    It is used for connecting to a Virtual Private Network.
    Usually they are used by employers for remote access to their systems by employees.
    You probably don't need to use it.
    Ian

  • What does the category "other" stand for in storage?

    I'm trying to figure out what files "other" are when I go to about this mac- storage.

    Apple support article for OTHER:
    http://support.apple.com/kb/HT6047
    Do not become overly concerned or obsessed about it.
    Ciao.

  • What does the acronym "PF" stand for in statement "SET PF-STATUS"?

    Hi ABAP Experts,
    I've been wondering this for quite a while.
    Thanks in advance.

    Hi Sandeep, Thomas, Ivan, BreakPoint, Rob and other ABAP experts,
    Thanks a lot for your quick response! I've awarded points accordingly.
    I tried to search SDN again using keywords "PF Personal Function" and found some posts similiar to mine:
    PF-STATUS
    full form of pf status
    It seems that only the ABAP team at SAP AG can give a final answer. For the moment, I think that "PF" most likely stands for "Program Function", not "Personal Function" because the statement SET PF-STATUS deals with the user interface of a program, or "Programmfunktionen" because ABAP keywords are English (though the term "Programmfunktionen" is a lot like "Program Function").
    Regards,
    Bo
    Edited by: Bo Wang on Oct 7, 2010 6:23 PM
    Edited by: Bo Wang on Oct 7, 2010 6:31 PM
    Edited by: Bo Wang on Oct 7, 2010 6:40 PM

  • What does the system recover kit entail?

    I dropped my wife's HP pavillion dv4i notebook, and afterwords had to replace the HDD.  The Notebook did not come with a recovery disk to reinstall all the software it came with.  I did the USB tool to reinstall the correct verions of windows 7 but I don't have a valid Windows product key.  the sticker on the bottom with the key is now unreadable.  I put the damaged HDD in a external case and am attempting to read the key without any luck.
    What does the system recovery kit for consumer notebooks come with besides drivers?  would this contain a new product key?
    This question was solved.
    View Solution.

    The Recovery kit installs Windows and all original drivers/software. Yes it includes an activation.
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • How do you make an array of image icons and then call them?

    How do you make an array of image icons and then call them, i have searched all over the internet for making an array of icons, but i have
    found nothing. Below is my attempt at making an array of icons, but i cant seem to make it work. Basically, i want the image to match the value of the roll of the dice (rollVal)
    Any help would be greatly appreciated, some code or link to tuturial, ect.
    /** DiceRoller.java
    * Roll, print, Gui
    import javax.swing.*;
    public class DiceRoller extends JFrame
         private ImageIcon[] image  ;
         public String[] images = { "empty", "dice1.jpg",
                   "dice2.jpg", "dice3.jpg", "dice4.jpg",
                   "dice5.jpg", "dice6.jpg" };
         public Dice die;
         private int rollVal;
         public int rollNum;
         private JLabel j1;
         public DiceRoller(){
              j1= new JLabel("");
           die =new Dice();
           int rollVal;
           rollVal = die.roll();     
           image = new  ImageIcon[images.length];
         for(int i = 0; i < images.length; i++){
          image[i] = new ImageIcon(images);
         if (image!=null){
              j1.setIcon(image[rollVal]);
         System.out.println("Roll = "+die.roll());

    Demo:
    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    public class IconExample {
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    launch();
        static void launch() {
            try {
                Icon[] icons = new Icon[6];
                for(int i=0; i<icons.length; ++i) {
                    String url = "http://www.eureka-puzzle.be/cast/images/dice" + (i + 1) + ".jpg";
                    icons[i] = new ImageIcon(new URL(url));
                display(icons);
            } catch (MalformedURLException e) {
                throw new RuntimeException(e);
        static void display(Icon[] icons) {
            JPanel cp = new JPanel();
            for(Icon icon : icons) {
                cp.add(new JLabel(icon));
            JFrame f = new JFrame();
            f.setContentPane(cp);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

Maybe you are looking for

  • BSOD during Install

    Bought Dreamweaver CS5 Educator and Student edition for daughter's college class.  Tried to install on family computer, which is basic 1Gb, AMD Athlon 64 2800 machine.  At about 20% installation progress (installing ADOBE HELP files) get quick BSOB a

  • Folio isn't in the folio producer. But its still being published.

    I deleted a folio but its still showing up in the app. I have tested creating a new folio. And i am able to publish and unpublish. I have read that it might be a ghost or frozen folio.

  • Downloading upgrade 6.0

    I have WinowsXP SP2 and when i try to download 6.0 the information bar shows so i say download the file and it says i have to resend the imformation, so i do and the information bar pops up, and it goes in a circle. PLEASE HELP ME!

  • Publishing portal service as Web Service !!

    Environment : EP 6.0 Sp2 on J2EE 6.20. Is there a way to publish web service for existing portal services ??

  • Music app on iPad With iOS 5

    I updated my iPad to iOS 5 and when I went to the music app I couldn't find the shuffle button so I was wondering if their is one and if their is where is it