How to call valueChanged method ?

Hello everybody
I'm using JTree component in my application. I have handled method valueChanged(TreeSelectionEvent e) when I select some node in this component. But this method is not called when I select same node(node was selected before). That means that first I have to select other node and follows select mentioned node aggain.
Can somebody help me how to set up this component ?
Thanks

Hello
My source code is very large.
I have some nodes as buttons in my JTree component(for example one node rus instalation,second uninstall ...)
and I need run functionality when I clicked on these node everytime.
Is here possibitity to call valueChanged method or not?
Thanks

Similar Messages

  • How to call a method in private section of a class in the public section

    Hi Everybody,
    i have written a method(meth1) in the private section of a class(C1).
    it is as follows
    class C1 definition.
    private section.
    methods: meth1 importing im_dt1 like tp1
                                             im_dt2 like tp2
                                             im_dt3 like tp3
                                             im_dt4 like tp4
                               returning value(re_dt1) like tp5.
    endclass.
    i have the final data that has to be displayed in internal table re_dt1.
    now my question is how to call  this method present in private section into public section and display the data present in re_dt1.
    Thanks,
    learning.abap.

    Hi,
    what you need is one public method being called at start-of-selection. Within this the private methods have to be called.
    The question is, why has the method for reading the database tables to be private? If you have only one private method reading all database tables the public method being called at start-of-selection will only consist of a call-method statement.
    This seems to be one call to much.
    The logic for reading the different database tables is hidden inside the class anyway.
    Is there any further logic reading the different database tables?
    Have always all table to be read? If not another approach would be one private method for each database table being called by a public method deciding which table has to be read:
    public section.
    methods get_data returning value(re_Dt1).
    private section.
    methods:
    get_table_a returning value(im_dt1),
    get_table_b returning value(im_dt2),
    get_table_c returning value(im_dt3),
    get_table_d returning value(im_dt4),
    combine_data importing im_dt1
                                    im_dt2
                                    im_dt3
                                    im_dt4
                            returning value(re_dt1).
    *- implementation of public method:
    method get_data.
      data: lt_dt1 ...
               lt_dt2,
               lt_dt3,
               lt_dt4.
    * here decide which tables have to be read:
    lt_dt1 = get_table_a( ).
    lt_dt2 = get_table_b( ).
    lt_dt3 = get_table_c( ).
    lt_dt4 = get_table_d( ).
    re_dt1 = combine_data( i_dt1 = lt_dt1
                                           i_dt2 = lt_dt2
                                           i_dt3 = lt_dt3
                                           i_dt4 = lt_dt4 ).
    endmethod.
    *- implementation of private methods
    method get_table_a.
    endmethod.
    method get_table_b.
    endmethod.
    method get_table_c.
    endmethod.
    method get_table_d.
    endmethod.
    method combine_data.
    endmethod.
    Regards
    Dirk

  • How to call a Method in a Program?

    Hello,
    I am very new to the ABAP world.  I have been given a task to call a method if_hrbas_plain_infotype_access~read_single from the class CL_HRBAS_PLAIN_INFOTYPE_ACCESS in a program to see if we can use it to display some employee information.  I don't know how to call a method in a program.  Can somebody please provide me some pseudo code or instructions?
    Thanks.

    Hi Shan,
    here is the code to call a method. while calling the method Instance as 'r_info' which is the type reference to class as specified.
    pass the values to exporting parameters plvar,otype,objid...etc  according  to the requirement
    infotypes: 0002.   " creates an internal table p0002.
    data:
    r_info type ref to CL_HRBAS_PLAIN_INFOTYPE_ACCESS.
    TRY.
    CALL METHOD r_info->if_hrbas_plain_infotype_access~read
       EXPORTING
         plvar           = 
         otype           =
         objid           =
         istat           =
         infty           =
    *     SUBTY           =
         begda           =
         endda           =
         no_auth_check   =  'X'
         message_handler =
       IMPORTING
         PNNNN_TAB       = P0002
    *     HRTNNNN_TAB     =
    *     IS_OK           =
      CATCH CX_HRBAS_VIOLATED_ASSERTION .
    ENDTRY.
    LOOP AT P0002.
          WRITE:/
            P0002-VORNA,
            P0002-NCHMC,
            P0002-NACHN.
        ENDLOOP.
    Regards

  • How to call a method from a separate class using IBAction

    I can't work out how to call a method form an external class with IBAction.
    //This Works 1
    -(void)addCard:(MyiCards *)card{
    [card insertNewCardIntoDatabase];
    //This works 2
    -(IBAction) addNewCard:(id)sender{
    //stuff -- I want to call [card insertNewCardIntoDatabase];
    I have tried tons of stuff here, but nothing is working. When i build this I get no errors or warnings, but trying to call the method in anyway other that what is there, i get errors.

    Can you explain more about what you are trying to do? IBAction is just a 'hint' to Interface Builder. It's just a void method return. And it's unclear what method is where from your code snippet below. is addNewCard: in another class? And if so, does it have a reference to the 'card' object you are sending the 'insertNewCardIntoDatabase' message? Some more details would help.
    Cheers,
    George

  • How to call a method defined in AM when I select any value in LOV

    Lets say there is a LOV. The scenario is as soon as I select any value in LOV, a method needs to be called which I have written in the AM. And the output of the method is displayed in a output text box.
    I am not able to understand how to call a method when the user selects any value in LOV.
    This is wht I did. I had created the binding for the method. Changed the autosubmit property of the LOV to True, and in the properties of the output box, in the partial submit trigger property, passed the ID of the LOV. But I didnt get any place where I need to call the method. I am also not able to drop an action listener on the LOV

    Hi,
    +"its showing an error(underlined in orange)."+
    Any reason you don't share this error with us? Anyway, here is how it goes
    1. LOV, set autosubmit="true" and configure a value change listener
    2. Expose the AM method as a method binding in the PageDef file
    3. In the value change listener:
    BindingContext bctx = BindingContxt().getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    OperationBinding method = (OperationBinding) bindings.get("name of method binding in PageDef");
    method.getParamsMap().put("argument name1", value1);
    method.getParamsMap().put("argument name2", value2);
    Object retVal = method.execute();
    if(!method.getErrors().isEmpty()){
      //handle errors
    else{
      //write retVal to the managed bean variable that is referenced by the outputText value property
      //PPR output text component
      ADFFacesContext.getCurrentInstance().addPartialTarget(outputTextRef);
    }Note that you may have to set clientComponent = "true" on the output text component
    Frank

  • How to call a method in the servlet from an applet

    I want to get the data for the applet from the servlet.
    How to call a method that exits in the servlet from the applet? I want to use http protocol to do this.
    Any suggestions? Please help.
    thanks

    Now that Web Services is around, I'd look at possibly implement a Web Service call in your applet, which can then be given back any object(s) on return. Set up your server side to handle Web Service calls. In this way, you can break the applet out into an application should you want to (with very little work) and it will still function the same

  • How to call main method in one class from another class

    Suppose i have a code like this
    class Demo
    public static void main(String args[])
    System.out.println("We are in First class");
    class Demo1
    public static void main(String args[])
    System.out.println("We are in second class");
    In the above program how to call main method in demo calss from Demo1 class......???????

    No, i dont know how to call other than main methods from other classes
    And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch).........

  • How to call a method of another class ?

    Hello,
    I�d like to know how to call a method of another class. I have to classes (class 1 and class 2), class 1 instantiates an object of class 2 and executes the rest of the method. Later, class 1 has to call a method of class 2, sending a message to do something in the object... Does anybody know how to do that ? Do I have to use interface ? Could you please help me ?
    Thanks.
    Bruno.

    Hi Schiller,
    The codes are the following:
    COMECO
    import javax.swing.UIManager;
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    //Main method
    class comeco {
    public static void main(String[] args) {
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception e) {
    AGORA testeagora=new AGORA();
    // Code for socket
    int port;
         ServerSocket server_socket;
         BufferedReader input;
         try {
         port = Integer.parseInt(args[0]);
         catch (Exception e) {
         System.out.println("comeco ---> port = 1500 (default)");
         port = 1500;
         try {
         server_socket = new ServerSocket(port);
         System.out.println("comeco ---> Server waiting for client on port " +
                   server_socket.getLocalPort());
         // server infinite loop
         while(true) {
              Socket socket = server_socket.accept();
              System.out.println("comeco ---> New connection accepted " +
                        socket.getInetAddress() +
                        ":" + socket.getPort());
              input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
              // print received data
              try {
              while(true) {
                   String message = input.readLine();
                   if (message==null) break;
                   System.out.println("comeco ---> " + message);
    testeagora.teste(message);
              catch (IOException e) {
              System.out.println(e);
              // connection closed by client
              try {
              socket.close();
              System.out.println("Connection closed by client");
              catch (IOException e) {
              System.out.println(e);
         catch (IOException e) {
         System.out.println(e);
    AGORA
    import javax.swing.UIManager;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.net.*;
    //public class AGORA {
    public class AGORA {
    boolean packFrame = false;
    //Construct the application
    public AGORA() {
    try {
    Main frame = new Main();
    System.out.println("agora ---> Criou o frame");
    //Validate frames that have preset sizes
    //Pack frames that have useful preferred size info, e.g. from their layout
    if (packFrame)
    frame.pack();
    else
    frame.validate();
    //Center the window
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = frame.getSize();
    if (frameSize.height > screenSize.height)
    frameSize.height = screenSize.height;
    if (frameSize.width > screenSize.width)
    frameSize.width = screenSize.width;
    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    frame.setVisible(true);
    catch(Exception e)
    { System.out.println("agora ---> " +e);
    // Tem que criar a THREAD e ver se funciona
    public void remontar (final String msg) {
    try {
                   System.out.println("agora ---> Passou pelo Runnable");
    System.out.println("agora --> Mensagem que veio do comeco para agora: "+ msg);
    Main.acao(msg);
    catch(Exception x) {
    x.printStackTrace();
    MAIN
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import javax.swing.border.*;
    import java.net.*;
    import java.io.*;
    public class Main extends JFrame {
    // ALL THE CODE OF THE INTERFACE
    //Construct the frame
    public Main() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    public void acao() {
    // C�digo para mudar a interface
    Runnable setTextRun=new Runnable() {
    public void run() {
    try {
                   System.out.println("main ---> Passou pelo Runnable");
    TStatus.setText("main ---> Funcionou");
    catch(Exception x) {
    x.printStackTrace();
    System.out.println("main ---> About to invokelater");
    SwingUtilities.invokeLater(setTextRun);
    System.out.println("main ---> Back from invokelater");
    // Aqui vai entrar o m�todo para ouvir as portas sockets.
    // Ele deve ouvir e caso haja alguma nova mensagem, trat�-la para
    // alterar as vari�veis e redesenhar os pain�is
    // Al�m disso, o bot�o de refresh deve aparecer ativo em vermelho
    //Component initialization
    private void jbInit() throws Exception {
    // Initialize the interface
    //Setting | Host action performed
    public void SetHost_actionPerformed(ActionEvent e) {
         int port;
         ServerSocket server_socket;
         BufferedReader input;
    System.out.println("main ---> port = 1500 (default)");
         port = 1500;
         try {
         server_socket = new ServerSocket(port);
         System.out.println("main ---> Server waiting for client on port " +
                   server_socket.getLocalPort());
         // server infinite loop
    while(true) {
              Socket socket = server_socket.accept();
              System.out.println("main ---> New connection accepted " +
                        socket.getInetAddress() +
                        ":" + socket.getPort());
              input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    String espaco=new String(": ");
         JLabel teste2=new JLabel(new ImageIcon("host.gif"));
              PHost.add(teste2);
    System.out.println("main ---> Adicionou host na interface");
              repaint();
    System.out.println("main ---> Redesenhou a interface");
              setVisible(true);
              // print received data
              try {
              while(true) {
                   String message = input.readLine();
                   if (message==null) break;
                   System.out.println("main ---> " + message);
              catch (IOException e2) {
              System.out.println(e2);
              // connection closed by client
              try {
              socket.close();
              System.out.println("main ---> Connection closed by client");
              catch (IOException e3) {
              System.out.println(e3);
         catch (IOException e1) {
         System.out.println(e1);
    public void OutHost_actionPerformed(ActionEvent e) {
              repaint();
              setVisible(true);
    //Help | About action performed
    public void helpAbout_actionPerformed(ActionEvent e) {
    Main_AboutBox dlg = new Main_AboutBox(this);
    Dimension dlgSize = dlg.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.setModal(true);
    dlg.show();
    //Overridden so we can exit on System Close
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if(e.getID() == WindowEvent.WINDOW_CLOSING) {
    fileExit_actionPerformed(null);
    public void result(final String msg) {
    // C�digo para mudar a interface
    Runnable setTextRun=new Runnable() {
    public void run() {
    try {
                   System.out.println("main ---> Chamou o m�todo result para mudar a interface");
    System.out.println("main --> Mensagem que veio do agora para main: "+ msg);
    TStatus.setText(msg);
    catch(Exception x) {
    x.printStackTrace();
    System.out.println("main --> About to invokelater");
    SwingUtilities.invokeLater(setTextRun);
    System.out.println("main --> Back from invokelater");
    []�s.

  • How to call  a method of one view in other view

    Hi
      could any one suggest "how to call  a method of one view in other view "
    thanks
    kaushik

    Hi Kausic,
    Its not possible to call a method from view to View.
    Since view is private entity we can not pass the data directly.
    I suggest you to declare the method in Component/Custom controller and call.
    the code is,
    wdThis.wdGet<Component/Custom Name>Controller().<methodName>();
    Regards,
    <b>Ramganesan K</b>

  • How to call a method in onload using jsf

    Hi
    i have task where i neeed to retrive datas from database on page onload . i have written retriving code in backing bean but how to call that
    method on onload in jsf.......
    Can anybody help ???????????
    thanks

    public class firstbean{
         list mylist = new ArrayList();
         firstbean(){
         new firstcontroller().retriveData()
    public class firstcontroller{
         public void retriveData(){
              // I need to get first bean object reference to assign the retived data to my list variable(mylist)
              // but iam getting first bean object object as nulll
              Object object =
                   FacesContext
                   .getCurrentInstance()
                   .getExternalContext()
                   .getSessionMap()
                   .get("FirstBean");
              FirstBean firstBean = (FirstBean)object;
              // firstBean = null its coming
              firstBean.mylist = new FirstDao().getdata();
    this is my code how to implement the onload function in this login . here when i try accesss my first bean reference is showing as null . so aim not able to assign the retrived data in to mylist variable

  • How to call a method in jsf after stop typing in test box?

    Hi all,
    In my jsf page i have a text box in which user type some text field like "abc". i want after stop the typing i want a method to be called automatically and a datatable will be populated sith some result. my problem is is how to call the method automatically so that the user does not have to click any button after typing in the text box? plz help..
    Edited by: sailajoy on Dec 23, 2008 3:36 PM

    If it is after certain characters that the user types you can ascertain that the entry is done you can use onkeyup and within the javascript count the characters an when the necessary characters are set do the action you need to do.
    There should be some way by which you can suggest that the user has stopped typing i.e. either the max length has reached or the user has hit tab or went to another field. Going on other field too you can bring the focus back to your original field from where the user had hit tab. If you are thinking of something liek google suggest then AJAX is the best way to implement it.

  • How to call java method from workflow script?

    Hi
    I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
    Is there any alternative better way to achive this requirement from workflow? Please suggest.
    Thanks,
    Sarang

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How is call web method in application?.

    Hi,
    I have created java web application(Web Service).
    I want to call the setName() method in java application(GUI).
    how is call web method in application?.
    package sv;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    @WebService()
    public class MyService {
    @WebMethod(operationName = "setName")
    public String setName(@WebParam(name = "name")
    String name) {
    return "my string is "+ name;
    }

    The model layer should never depend on a specific view layer - this breaks reusability.
    What you need to do is expose a service method on your AM. Then your view can call this method and pass a parameter into the model layer.

  • How to call the method of a Business Object?

    Hi,
    Can someone guide me how to call the method of a business object?
    For example, I want to use the method SalesDocument.Copy of the Business Object VBAK. How can I do that? If you are familiar with any similar scenario please help.
    Regards,
    Renjith Michael.

    Hi
    double click on the copy  and
    go to abap tab
    there u can get functionmodule name
    u can call that
    Rewards if helpful

  • How to call java method having array as argument from c++ ?

    Hello sir,
    how to call java method having array as arguments from c++;
    here is java code which is called from c++
    class PQR {
         public void xyz(int[] ia) {
         System.out.println("hi");
              for (int i = 0; i < ia.length; i++)
                   System.out.println(ia);
    suppose all jvm invocation is done...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    For someone well versed in java, C++ and JNI although tedious that should be obvious.
    For someone not well versed in all three it is going to be very difficult.
    Even for someone that does have knowledge in all of those areas coming up with a C++ interface that reflects that functionality in a dynamic way such that anyone is will to use it is going to be quite an adventure.
    At any rate to start building it you do exactly the same thing that you would in java.
    1. Extract everything in the jar via the zip package
    2. For each found instance extract all of the methods, return types, parameters, etc and build a description tree for each class.
    Doing all of that in C++ is going to take a LOT of code. If someone wanted an estimate from me it would take me 6 months to do it. And before I would even attempt it I would get them to explain to me in detail exactly how they thought they were going to use it when I was done because I can't see any reasonable way to do that.
    I left out the description tree itself. I suppose you could duplicate the entire reflection api in C++.
    Now perhaps if it was much, much more constrained, like to only those classes that implement a single interface then that would be more reasonable.

Maybe you are looking for

  • Why doesn't Apple come out with a karaoke software for mac?

    I bought a Mac Intel based specifically as I was told Intel was more compatible with software I wanted. I am looking for karaoke software that will let me add lyrics and sync them to the audio portion of the file which is called a karaoke disc CD plu

  • How to setup the timeout time about container mangement transaction?

    hi i want to modify the time-out time about cantainer management transaction. but i don't know where and how to setup it.... please tell me how to do it, thanks a lot. Joe

  • How to fill the data in  extraction queue (LBWQ)?

    Hi, I modified the structure of datasource 2LIS_02_SCL (change an append structure), since an error occurs when I check the datasource, I deleted the the deltaqueue in RSA7, before that, I also checked the extractorqueue, it was empty. But when I exc

  • Ensuring the agent is up for all targets on a host

    Had an issue where the DBA's did not notice the agent on one host was down until it was too late. Is there a way to validate without DBA intervention (from the repository or OMS) werther or not the agent is working for ALL databases in an environment

  • How To Backup Mail for Legal Purposes

    How do I back up a Mail folder for legal purposes. Is printing out suffecient? These may need to be used in court and I want to make sure I have them saved or printed out properly. Thanks in advance - Macbook Mom