Assigning a method to a RadioButton

Hi everyone,
I have made a simple menu using a JFrame and RadioButtons for an application I am writting. Could anyone tell me how I would assign a method to each of the radio buttons so that once the option is chosen the method is performed.
Thanks
Jonny

hi,
as mentioned in the previous post, u need to use ItemListener, and not ActionListener.
add item listener to your component.
<code>
yourRadioButton.addItemListener (this);
</code>
then use this snippet:
<code>
public void itemStateChanged (ItemEvent ie)
if (ie.getStateChange == 1)
//call ur function here
yourFunctionName ();
</code>
this would fire whenever the user checks the button, and if the button's state is checked (not un-checked), then ur function gets called.
hope this helps.
Satyen.

Similar Messages

  • What is the difference between organisation payment method and Assignment payment method?

    What is the difference between organisation payment method and Assignment payment method?
    As i am a new bie, i am curious to know this though it might sound a silly question.
    Thank you,
    Kuton

    You can create an Organization payment method of any Payment type(Cash, Check, BACS, NACHA etc) under the same country.
    All these will be valid payment methods on the payroll description form.
    And you can even attach these to a person.
    In which case you will have a Base currency (say USD) and payment currency (say GBP).
    These cases are not normal and only used by people who use a single BG for paying employees in 3-4 countries.
    So, unless you need to pay in different currencies, do not use it.
    Cheers,
    Vignesh

  • In QS21 Qualitative is it necessary to assign Inspection method?

    Hi All,
    i created QS41 and it assigned in QS51.
    now In QS21 Qualitative is it necessary to assign Inspection method?

    hi
    it is not necessary to assign inspection method to master inspection characteristics
    Regards
    Pravin

  • Need help on an assignment using methods.

    The assignment I'm working on uses methods to input an integer and a character and then output a hollow square of the size of the integer and made up of the character entered. This is what I have so far, I'm not quite sure how to fill in the methods....
    import java.util.Scanner; //For scanner class
    public class Methods
    {public static void giveInstructions()
         //instructions
         {System.out.println("Enter a character and an integer. A hollow square of size n times n made up of the character" +
              " will be constructed.");
    public static int getSize (Scanner kbd)
         int size;
         Scanner kbd = new Scanner (System.in);
         System.out.println("     Enter the size: ");
         size = kbd.nextInt();
    public static char getCharacter (Scanner kbd)     
         System.out.println("Enter the Character: ");
         final char ch;
         ch = kbd.nextLine();
    public static void drawSquare(int size, char ch)
    public static void drawSolidLine( int size, char ch )
           String s;
            for( int i = 0; i < size ; i++ )
                    // ADD ch       
           System.out.println( s );
    public static void drawHollowLine( int size, char ch )
                String s = "";
                // add char to s   
               for( int i = 0 ; i < ( size - 2) ; i++ )
                       s = s + " ";
               // Add char to s
              System.out.println( s );
    }I would appreciate any kind of help!

    > I'm really confused. I can't think of anything that I
    would need to write under the main method because
    everything that I need would be under the other
    methods.
    I assume you're replying to me(?). Did you compile and run my example? What is it you don't understand about it? I see your methods are all static so you could do something like this:
    public class Test {
        public static void printA() {
            System.out.println("A");
        public static void printB() {
            System.out.println("B");
        public static void printSomething(String s) {
            System.out.println(s);
        public static void main(String[] args) {
            Test.printA();
            Test.printB();
            Test.printSomething("AB");
    }

  • How to assign a method from another class to dropDown processValueChange

    Hi
    Thank you for reading my post.
    in normal way we use same backing bean for methods of components and our pages.
    now i want to set the method that called after a dropDown value changed to another claas method.
    for example if my page name is
    messages.jsp and its backing bean is messages.java i want to set processValueChange of a dropDown box to class2.methodForDropDown...
    can some one please help me

    One approach will be to make your class a ivar of PageBean or SessionBean. That way you instantiate your class either in PageBean/SessionBean and PageBean or SessionBean as a parameter depending on the scope requirements of your class.
    Other approach which is eaiser would be to use the JSF API
    ValueBinding vb = FacesContext.getCurrentInstance().getApplication().
    createValueBinding("#{SessionBean1});
    SessionBean1 bean1 = vb.getValue(FacesContext.getCurrentInstance());
    The above code can be used anywhere within a JSF application to retrieve an object from any scope as long as the request has passed through the FacesServlet.
    No, you can't pass parameters to processValueChange.
    Hope this helps
    -Jayashri

  • Assign methods & smartforms to a action

    Hi All,
    I have created one new action in CRMC_ACTION_DEF t.code. After creating the action, under "Processing type" i have assigned methods & smartforms to that acion. I have set the "Default" indicator for methods.
    When i am calling this action in my transaction CRMD_ORDER, neither "Method" nor "Smartform" is working.
    Can i assign both "methods" & "smartforms" to one action or NOT?
    Request your guidance on this.
    Regards
    Senthil
    Edited by: Senthil Kumar on Jul 13, 2009 10:43 AM

    Hi,
    Open your message in edit mode. go to Transaction data --> Actions  there you will get a list of actions executed and failed. If your action definition is available there then look for the error message.
    If your action is not listed there it means your action definition doesnt meet the condition, Then click on Determination logs button. There you will get the reason why it is not determined.
    Post that message here for further anaysis.
    regards
    Naveen

  • No method assigned error

    Hi
    I am using PI 7.1 as central monitoring system in my landscape. In CCMS i have added all the systems (ECC, SRM , CRM). NOw when i tried to see the alerts for J2ee engine of my PI system. It is giving th ebelow error.
    ngsvawrk211\...\RECEIVER: No method assigned
    Could anyone please help me on this.
    Regards,
    Abdul

    Hello Tom
    I assume your alerting itself is already working (your node Z_Myjobs) ?
    When in RZ20 on that specific node, you should click on the properties button and move into the methods tab.
    There you should have an analysis method assigned (the method that actually checks the jobs) when you click the button "method assignment" you should see the MTE class assigned in the Analysis tab.
    Once you are sure that works properly you should define an auto-reaction method to perform the mailing of the alert.
    Procedure to build a central auto-reaction method
    [http://help.sap.com/saphelp_nw70/helpdata/en/ac/825f18c02e454dac8da51f4eb22265/content.htm]
    Specific information to build a mailing auto-reaction method
    [Note 176492 - Automatic email when an alert occurs (RZ20)]
    Using the above documents you should be able to find all the answers.
    Kind regards
    Tom

  • ECCS Assign consolidation of investment method to consolidation units

    Dear experts,
    I get trouble with on error in ECCS. After I create consolidation of investment method. In order to use this method in consolidation of investment, I have to assign this method to consolidation units.
    I used tcode CXM1 to assign consolidation of investment method to consolidation units. But when I execute this tcode, there is no consolidation hierarchy. Therefore, I cannot do assignment.
    Any body have ever face with the same error?
    I am looking forward to hearing your suggestion.
    Thanks in advance!

    I dealt this issue.
    Thanks.

  • Assign methods to Business object

    hi gurus..........
    Can we assign a Method(BAPI)    to no. of Business objects?

    Hi,
    So i just want to know that is this possible that we specify a BO for the
    workflow but do not specify the event.
    Yes, To make things more clear BOR primarily is used to link and rasie the events that are defined in the BOR, but there might be cases where you might not have any events but still you need to start the workflow. The other purpose of the BOR is you create various methods in the BOR and you try to import and export differnet values and various manipulations are done with respect to the dat of the Business object instance.
    that there will not be need of assigning any starting event for the workflow
    Yes without  any kind of start events you can start the workflow by making use of standard SAP provided function modules SAP_WAPI_START_WORKFLOW all you need to do is pass the workflow template number let say WS99999999 and the values that you want to pass to the workflow container by making use of the tables parameter of the function module simple_container. Its a kind of name/value table.
    I tried doing it in BASIC DATA of workflow but it was not possible from there
    In this kind of sitituation basic data does not have any kind of significance. All you have to do is try to find a point like when ever end user clicks on submit button or try to find a BADI' or enahncement spot where you can call the workflow by making use of above mentioned function module.
    But make sure you have the right interface all the data available at that point where you are calling the function module this is because you may hvae to pass the respectve data to the workflow container.
    Regards
    Pavan
    Edited by: Pavan Bhamidipati on Dec 14, 2011 11:34 PM

  • Between two ViewContainerUIElements want to add RadioButton & Its Events ch

    Hi friends,
    I have requirement using the WebDynpro JAVA that between the DropdownList and TableView I want to add Radio Button. And want to change the even accordingly.
    There is a ViewContainerUIElement_A which contained the Single DropDownList and another ViewContainerUIElement_B which contained the TableView. So based on the selection of dropdown list (ViewContainerUIElement_A) displayed records in the TableView(ViewContainerUIElement_B). Dropdown and tableView are  both use the Adaptive RFC Model. Which is working fine.
    Now i try to modify like this :
    I have created the RadioButton  as per requirement, after selection of  DropDownList , I am getting the radioButton values and able to select and see the change values  while clicking the Radio button which is perfectly working fine but tableView is not refreshing at all.now my question is how to call the TableView(ViewContainerUIElement_B) using the Radiobutton?
    So do I need to create the ViewContainerUIElement_C for RadioButton also, currently I am using the simple Radiobuton and Group for this.
    Do I need to create  ViewContainerUIElement_C for RadioButton also?  How to link with inbound plugs with this and how to call the even.
    Suggest me plz.
    Thanks
    Ali

    Hi Suresh,
    Since TableView is ViewContainerUIElement and creating dynamically so not able to see much codes here. Any Idea how to refresh the TableView using onSelect.
    I already assigned one method under the OnSelect of RadioButton using that i can see the selected values as message.
    Is there any way to call the Dropdown list event in the Radio Button?
    Thanks
    Ali

  • F110 error - No Valid Payment Method found - Account ID missing

    Hello All,
    I am trying to clear some Vendor invoices in F110 using a Payment method. We have entered the House Bank at the time of posting the Vendor Invoice (Invoice is posted through an BAPI) and I am able to see the House Bank in BSEG - HBKID.
    Further for the Payment Method we are using only one House Bank and one Account ID - which has been configured correctly in FBZP - Bank Determination.
    However when we are running F110 for clearing the invoices - we are getting an error no valid payment method found. I am able to see the Payment Method & the House Bank while editing the Proposal - only Parameter which is missing is Account ID - though we have maintained it in Bank Determination configurartion.
    Any help will be appreciated a lot to fix this issue.
    Thanks and regards,
    Ankur

    Dear,
    Everything may be alright but payment method is assigned to Bank Account in Bank selection section FBZP. So, system will process payment from the bank account with assigned payment method. So, there is no Account ID system is not able to find the payment method. It is difficult to provide remedy. If house bank and account ID is not in the vendor master then update them.
    Just try it out....all the best.
    Regards,
    Chintan Joshi.

  • Assigning a URL link to button in a Flash Player

    I've designed a player in Flash using Action Script 3. I've
    built a rollover button into the player that users will click to
    link to a new page. But where do I assign the URL for that button
    to link to; there's no apparent field for this in the properties
    inspector.
    I was able to make it work by switching over to Action
    Script 2 and assigning a "Go to Web Page" behavior to the button;
    but I can only do this in Action Script 2 (where behaviors are
    available), and I have to keep the page in Action Script 3 in order
    to support other components (Slideshow Pro).
    Surely there is a way to assign a simple URL link to a
    button in Action Script 3. Thanks for the help,
    Chris

    yes, you need to write AS3 script in order to do so:
    [code]
    buttonInstanceName.addEventListener(MouseEvent.CLICK, navTo);
    function navTo(e:MouseEvent) {
    var url = new URLRequest('
    http://www.theaddresshere.com);
    navigateToURL(url);
    [/code]
    place this on the first frame where you button is
    instantiated, in a layer you name 'actions' - with the frame
    selected, open the Actions panel (F9) and enter the script there.
    replace the "buttonInstanceName" with the instance name of the
    button on the stage you're assigning this method to, and of course
    replace the address in the URLRequest parameter.

  • Pass a method as an object to DocumentListener

    So far, I have been assigning document listeners to JTextfields within the same class as the JTextField, as in...
                   private createJTextField(){
                       JTextField t = new JTextField();
                       t.getDocument().addDocumentListener(documentListener());
                   private DocumentListener documentListener() {
                  DocumentListener listener = new DocumentListener(){
                      public void changedUpdate(DocumentEvent e){textFieldActions();}
                  public void removeUpdate(DocumentEvent e){textFieldActions();}
                         public void insertUpdate(DocumentEvent e){textFieldActions();};};
                 return listener;
                private void textFieldActions() {
                  //Do something, like search the text in the JTextField for a string;
                  }This does work, but it means I have to include similar blocks of code for every JTextField I create.
    ...so, I thought it would be better to set up a utility that I could pass the JTextField and method to, which would assign the method to the DocumentListener. Something like...
         private JTextField t;
         private Boolean b;
         private JTextFieldDocumentListenerUtility l;
         protected void setUp(){
              t = new JTextField();
              b = false;
              l = new JTextFieldDocumentListenerUtility();
         public void testDocumentListener(){
              assertFalse(b);
              l.assignAction(t, someAction());
              t.setText("bogus");
              assertTrue(b);
         private void someAction() {
              b = true;
                   }The JTextFieldDocumentListenerUtility class includes the "private DocumentListener documentListener()" method in the first block of code.
    However, I can't pass the method "as is". I think (and I need some guidance here) its because the method "someAction()" returns a void, whereas I need to pass an object to the JTextFieldDocumentListenerUtility.
    What is the tidiest way to do this, given that I'm trying to cut down duplicate code every time I create a JTextField?
    Can someone please walk me through this?

    You could use the Strategy pattern.
    Basically creating a DocumentListener implementation that accepts as parameters the JTextField and a separate "Operation" instance. Where operation would be an
    interface that would define a single operation() method (or 3 different operation methods if you want different operations performed for the changed/remove/insert events).
    Some non-tested sample code.
    public class MyListener implements DocumentListener {
        private JTextField field;
        private Operation operation;
        public MyListener(JTextField field, Operation operation) {
            this.field = field;
            this.operation = operation;
        public void changedUpdate(DocumentEvent e) { operation.changed(field); }
        public void removeUpdate(DocumentEvent e) { operation.remove(field); }
        public void insertUpdate(DocumentEvent e) { operation.insert(field); }
    }This way if you have 10 textfields that need to behave in a similar way, you'd need only create 1 Operation implementation that handles the functionality and just use
    t.getDocument().addDocumentListener(new MyListener(t, new MyStandardOperation()));Since you can't pass around only methods, you need to have a class to contain them in.
    But if you need to have several textfields that have similar functionality, you'll have the functionality contained in a single place and cut down on the boilerplate code.

  • Central Autoreaction Method doesn't work for NW 7.10 in SolMan 7.01

    Hello!
    The central autoreaction method doesn't work for the satellite system
    NW 7.10. For systems with kernel releases 4.6D, 640, 700 this method
    works fine and e-mail alerts are coming.
    The configuration steps I've checked:
    1. Configured SCOT. The mail_send job executes every 5 minutes.
    2. Background dispatching job is released: SAP_CCMS_MONI_BATCH_DP (In
    central CEN/000/DDIC and satellite system SAT/000/DDIC)
    3. Central dispatching job is released: SAP_CCMS_CENSYS_DISPATCHER
    (Only in central system CEN/000/DDIC)
    4. The sapccm4x-agent registered as web service within CEN using
    Create Remote Monitoring for NW 7.10:
    Connection test to SAPCCM4X.<satellite_host>.00 was performed successfully
    5. Created a new autoreaction method by copying method
    CCMS_OnAlert_Email_V2 to the own Z_CCMS_Email_Alert_CEN:
    Function Module - SALO_EMAIL_IN_CASE_OF_ALERT_V2
    Execute Method on Any Server and Only in Central System, triggered by
    CCMS agents
    SENDER (EMAIL_USER) exists in CEN/000 , RECEPIENT - <distr list
    SAP_BASIS in CEN/000>, RECIPIENT-TYPEID - C
    6. Got MTE Classes from NW 7.10 satellite system and assigned this method
    Z_CCMS_Email_Alert_CEN to an MTE-class CCMS_ORAucPSAPSR3 for NW 7.10
    satellite system. The alert is red right now.
    7. The mail_send job doesn't send anything, in SCOT there are no
    sending orders.
    8. Autoreaction status on this alert in CEN in RZ20 - Sent to CEN.
    CEN_CHECKED.
    9. The alert status in RZ20 in CEN - ACTION_REQUIRED. If I execute it
    in manual the alert status changes to ACTIVE, but no email and no
    messages in sending orders in SCOT.
    Please help me to solve this issue.
    Thank you!

    Hi,
    Since you are using RECIPIENT-TYPEID =C i.e. General distribution list, pls ensure to have shared type of list created in SBWP.
    Also pls verify your SCOT configutaion , if apropriate address area i.e. *@abc.com
    Also one point to note that even if you trigger auto reaction method manually via RZ20 , pls check if alert is listed in SOST.
    if yes , that means there is problem in either SCOT configuration or distribution list.
    If alert is not appearing in SOST , that means you need to check auto reaction method parameters;
    Z_CCMS_OnAlert_Email_V2 , here check release section if Auto reaction execution method is checked.
    Regards,
    Rupali

  • Agentry Work Manager 6.0: BADI to enhance assignment type

    Hi,
    I have the requirement to more or less combine the work order assignment types 1 and 2. I have to fetch the operations based on its assigned personal number, but at the same time I have to fetch a work order and all the operations if the Agentry user is the work order header responsible.
    Unfortunately this is a single value parameter so I set the assignment type to 2. Now I thought it would be really easy to fetch the work orders based on the assignment type 1 since there is a BADI available after each assignment call method:
    WHEN '2'.                                           "Operation level
               me->get_assignment2(
                 EXPORTING
                    iref_rfc_oo_data = iref_rfc_oo_data
                 IMPORTING
                    et_return        = lt_return
                    et_wo_object     = lt_wo_object ).
               IF NOT gref_badi_wo IS INITIAL.
                 CALL BADI gref_badi_wo->get_assignment_type2
                   EXPORTING
                     iref_mdo_data = me->oref_mdo_data
                   CHANGING
                     ct_wo_object  = lt_wo_object.
               ENDIF.
    So inside the BADI gref_badi_wo->get_assignment_type2, I wanted to call the me->get_assignment1 method, and then join the 2 internal tables values.
    But the problem is once the BADI is called it is not possible to call this method since we only have the OREF_MDO_DATA object which has the original class as a inaccessible private attribute. I could try to copy and adapt the me->get_assignment1 code but there are some attributes that are not accessible inside the BADI. Do you see a simple and elegant solution to this requirement?
    I would like to avoid creating a new Z handler class inheriting from the standard one...
    Thank you.
    Tags edited by: Michael Appleby

    Hi,
    I just wanted to close this old thread since what I did long ago to solve the issue is to replicate the me->get_assignment1 inside the me->get_assignment2 BADI method code. It is not just a copy paste since from the BADI you don't have access to some MDO handler private data.
    But it is possible to replicate all the fetch process except when doing a delta with exchange since I couldn't easily get the necessary data from the main MDO. But even if you get all the work orders ID's, after the BADI the standard code checks the exchange table again and rules out the unnecessary WO ID's.

Maybe you are looking for

  • Shedule Agreement: Extra delivery created for shedule line

    Hello every body, Two deliveries created for one of the  shedule line in the Forecast Delivery Schedule of  Scedule Agreement. Out of these 2 deliveries created for this schedule line,one delivery is created by the background job and the other is cre

  • Motion Tracking?

    I am using Motion 2.1.2 and I want to stabilize a shaky zoom. I found this video on stabilizing non-zooming footage: http://www.geniusdv.com/newsand_tutorials/2010/03/image_stabilization_and_tracking_with_applemotion.php but when I went to 'Add Behav

  • Creating an multi-page, variable diptych package?

    My goal is to be able to have a set of diptych/triptych templates that allow me to create and preview multiple layout configurations in a single custom package. I started by creating 4 user templates, 600x447px diptych, 600x447 triptych, 447x600 dipt

  • R: how to, and with what quality, converting OVM Templates to VMWare

    Hi all My customer wants to migrate from VMWare to Oracle VM for the Oracle products they have, but that will be a somewhat longer process. They need to stick to VMWare for their runtime platform at least for a longer while. We are looking at what st

  • How does final cut pro x export a file if it has not finished rendering?

    How does final cut pro x export a file if it has not finished rendering? So today I finished a project: Share >Export > as a pro res 422 and I'm now burning with iDVD as we speak. FCPX is still doing background rendering! I hope my DVD turns out ok..