Results 1 to 2 of 2
  1. #1
    africanhacker is offline Senior Member
    Join Date
    Feb 2011
    Posts
    107
    Rep Power
    0

    Default How do I call this method

    I am using Netbeans to make a GUI. Now I have a JList and I want to add an event to it. Whenever the value selected changes I want to run a certain piece of code. The method I want to run was generated by Netbeans:

    Java Code:
        private void descriptionTextAreaInputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
    
            //listen from product Jlistener
            descriptionTextArea.setText(productList.getSelectedValue().toString());
    
            
        }
    I want to run that code in the body of this method:

    Java Code:
    private void productListValueChanged(javax.swing.event.ListSelectionEvent evt) {
            
            //your code here
            
        }
    How do I call the method, I do not understand those arguments. Please help. Many thanks in advance

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,412
    Rep Power
    25

    Default

    It looks like Netbeans generated that method and the calls to it.
    Look through your code to see where/how that method is called.

    Whenever the value selected changes I want to run a certain piece of code
    That's usually done by having a listener added to the component the can change. When the change occurs, the component calls all the listeners it has registered and passes that listener an event object for the change.

Similar Threads

  1. call a JSP method
    By sauravsinha in forum JavaServer Pages (JSP) and JSTL
    Replies: 4
    Last Post: 09-26-2011, 04:19 PM
  2. How to call this method?
    By Rockefella in forum New To Java
    Replies: 12
    Last Post: 01-20-2011, 04:32 PM
  3. how is call web method in application?.
    By priyapavithra in forum New To Java
    Replies: 2
    Last Post: 01-04-2011, 10:27 AM
  4. how to call method?
    By leapinlizard in forum New To Java
    Replies: 9
    Last Post: 04-29-2009, 11:55 PM
  5. cannot call private method from static method
    By jon80 in forum New To Java
    Replies: 3
    Last Post: 05-07-2008, 08:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •