JRadioButton problem...could you help me please?!?

I've an array of JRadioButton tha are created in a "for struct" but when I try to add an ActionListener the compiler don't like that!!
here is when I create JRadio button:
for (cnt = 0; cnt < items; cnt++) {
cmdID = (int)rMsg.getCIdAt(cnt);
System.out.println(cmdID);
radio[cnt] = new JRadioButton(cmdID + ": " + rMsg.getCNameAt(cnt), false);
radio[cnt].setBackground(new java.awt.Color (250, 250, 200));
radio[cnt].addActionListener(this); // here comes the problem
And this is what the compiler sent out:
ui/ShowMachine.java:95: addActionListener(java.awt.event.ActionListener) in javax.swing.AbstractButton cannot be applied to (ui.ShowMachine)
radio[cnt].addActionListener(this);

I'm sorry the source code was not completed (copy and paste error... ;o) )
this is the right source:
radio = new JRadioButton[items];
ButtonGroup group = new ButtonGroup();
JPanel ButtonPanel = new JPanel();
for (cnt = 0; cnt < items; cnt++) {
cmdID = (int)rMsg.getCIdAt(cnt);
System.out.println(cmdID);
radio[cnt] = new JRadioButton(cmdID + ": " + rMsg.getCNameAt(cnt), false);
radio[cnt].setBackground(new java.awt.Color (250, 250, 200));
radio[cnt].addActionListener(this); // here comes the problem
group.add(radio[cnt]);
ButtonPanel.add(radio[cnt]);
Compilation ERROR it's reported in my first message!
thank's for the help
bye
ric

Similar Messages

  • From Sweeden - could you help me please ( i've tryed to do that for almost one day)

    i thing i have aloop problem, could you help me please. i trying to do if user not put in correct value (number instead of a letter or vice versa ) how can the program go back to first menu ( i have been studying for 3 weeks)
        enter code here
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace @break
        class Program
            static void Main(string[] args)
                //Meny
                Console.WriteLine("\n HÄNGA GUBBE\n");
                Console.WriteLine(" 1) Lägg till ord");
                Console.WriteLine(" 2) Lista alla ord");
                Console.WriteLine(" 3) Spela");
                Console.WriteLine(" 4) Avsluta");
                int Valet;
                Console.Write("\n\tVälj 1-4:  ");
                Valet = int.Parse(Console.ReadLine());
                switch (Valet)
                    case 1:
                        Console.WriteLine("\n lägg ett till ord! ");
                        break;
                    case 2:
                         Console.WriteLine("\n Lista med alla ord :\n");
                         string[] array = { " Lev", " Skratta", " Gledje", " Gråt", " Njut" };
                         Array.Sort<string>(array);
                         foreach (var c in array)
                             Console.WriteLine(c);
                         Console.WriteLine("\n");
                         break;
                    case 3:
                        string guesses, bokstäver;
                        Console.Write("\n Hur många fel får man ha? ");
                        guesses = (Console.ReadLine());
                        Console.WriteLine(" Utmärkt, då spelar vi!\n");
                        Console.WriteLine(" Felgisningar :" + "0/" + guesses);
                        Console.Write(" Gissade bokstäver " );
                        bokstäver = (Console.ReadLine());
                        Console.WriteLine("Aktuellt ord");
                        Console.Write("Gissa bokstav : "+bokstäver+" \n");
                        break;
                    case 4:
                        Console.WriteLine("\n  HEJ DÅ! \n");
                        Console.Beep();
                        break;
                    //avbryter while loopen, avslutar spelet
                  

    What do you mean by "lots of problem"? The code I posted certainly compiles and runs just fine. Copy the following code into your Program.cs file in Visual Studio and run it and you will see that it works:
    using System;
    namespace ConsoleApplication1
    class Program
    static void Main(string[] args)
    //Meny
    Console.WriteLine("\n HÄNGA GUBBE\n");
    Console.WriteLine(" 1) Lägg till ord");
    Console.WriteLine(" 2) Lista alla ord");
    Console.WriteLine(" 3) Spela");
    Console.WriteLine(" 4) Avsluta");
    bool exit = false;
    do
    int Valet;
    Console.Write("\n\tVälj 1-4: ");
    try
    Valet = int.Parse(Console.ReadLine());
    catch (Exception)
    Console.WriteLine("Error....!");
    continue;
    switch (Valet)
    case 1:
    Console.WriteLine("\n lägg ett till ord! ");
    break;
    case 2:
    Console.WriteLine("\n Lista med alla ord :\n");
    string[] array = { " Lev", " Skratta", " Gledje", " Gråt", " Njut" };
    Array.Sort<string>(array);
    foreach (var c in array)
    Console.WriteLine(c);
    Console.WriteLine("\n");
    break;
    case 3:
    string guesses, bokstäver;
    Console.Write("\n Hur många fel får man ha? ");
    guesses = (Console.ReadLine());
    Console.WriteLine(" Utmärkt, då spelar vi!\n");
    Console.WriteLine(" Felgisningar :" + "0/" + guesses);
    Console.Write(" Gissade bokstäver ");
    bokstäver = (Console.ReadLine());
    Console.WriteLine("Aktuellt ord");
    Console.Write("Gissa bokstav : " + bokstäver + " \n");
    break;
    case 4:
    Console.WriteLine("\n HEJ DÅ! \n");
    Console.Beep();
    exit = true;
    break;
    //avbryter while loopen, avslutar spelet
    } while (!exit);
    If you can't get this to work despite someone actually giving the exact code you should probably ask some developer to help you.
    If you have some logical issues in your code that's another issue. Please start a new thread if you have a new question.
    Note that the forums are not for anyone else to write an entire application or class for you though :)
    Please remember to close your threads by marking helpful posts as answer.

  • TS1453 Hi, I bought Apple tv traying to rent a movie but there problem with itunes, and there is on apple tv don't have my country. could you help me please how can I solve this problem?

    Hi, I bought Apple tv traying to rent a movie but there problem with itunes, and there is on apple tv don't have my country. could you help me please how can I solve this problem?

    Whinston,
    I live in Azerbaijan. Recently I bought apple tv in New York. When I come back to my country tried to rent movies from my country but couldn't find my country name on apple tv menu, so there is a problem I don't know how to fix it. is there have another way to take a rent movies?

  • I moved to new house where I have wifi base station I made extension via TP-link power line adapter and connect my Airport utility 6.3.2, but I don't now how to set up as a second network with one IP address?Could you help me please?

    I moved to new house where I have wifi base station I made extension via TP-link power line adapter and connect my Airport utility 6.3.2, but I don't now how to set up as a second network with one IP address?Could you help me please?

    Urvergessen wrote:
    +You may have already done this, but do you have the first AirPort Express configured to "Allow this network to be extended"?+
    Could not find that setting anywhere.
    It's in AirPort Utility, AirPort panel, Wireless tab.
    When I'm within the range of the base station I connect normally, but further away the connection drops despite the fact that the other Airport is very close and light is green. Interestingly, my PB Pro has signal almost everywhere in the house, but my iPhone and Mac Mini don't. Most likely just a hardware difference?
    In AirPort Utility with the second Express, in the AirPort panel, Wireless tab, have you checked "Allow wireless clients"?
    The second AP does show an IP address: 10.0.1.3.
    With a "Configure IPv4" setting of "Using DHCP", that suggests that the second Express really is connecting to the first Express. In that case I have no other explanation of your your problem.

  • I would need to install Adobe Connect Add-in Test for only one webinar. When I pressed instal button -  it said to me - it cannot be written on hard disc. Could you help me, please. Bretislav

    I would need to install Adobe Connect Add-in Test for only one webinar. When I pressed instal button -  it said to me - it cannot be written on hard disc. Could you help me, please. Bretislav

    After posting my concern/question, especially in regards to the optical drive, I read this on this forum:
    Jul 11, 2011 5:21 AM      
    I would like to update my macbook pro from Tiger to Snow Leopard, but my optical drive is not working. Can I take my macbook pro into the apple store and have them install it via a portable drive?
    MacBook Pro, Optical drive is no longer working
    Another poster replied, "Yes, I believe they will."
    Is this true? Can someone verify this?  Any idea of cost?  I really don't need my optical drive.  Besides, end of year, I'm getting a new Mack Book Pro.

  • HT5361 I can't see right my mails. I have to double-click in my mail for reading it. Otherwise, the only think I can see, is the list of my mails. Could you help me please?

    I can't see right my mails. I have to double-click in my mail for reading it. Otherwise, the only think I can see, is the list of my mails. Could you help me please?

    Go to the right side of the list view and place your cursor over the edge until it turns into a double arrow, then click and drag to the left.
    If using the Classic layout, go to the bottom of the screen and after getting the double arrow, click and drag up.

  • Regarding replacement path.. Could you help me please .. ?

    Dear all,
    I have problem when i use variable replacement path, where it replace another variable.
    The scenario is like this:
    I have variable cal. month user input where the type is interval (let say it's called var A).
    Then i create rep. path variable cal. month:
    1. Replace with : Key
    2. Use Interval : From Value.
    I use this rep. path variable for restricted KF.
    When i run the report:
    I fill in the value for Var A:
    01.2003 - 05.2003
    The invalid things are:
    1. Rep. Path variable only get the value 01.2003. The impact the KF is only restricted by 01.2003.
    It supposed to be restricted by 01.2003, 02.2003, 03.2003, 04.2003.05.2003.
    The questions are:
    1. How can i overcome this problem?
    2. How should i do, if i want to use replacement path in restricted KF that can restrict by 01.2003, 02..2003, 03.2003, 04.2003, 05.2003 ???
    Could you help me to suggest what i should do please .. ?
    Really need your guidances....
    Regards,
    Niel.

    Hi Niel,
    When you use a variable(v1) of processing type replacement path and try to replace it wih another variable the replacement is only by single value. This you can find by details tab in the variable(v1) being created.
    Hence you have only options of replacing it wih from value/ to value/ difference.
    I didn't undersand why you wish to use variable(v1) wih processing type replacement path when you could have used the input variable type for restriction of the characteristic in the restricted key figure.
    I think for your requirement variable processing by manual input is more suitable unless you have some reason for replacement which I didn't undestand.
    Thanks and regards,
    Sunmit.

  • Regarding delta .. Could you help me please ..

    Dear All,,
    I have a problem in extraction and it is not solved almost one weeks. I have delta in Quotation (Business content). And now the extraction is getting error.
    The error is conversion over-flow (this error happen in CRM user-exit not in BW). And i plan to fix the data in the CRM.
    The problem is i don't know what transaction no is ??
    I plan to know the data delta being fetched.. I mean in the delta just now, what's data BW is fetching .. ??
    e.g. Just now, BW is fetching the data where created date at:
    01 December 2007 until 25 January 2008.
    But i don't know how to make it ??
    Could you share your experience how to make it please .. ?? :).
    Regards,
    Niel.

    check this thread
    Generic Delta Function Module
    it should give you the answers you need.
    M.

  • Hi, I've just started as a fresher in sap fico and I'm upto the LSMW part and I'm wondering why I keep getting an error in Run batch step when I do everything else correct could you help?  Please help I'm really trying to learn it as fast as possible

    Please help I'm really trying to learn it as fast as possible?  I've posted the file with all my screen shots going through the enitre process of me creating the LSMW file.

    First, I will try to address the iPod issue: If youve tried EVERYTHING on the website, your only other option is probably to contact Apple, I recommend by phone, and informing them of the problem. You are covered by warranty and therefore they are liable to assist you. Try that and come back with a status update
    Now I will address your attitude about it:Its absolutely understandable to be upset over something like this, especially with such an expensive product, but you are generalizing far to much. You may think Apple is being unproffesional by not warning potential buyers of the iPods common faults, but do you really think they would? they are out to sell these things, they arent going to point out the bad in their product. And not all iPods have problems, in fact only a fraction do. That gopes for the rest o Apples products as well. You are too hasty assuming all Apple products are junk, and one of many reasons as to why that is unfair of you is becuase you dont own any other Apple products.

  • Could you help me please .. . :). Regarding repost.

    Dear All,
    I've already created planning folder and now i can entry plan data using it.
    If i have a new data, then i save it.
    I can't edit the characteristic data, but i can only edit for key figure.
    My scenario is using FOX to repost..
    Before i go to the repost part,
    Could you share me how to read what i've highlighted there ??
    I mean ..
    Fo ex.
    I have 2 records:
    Column 1             Column 2           Column 3
       A                          A3                     A4            <row 1>
       B                          B3                     B4            <row 2>
    When i highlight row 2, i can get the value for Column 1, 2, and 3 using FOX / Exit ..
    Could somebody share me what function / anything that capable to do like i want ..
    Really need your guidance ..
    Will appreciate any response.
    Regards,
    Niel.

    If you'd like to change characters' values in Column 1, Column 2 or Column 3 you have to create new row and choose new values. Then you should delete old row.
    You can do it automatically by using fox formulas.
    for example:
    {charater1's value_new , charater2's value_new, charater3's value_new}={charater1's value_old , charater2's value_old, charater3's value_old}.
    {charater1's value_old , charater2's value_old, charater3's value_old}=0.

  • Hi! Everyone, I have some problems with JOIN and Sub-query; Could you help me, Please?

    Dear Sir/Madam
    I'm a student who is interested in Oracle Database and
    I have some problems with JOIN and Sub-query.
    I hope so many of you could help me.
    if i use JOIN without sub-query, may it be faster or not?
    SELECT field1, field2 FROM tableA INNER JOIN tableB
    if i use JOIN with sub-query, may it be faster or not?
    SELECT field1,field2,field3 FROM tableA INNER JOIN (SELECT field1,field2 FROM tableB)
    Thanks in advance!

    Hi,
    fac30d8e-74d3-42aa-b643-e30a3780e00f wrote:
    Dear Sir/Madam
    I'm a student who is interested in Oracle Database and
    I have some problems with JOIN and Sub-query.
    I hope so many of you could help me.
    if i use JOIN without sub-query, may it be faster or not?
    SELECT field1, field2 FROM tableA INNER JOIN tableB
    if i use JOIN with sub-query, may it be faster or not?
    SELECT field1,field2,field3 FROM tableA INNER JOIN (SELECT field1,field2 FROM tableB)
    Thanks in advance!
    As the others have said, the execution plan will give you a better idea about which is faster.
    If you're trying to see how using (or not using) a sub-query affects performance, make the rest of the queries as similar as possible.  For example, include field3 in both queries, or ignore field3 in both queries.
    In this particular case, I guess the optimizer would do the same thing either way, but that's just a guess.  I can't see your execution plans.
    In general, simpler code is faster, and better in other ways, too.  In this case
    tableB
    is simpler than
    (SELECT field1, field2  FROM tableB)
    Why do you want a sub-query in this example?

  • Hello, I have problems with app store Your payment method is not valid in this Store. Please enter a new payment method. Could you help me, please?

    I have tried 3 cards already but still the same problem with app store Your payment method is not valid in this Store. Please enter a new payment method.
    Is there any ways to solve the issue?
    Thank you in advance for your help!

    If you still have problem, contact iTune Support
    https://ssl.apple.com/emea/support/itunes/contact.html

  • I download itunes64 but when it is validating the installation, I get the message that "itunes64msi could not be found" and nothing I have done, nor looked in has resolved this problem. Could you help me please????

    http://C:\Users\Ashley\AppData\Local\Apple\Apple Software Update\
    'C:\Users\Ashley\AppData\Local\Apple\Apple Software Update\i Tunes64.msi' cannot be found. Verify that you have access to this location and try again, or try to find the installation package "iTunes64.msi" in a folder from which you can install the product iTunes.   I cannot find my old copy of iTunes on my computer now. The only thing in the iTunes folder is the written rules.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • I moved and change my email address so now with my new email address all the songs singed except my apps what should I do without buying all my adds again. Could you help me please in order for me of not buying all my apps again. Thank you I

    Is any way that I can tranfer and updetes all my apps in to my computer and devices? Also I would like to delite completly the old email address so I could update all my devices and computer please?

    1) Create a new CSS document and save as mylinks.css.  Paste the following code in Code View:
    /* CSS Document */
    /**link styles**/
    a:link {color: red; text-decoration: none;}
    a:visited {color: silver; text-decoration: none;}
    a:hover {color: yellow; text-decoration: underline;}
    a:active, a:focus {color: green}
    2) Create a new HTML document and save as links.html.  Paste this code in Code View between the <body> and </body> tags:
    <ul>
    <li><a href="somelink.html">Item 1</a></li>
    <li><a href="somelink.html">Item 2</a></li>
    <li><a href="somelink.html">Item 3</a></li>
    <li><a href="somelink.html">Item 4</a></li>
    </ul>
    3) Link a stylesheet to your HTML document:  In the CSS Properties Pane you will see a little link icon to attach a stylesheet.
    Within your HTML page you should see a link to your stylesheet between the <head> and </head> tags.
    <link href="mylinks.css" rel="stylesheet" type="text/css" media="all" />
    Did this help?
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • License problem, Could you help me?

    I have install a license to my ecc6 system using slicense.
    but when I use saplicense command in AIX os, I get this  message:
    tsmtestserver:prdadm 8> saplicense -test pf=/sapmnt/PRD/profile/PRD_DVEBMGS00_tsmtestserver
    Protocol saplicense test:
    Read sapsytem name
           ok, sapsytem name = PRD
    Read message server host
           ok, host = tsmtestserver
    Read message server service port
           ok, service port = sapmsPRD
    Connect to message server
           ok, connect done
    Read hardware key from message server
           ok, got hardware key
    Detach from message server
           ok, detached
    Check hardware key
           ok, hardware key = R1067493288
    Connect to database
           ok, connected
    Check license
           ok, check done
    Disconnect database
           ok, database disconnected
    test result: license test failed
    no valid license found ***
    tsmtestserver:prdadm 9> saplicense -show
    saplicense: no license entries found
    tsmtestserver:prdadm 10> saplicense -get
    saplicense: HARDWARE KEY = R1067493288
    why in OS, the system do not know the license I installed from GUI.
    thanks

    Hai,
    Try this, saplicense -test pf=<Profile> TRACE=2. This will you locate the source of the problem.
    http://help.sap.com/saphelp_nw04/helpdata/EN/a7/512caf407a11d1893b0000e8323c4f/frameset.htm
    You should have made some typing error will installing the license, please check the following link for some useful SAP Notes.
    http://help.sap.com/saphelp_nw04/helpdata/EN/67/4c8838c04b275de10000009b38f8cf/content.htm
    Regards,
    Yoganand.V

Maybe you are looking for