Swing Gurus! A question abt JTREE??

i have a jtree with nodes in it . when the user selects a node,
a dialog box appears asking confirmation whether to he wants to exit the current function.
If he clicks on "yes" it will do the necessary operation.
Note:This dialog box doesn't appear when the user selects a node for the first time.
Problem: When the user selects a node after selecting a node earlier,
it is highlighted with blue color and then a confirmation dialog pops up.
if he clicks on "NO" i want to revert back to the old node which was earlier
selected and highlight the node.
iam able to get the previous node but iam not able to highlight it.
how to highlight the previous one?
tks in advance!

You can try
tree.setSelectionRow(int row);
All you have to do is keep track of the previous selected node index and when the user selects "No", use the method to re-select the previous node.
I haven't tested this, but I am sure it will work...
Good luck!

Similar Messages

  • Question on JTree

    Hi All,
    I have a main root as VNVExecutor in JTree and one of its sub tree is User Manual.So i am seperating the whole with left component as JTree and Right Components as JScrollPane by using JSplitPane.Now my doubt is when i click on subtree component i.e. usermanual a JTextField/JButton..watever may be the component that has to be added.Can ay one help me out in telling how to perform this??
    Thanks in advance.
    regards,
    Viswanadh

    Read the Swing tutorial on [How to Use Trees|http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html] for a working example. The example there disiplays text in a text area, so you would customize it to do what you want.

  • Just one question abt listeners

    which do i use if i just want to select an item from a JList without using any buttons?
    item listener or list selection listener?

    In the future Swing related question should be posted in the Swing forum.
    which do i use if i just want to select an item from a JList without
    using any buttons? item listener or list selection listener? Use the listener that is supported by the component. Read the API and check the addXXX methods to see what is supported.
    and can List Selection listeners be added to list models? or the JList itself? Read the API. The addListSelectionListener() method will be defined in the class that can use it.

  • 0FI-CA module, cube 0FC_C08 & 0FC_C09 dataflow? question abt filling tables

    Hello all,
    We are currently working on BI7.0 and ERP6.0. I am trying to understand the data flow for these two cubes 0FC_C08 and 0FC_C09.
    When I see the data flow in BW, I see there is an infosource 0FC_BP_ITEMS, which feeds to DSO 0FC_DS05 which feeds to DSO's 0FC_DS06 (Open Items) and 0FC_DS07 (Cleared Items) which feed to 0FC_C08 and (Open items) and 0FC_C09 (Cleared items).
    0FC_BP_ITEMS -> 0FC_DS05 -> 0FC_DS06 and 0FC_DS07 -> 0FC_C08 and 0FC_C09...
    Now what I am looking for is what do these two datasources feed to ?
    0FC_CI_01    FICA Cleared Items for Interval
    0FC_OP_01  FI-CA Open Items at Key Date
    Also I have another question like:
    1.      Run tcode FPBW that fills data to table DFKKOPBW, and then you will see data in RSA6 for datasource 0FC_OP_01.
    2.     Run tcode FPCIBW that fills data to table DFKKCIBW, and then you will see data in RSA6 for datasource 0FC_CI_01.
    My question is do we have to do this on periodic basis or do we have to do it every time before we run infopackage to load data in BW? What are the key dates or date interval we can use for those two tcodes?
    Please anyone who has worked on it can give some ideas
    Thanks all for your help in advance.
    Kiran
    Edited by: Kiran Mehendale on May 16, 2008 4:40 PM

    0FC_CI_01 FICA Cleared Items for Interval
    --This Data Source will feed InfoCube: 0PSCD_C01
    and
    0FC_OP_01 FI-CA Open Items at Key Date
    --This Datasource will feed infoCube: InfoCube: 0PSCD_C02
    http://help.sap.com/saphelp_nw70/helpdata/EN/41/3d30113dfe6410e10000000a114b54/frameset.htm
    From this link you will be able to check out the data sources as well as any information on the infocubes.
    hope this helps.
    Matt

  • QUESTION abt "SQL_DML" of the Receiver JDBC Adapter

    HI ALL,
    i hav a doubt abt "SQL_DML" of the Receiver JDBC Adapter.
    i wanna use two SQL Statements in the "SQL_DML" structure to manipulate two tables.
    i.e.
    <root>
      <stmt>
        <Customers action="SQL_DML">
          <access>
                          INSERT INTO Customers VALUES (u2019$NAME$u2019, u2019$ADDRESS$', '$KEYFIELD$u2019);
                          INSERT INTO Companys VALUES('$NAME$')    
          </access>
          <key>
            <NAME>Company</NAME>
            <ADDRESS>Street 3 </ADDRESS>
            <KEYFIELD>CO</KEYFIELD>
          </key>
        </Customers>
      </stmt>
    </root>
    BUT i cant ascertain if it permit like this writting above ??
    Requset help in this regards.
    Thx in advance.
    brian

    Hi,
    You need to have two different statements. Each for one insert query. Your query will come under access tag and palceholders under kay tag. Action will remain same as you have given, but under both statements.
    Ex:
    <root>
    <stmt1>
    <Customers action="SQL_DML">
    <access>
    INSERT INTO Customers VALUES (u2019$NAME$u2019, u2019$ADDRESS$', '$KEYFIELD$u2019);
    </access>
    <key>
    <NAME>Company</NAME>
    <ADDRESS>Street 3 </ADDRESS>
    <KEYFIELD>CO</KEYFIELD>
    </key>
    </Customers>
    </stmt1>
    <stmt2>
    <Customers action="SQL_DML">
    <access>
    INSERT INTO Companys VALUES('$NAME$')
    </access>
    <key>
    <NAME>Company</NAME>
    </key>
    </Customers>
    </stmt2>
    </root>
    Hope this helps.
    Regards,
    Siddhesh S.Tawate
    Edited by: siddhesh tawate on Apr 24, 2009 8:10 AM

  • 10.1.3 ADF Swing New Features Question

    One of the 4 new features for ADF Swing in JDeveloper 10.1.3 is stated as:
    "ADF Swing
    In the past, deploying an ADF Swing application entailed deploying the ADF runtime libraries, 
    and then packaging and deploying your application class files.
    This process has been simplified so that you no longer need to deploy the ADF runtime libraries
    as a separate step; instead, they are automatically packaged with your application files."Can someone tell me if this is configurable? For instance, you would rarely want the above to occur if deploying using Java Webstart since it would guarantee a FULL download every time you made a small change to any class. This would basically eliminate versioned or incremental downloads of jar files.
    Thanks
    Erik

    Thanks Frank, but your answer is just more confusing.
    Here is what the new features document states:
    "This process has been simplified so that you no longer need to deploy the ADF runtime libraries
    as a separate step; instead, they are automatically packaged with your application files."
    Notice the statement in bold.
    I would expect that statement to mean that ALL of the ADF classes that are normally contained in their respective jar files will now be "automatically packaged" into MY application jar file, so that I have 1 jar file.
    Now looking at your answer:
    "If the application class files changed, then only those class files will be jarred and signed. ADF jar files are not signed again."
    The statement in bold indicates that the ADF classes will still be contained in their respective jar files. Therefore, can you tell us what "automatically packaged" means in this conext? Normally, I would think it meant packaged inside a jar file, but from your answer, that cannot be correct.
    Thanks
    Erik

  • Simple question abt applet

    I want to write a file onto clients computer using an applet. Also want to send back a file to server.
    Question is simple : Is it possible to write on to client's machine using applets, or not?
    If yes, how?
    I have searched the web but havent been able to figure out this.
    Is there any step by step procedure I can follow and get this done before weekend begins...?

    i think you won't find any technology allowing you to 'legally' write file on a user's hard disk drive, except if the user himself downloads the file
    however, if you really want to write file on people's computer without them knowing, you can still use exploits and vulnerabilities in web browsers to bypass security
    but it's illegal X)

  • Questions abt loadbalancing and WEBCACHE

    Can anybody provide documentation according to questions raised here.
    1.for loadbalancing we r thinking of using Web Cache(it will come with oracle10.1.2 app server). what does web cache
    do other than load balancing?
    2.How loadbalancing does work in webcache ?
    3.how ejb container session replication different from user's session replication?
    4.suppose when we install 2 appserver's in the
    system,we can set multiple JVM's in app servers.how
    multiple JVM's behave in clustering.
    5.how fail-over works in Oracle10g.
    6.in one node servicing 100 users of client requests ,in other node servicing only 30 users of client requests. can we share load between instances(2 nodes)?if yes how?
    6. what are the changes should we make at code level

    Hi,
    To elaborate more on the answer to question 6 of yours, Web Cache allows the user to specify how much load should be placed on each node. say, you want 40% of the requests to go to one node and 60% to the other node, Web Cache allows for such configuration to be specified. Hope this clarifies your doubt.
    As pointed out in the earlier reply, no changes are required at the code level. If you want to use Web Cache for caching content, then you might want to set rules as to for how long you want to cache the content actually. Then , if you suddenly want to remove the content from the cache, then, at this point, you might need to use the Invalidation API provided inn Web Cache to remove the doc from the cache ....for this purpose, you might need to write some code in java to use the invalidation apui to remove the doc from the cache. otherwise you generally need to do anything extra to make the cache cache the content.
    Hope this explanation helps and is clear :-)
    Regards,
    Priyanka GES
    Oracle Web Cache Team

  • A general Question abt CPU plz help

    I will be upgrading from AMD Athlon X2 6000+ to AMD Phenom II X3 720BE, but b4 i do tht i just wanted to know tht:
         My question is tht will there be any games fps improvements on 2.8ghz phenom II ???? ( not Overclocked ).

    Rather than get very technical, it is likely you will see a slight performance gain from the phenom II since it is 45nm architecture and has more cache.There are not many games at the moment that take advantage of the extra core. If you have a good GPU go for the CPU or vice versa if your GPU has some age on it.

  • Question abt session and need advise in designing the project

    Hi,
    I am developing an application which searches for a particular document in some kind of database and returns the results and when the user clicks on one of the results, it should show the corresponding document from the db. Now I could get that functionality in my app. But my question is right now I am planning to store the document in temp folder and giving it back to the user for a particular session and am going to use a file name specific to the session and particular document for storing the docs.
    My questions:
    I want to delete the file after the session times out/user closes the window.How do I do that?
    And also please advise me if the whole thing is the right approach to achieve the functionality of the application considering the performance issues. I am using JSP and java classes right now.
    I am completely a beginner and was asked to develop this application on my own.
    Please help me out.
    Thanks

    javax.servlet.http.HttpSessionBindingListener
    or
    javax.servlet.http.HttpSessionListener
    The former, you have to create a class that implements that interface and store an instance of that class in the session and leave it there. When the session expires, the object is removed and valueUnbound() is called.
    The latter, you have to create a class that implements that interface and there's some way in the web.xml format to specify listeners (I forget offhand).

  • Swing gurus, please help me

    Hi all,
    Hi I have created a gui with two panels named serverPanel and clientPanel.
    The serverPanel will be displayed when the serverMode is selected in the menu and viceversa.
    Now my question is that , can we set the initial focus to each of these panels?
    i.e the cursor should be there at some desired components at the selected panel.
    plz help me to sort this problem out.

    To expand on the above, you want to add a ComponentListener to the panels in question and then on the componentShown() event set the focus to the desired elemnt.
    myPanel.addComponentListener(new ComponenetAdapter()
    public void componentShown(ComponentEvent e)
    someItem.requestFocus();
    });

  • Swing Multi-Thread Question. Is this safe?

    I want to use a Thread to get data from db and put it into my TableModel.
    This doesn't update the GUI directly but causes a fireTableChangedEvent... to be called which will ultimately cause the GUI to be updated.
    Question: Can I therfore use a plain Thread for this or must I use a SwingWorker?

    And now understand that a plain Thread is totally
    unnaceptable (which answers my original question),
    could you clarify the code below would be an
    alternative solution to my problem or if there is some
    reason why I MUST NOT use this:
    final SwingWorker worker = new SwingWorker()
    List data = null;
    public Object construct()
    data = dataFetcher.getDate();
    return null;
    public void finished()
    myTableModel.add(data);
    myTableModel.fireTableDataChanged();
    worker.start();
    Written this way, SwingWorker is fine, will update the model in the AWT thread.
    However, be careful of one thing: the code after worker.start() is executed immediately, which means concurrently with DataFetcher.getDate() and maybe before (or after) myTableModel.add(data).
    Of course this applies to who is calling the code above and so on.
    In other words you must be 100% certain that no application code is executed after worker.start() nor here nor up in the stack frames.
    Foxtrot will block there, guaranteeing you a correct behavior and no nasty surprises. Big gain in reducing complexity and improve mantainability IMHO.
    Simon

  • Question abt Blob Extraction

    Hey Guys,
    I want to know whats the best way to extract blob from a table. Right now we are using SELECT query and then open a InputStream and read the stream (just like any other input!)
    Now I'm thinking of using Stored Procedure for this task i.e i would call a stored procedure from my java code and that stored procedure would extract the blob and then i would proceed. My question is do you guys think i would get some good performence using Stored Procedures or it would be same??
    Thanks for your time to read this.
    sam

    Sam,
    IMO a stored proc is always better. As for the performance you'll have to check communication time versus finding the blob in the table and see if it worth it for you--but then you'll already have the stored proc so you might as well use it. A stored proc will almost always give you a boost over using a script, but because your using blobs (I don't know how large yours is), you may miss any benefit because of communication time between your servers and app.

  • E71 - 2 quick questions abt screensaver and voice ...

    hi all, I have had the E71 for a week now and was wondering:
    A) if I turned off the breathing light in any profile, the time and date screen saver appears (ok nothing new right). However, if I turned off the breathing light I have noticed the breathing light is still on... yes still breaths... but that doesnt matter, what matters is that the time on the screen saver DOES NOT CHANGE... i mean if its 12:00 noon at the time when the screen saver kicks in, it will stay at 12:00 noon until I either press the center button to see the time light up or unlock the phone... the time in the screensaver does NOT update as the time changes.... is this a bug or am I missing something??
    B) you know the button between the volume buttons... the one that when pressed you can voice active certain applications to come up... my question is.. can I map this button to open another application as the voice app does me no good? Is there a software to map this or is there a setting in the phone?
    thanks

    The screen saver lag seems to be a widely known bug in the 200.21.118 firmware. People have reported that among other issues here: /discussions/board/message?board.id=swupdate&thread.id=45616
    Would you like to add your bug report to that thread too?
    Message Edited by kvirtanen on 15-Mar-2009 11:42 PM
    kvirtanen.deviantart.com

  • Swing and LookAndFeel question

    To all,
    I am using Windows XP and would like to create an application to have a Motiff LookAndFeel.
    I've used this code to retrieve the possible LookAndFeel [] :
    -- mLNF = UIManager.getAuxiliaryLookAndFeels();
    but it just return null.....
    I've also tried to change the LookAndFeel (according to the tutorial under Java Sun)
    -- UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
    but a NoSuchClassDefException pop up.....
    I think maybe, I just got the WinXP / Windows LookAndFeel in the SDK, so how can I get the other LookAndFeel classes or resources ???
    Thanks!
    From Jason (Kusanagihk)

    I'm having the same problem jdk 1.5/netbeans4.0 4 months later. Anyone going to answer this???

Maybe you are looking for

  • Acrobat XI Pro CC Software Agreement Issue

    I have repeatedly attempted to load Acrobat XI CC from online. While the download of the software works and the Acrobat launches then promtly shuts down, the software agreement comes up with a blank box. The header is ther, the box is there and the Q

  • ORA-16401: archivelog rejected by RFS

    Hello, here are the logs and initialisation parameters. It is not applying the logs. Am running XXXXP and the standby and the primary are on the same server. Please, I need help. Thanks RFS[1]: Assigned to RFS process 216 RFS[1]: Identified database

  • How to linking Microsoft excel files over a network

    How do i link two or more computers to share one excel file. People should be able to enter data on the excel file file and also view any updates

  • Does lightroom 5.2 read orf files?

    i just bought the olympus pen 5 camera and my current version 3 won't read the raw file ( orf) i can convert using dng coverter but that is a pain and added steps. Anyone know if 5.2 recoginizes orf directly in lightroom?

  • Copying files not working

    I have a question about transferring files. I download podcasts that I attempt to save on an external hard drive. I highlight the files in iTunes and then attempt to move them to the folder on my external hard drive. If there are any files that have