Results 1 to 2 of 2
Thread: How do I call this method
- 06-29-2011, 02:42 PM #1
Senior Member
- Join Date
- Feb 2011
- Posts
- 107
- Rep Power
- 0
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:
I want to run that code in the body of this method:Java Code:private void descriptionTextAreaInputMethodTextChanged(java.awt.event.InputMethodEvent evt) { //listen from product Jlistener descriptionTextArea.setText(productList.getSelectedValue().toString()); }
How do I call the method, I do not understand those arguments. Please help. Many thanks in advanceJava Code:private void productListValueChanged(javax.swing.event.ListSelectionEvent evt) { //your code here }
- 06-29-2011, 04:03 PM #2
It looks like Netbeans generated that method and the calls to it.
Look through your code to see where/how that method is called.
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.Whenever the value selected changes I want to run a certain piece of code
Similar Threads
-
call a JSP method
By sauravsinha in forum JavaServer Pages (JSP) and JSTLReplies: 4Last Post: 09-26-2011, 04:19 PM -
How to call this method?
By Rockefella in forum New To JavaReplies: 12Last Post: 01-20-2011, 04:32 PM -
how is call web method in application?.
By priyapavithra in forum New To JavaReplies: 2Last Post: 01-04-2011, 10:27 AM -
how to call method?
By leapinlizard in forum New To JavaReplies: 9Last Post: 04-29-2009, 11:55 PM -
cannot call private method from static method
By jon80 in forum New To JavaReplies: 3Last Post: 05-07-2008, 08:37 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks