How to show a jtable created when a tree node is selected in a jsplit pane

hello,
does anyone know how you would go about updating a jtable you have created in a split pane when the data of the jtable changes?
i have a jtree that creates a jtable when a node is selected. i want to display this jtable in a split pane that is created when the gui is launched.
any help appreciated. i know it has something to do with updating a table model but if anyone has any sample code of how to do this, could they post it?
thank you.

Hi Laura,
When you make a selection on your JTree, what data are you send to the JTable? Is it an entirely new TableModel that gets set each time?
If you don't already have an implementation, consider using one JTable and simply swap the models in and out on JTree selection. It's probably best to contain the JTable in JScrollPane also. Perhaps not necessary, but calls to revalidate and repaint on the JTable after setting whatever data it is you set should update what is displayed.
Warm regards,
Darren

Similar Messages

  • How to execute custom code only when a specific node is selected in infoset

    Hi,
    We have written a piece of custom code under a node (P1045). Not all users will have access to this Infotype as it is related to Appraisals. So, when users (w/no access to 1045) try to run a Query for other info types data, they are getting error message 'Can not access 1045'. Custom code is getting generated whenever user runs a query. Tried to control custom code with simple IF condition by giving user name. Still generating 1045 code.
    All users use same infoset, where a group of users has access to 1045 and another group does not have access to 1045.
    Appreciate your inputs to get this resolved.
    Thanks,
    Swapna.

    Why don't you try another aproach, instead of adding the infotype to the infoset, create a new table as an alias (with the fields you want to show in regards to infotype 1045) and fill it in the node depending on the authorization check for that infotype in the code ?
    I think that adding the infotype as a node will always get the data from the infotype regardless, that is why it's showing the error.

  • I am running 4.0.1 and when I download something the Download box stays blank-even though I have selected in General Preferences 'Show the downloads window when downloading a file' AND selected 'Save files to Downloads'....???

    I am running 4.0.1 and when I download something the Download box stays blank-even though I have selected in General Preferences 'Show the downloads window when downloading a file' AND selected 'Save files to Downloads'....???

    In Firefox Options / Privacy be sure "Remember download history" is checked. To see all of the options on that panel, "Firefox will" must be set to "Use custom settings for history".
    To find your OS information, on your Windows desktop, right-click the My Computer icon, choose Properties, under System on that small window is info about your OS.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • How to get the user created when I prepare for the BD Identity Manager

    Hi I have a query, I need to get a backup database Identity Manager 9.1, I have a problem I do not remember user created to perform the backup, how can you know that I created when I made the installation of Identity Manager, or how can I find

    Hi,
    You can do this trick:
    1) Go to "Deployment Manager" in the Web Console, and open the EXPORT applet
    2) Export the User Defined Fields from the USR form. You don't need any dependence for this.
    3) Open the generated XML with a text editor.
    3) Search for the <SDK_SCHEMA> tag
    This tag contains the OIM schema name, wich shoud be your OIM database user.
    Hope it helps,

  • How to show/print waiting message when system is serving pdf to browser

    Hi,
    does anybody know how to print/show "please wait for your request to be completed..." message when they try to click GeneratePdf button for example
    they way i do serving pdf to the browser is as below
    response.reset();
    response.setContentLength(contentLength);
    response.setContentType("application/pdf");
    response.setHeader("Content-disposition", "inline; filename=\""System.currentTimeMillis()+".pdf"+ "\"");
    output = new BufferedOutputStream(response.getOutputStream());
    while (contentLength-- > 0) {
    output.write(input.read());
    output.flush();and this is what was written in my popup jsp ( when user click GeneratePdf , the application will process it and at the end serve pdf file to the user using popup window )
    <body> <h1>Please Wait for your request to be completed...........</h1> </body> </html>
    <%
    boolean redirect=false;
    try{
    PdfDispatcher.dispatchApplication(response,session);
    }catch(Throwable t){
    System.out.println("Application Dispatcher Exception ... "+t.getMessage());
    System.out.println("Continue as per normal....");
    redirect = true; // will redirect to other jsp output
    if(redirect){
    //go to other jsp
    }The problem is my message above never got printed to the page ( i guess because the browser thinks that the response has not been completed )
    by the time the response has been completed the whole page will be cover in pdf document
    The reason i want to do this because my user complaining that they see blank page for long time when the system is slow to generate/server pdf to them.
    and it would be better to show some "waiting message" when the system is processing the application and server pdf at the end of the operations.
    anybody know how to workaround this?
    Thanks

    just_a_kid83 wrote:
    does anybody know how to print/show "please wait for your request to be completed..." message when they try to click GeneratePdf button for exampleUse JavaScript+DOM. Add a <div> somewhere in the page where the message should be displayed and put the message and an animated 'loading' gif in it. Hide the <div> using the CSS 'display' property which is set to 'none'. Then add an onclick event to the button/link which downloads the PDF file which gets the <div> element by its ID and set its 'display' property to 'block'.

  • How many methods copies will create when i create multiple objects

    Hi
    I have big doubt in java. See the following Program
    class A{
    public int i;
    public static int j;
    public void methodOne(){
    Sytem.out.println("Welcome");
    public static void methodTwo(){
    System.out.println("Welcome methodOne");
    class B{
    public static void main(String[] args){
    A obj = new A();
    A objOne = new A();
    A objTwo = new A();
    In this program how many method copies and variable copies will create when i create mulitiple objects. I am sure that only one copy j variable and methodTwo method (becz both are static) for all the objects. what about the method methodOne and i. Here how many copies will create. Could you please explain this concept very clearly.
    Thanks and Regards
    Sherin Pooja

    Sherin wrote:
    Sorry I pasted the previous comment with table format. Here the table format is not working
    Local variables---Stack     
    Instance/Member/field variables---Heap     
    Class/static variables---Static Memory
    Methods---Methods do not live on the heap or stack.Incorrect. Methods live in the method area, which is "logically part of the heap," according to the JVM spec.
    Instance/Member/field variables---It will create and destroy according to object initialization and destroy.That's very poor English and doesn't really capture what happens.
    policyHolder = new PolicyHolder(); //Dynamic objects will be stored in the heap.
    All objects are stored in the heap. There's no distinction between "dynamic" and "static."
    Class/static variables---Static variables are created when the program starts and destroyed when the program stops.Wrong. They are created when the class is loaded and destroyed when it is unloaded.
    I don't know where you got all this information from, but I recommend you don't use that site. Much of it is just plain wrong, and the rest is very poorly written and imprecise.

  • How many homeobjects will be created when we deploy a ejb

    when we deploy ejb(session) in the server how many home objects the server will create and if multiple clients request the same beanhome object how the server will maintain plz anybody help me out

    One String object is created when the class is loaded.
    No objects are created when that line is executed.

  • How to Show floders and documents as a tree structure from path only

    sir,
    I am doing system side project using Java..
    so i want to know how to show folders and documents as tree structure format..
    plz give your idea regarding this?

    See for example Tree taglib in Coldtags suite:
    http://www.servletsuite.com/jsp.htm

  • Problems in creating a preorder tree node arraylist

    Hi, i want to create an arraylist containing a preorder tree node's name, the program compiled well but every time it gives error when i press the "Output Preorder" button to create the arraylist, the following is the code, can someone help? Thanks a lot!!
                    JButton outputPreorderButton = new JButton("Output Preorder");
    outputPreorderButton.addActionListener(new ActionListener()
         public void actionPerformed(ActionEvent e)
            for (Enumeration evev = tableTreeRootNode.preorderEnumeration() ; evev.hasMoreElements() ;) {
                   System.out.println(evev.nextElement());
                   String s = (String)evev.nextElement();
                   tableTreeNodesArray.add(s);

    Yeah, well, it will "give error" (as you so precisely and informatively say) if there's an odd number of nodes in your tree. Consider your code:System.out.println(evev.nextElement());
    // Get element number 1 and print it.
    String s = (String)evev.nextElement();
    tableTreeNodesArray.add(s);
    // Get element number 2 and add it to the list.So, the odd-numbered elements you print. The even-numbered elements you add to the list. If it happens there are 31 nodes, then an error will occur when you try to get node 32.

  • How can I display the tooltip in a tree node?

    I implement a TreeCellRenderer and has already set the tooltiptext through the following code:
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
            Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
            if(Leaf.class.isInstance(userObject)) {
                    Leaf leaf = (Leaf)userObject;
                    setToolTipText(leaf.getString());
        }Why can't the tree display the tooltip when a move the mouse on the leaf of the tree?
    Thank you!

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class Test3 extends JFrame {
    public Test3() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    JTree jt = new JTree() {
    public String getToolTipText(MouseEvent evt) {
    if (getRowForLocation(evt.getX(), evt.getY()) == -1)
    return null;
    TreePath curPath = getPathForLocation(evt.getX(),
    evt.getY());
    return curPath.getLastPathComponent().toString();
    content.add(new JScrollPane(jt), BorderLayout.CENTER);
    jt.setToolTipText("");
    setSize(400, 400);
    setVisible(true);
    public static void main(String[] args) { new Test3();
    }It sounds a solution. I use the following code and also can display the tooltip,but there's also a problem:
        mytree.setCellRenderer(new MyTreeCellRenderer());
        ToolTipManager.sharedInstance().registerComponent(mytree);the above code only effective when the function getTreeCellRendererComponent in MyTreeCellRenderer like the following:
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
         String  stringValue = tree.convertValueToText(value, selected,
                                expanded, leaf, row, hasFocus);
         setText(stringValue);
         setToolTipText(stringValue); //Tooltips used by the tree
         /* Set the icon of the node */
                         Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
         if(Device.class.isInstance(userObject)) {
             setIcon(deviceIcon);
         } else {
             setIcon(nullIcon);
             Business b = (Business)userObject;
         setFont(defaultFont);
         /* Update the selected flag for the next paint. */
         this.selected = selected;
         this.hasFocus = hasFocus;
         if(selected) // && hasFocus)
             setForeground(Color.white);
         else
             setForeground(Color.black);
         return this;
        }but when the code is bellow,it displays nothing(Only the leaf node need tooltip):
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
         String  stringValue = tree.convertValueToText(value, selected,
                                expanded, leaf, row, hasFocus);
         setText(stringValue);
         //setToolTipText(stringValue); //Tooltips used by the tree
         /* Set the icon of the node */
                         Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
                         if(Device.class.isInstance(userObject)) {
             setIcon(deviceIcon);
         } else {
             setIcon(nullIcon);
             Business b = (Business)userObject;
             if(b.isShowOrder())
                 setToolTipText(b.getContaId());  // only some node need tooltip, not all  node
         setFont(defaultFont);
         /* Update the selected flag for the next paint. */
         this.selected = selected;
         this.hasFocus = hasFocus;
         if(selected) // && hasFocus)
             setForeground(Color.white);
         else
             setForeground(Color.black);
         return this;
        }Anyone knows why?

  • How to change the data provider of the tree with the selection of combobox

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

  • How to directly change the text of a tree node once its in the tree

    How can I directly change the text of a tree node once its in the tree.
    I have a property box which fires an eventevery time it is edited
    (this is currently just output to the screen via println)
    What i want is for the tree node to take the updated text that is in the text box every time
    thus giving tree labels that update as you type
    PS. i have access to the tree node (DefaultMutableTreeNode) from the code that hanldes
    the text box event

    ... use the setUserObject() method of your DefaultMutableTreeNode, that'll set the text of the node.
    however, you probably need to do a treeModel.nodeChanged(node) with your tree model, to get the display updated.
    thomas

  • How to show an dropdown menu when user click on one point on lineseries?

    Hi all,
    I am new  in flex development.
    I am showing line series on the chart, I'd like to give some interaction, when user click on the "point" on the line, I'd like to show a dropdown menu, and react to user's choice on the menu item.
    Is it doable? Any sample or reference?
    Thanks in advance.
    /// Jack

    Cool, that definitely moving forward.
    I saw two questions here:
    1. I added mouseOver/mouseOut action to the LineSeries, it then react when I mouse over the line, instead of at the data point.
    2. How do I know the dataPoint's position and locate popmenu in that place? on other words, how do I have dropdown menu. I tried to use "this" as DisplayObjectContainer and send to Menu.createMenu, but seems not working.
    Here is the code pieces I am talking about:
    [Bindable]public var myMenu:Menu;
                // Create and display the Menu control.
                private function createAndShow():void {
                    Menu.
                    myMenu = Menu.createMenu(holder, myMenuData, true);
                    myMenu = Menu.createMenu(null, myMenuData, false);
                    myMenu.labelField="@label";
                    myMenu.show(10, 10);
                private function hideMenu():void {
                    myMenu.hide();
    <mx:series>
                        <mx:LineSeries mouseOver="createAndShow()" mouseOut="hideMenu()" sortOnXField="true"  xField="date1" yField="score1"  displayName="Score1">
    Thanks.

  • How to show a variable screen when clicking on direct link of report in ,when that report is used as target in RRI alsoRRI

    Hi All,
    I have created RRI between two reports and the type is web template/WAD.
    My requirement is to show the variable screen of target report when clicked on direct link and it should not show the var. screen if it goes from jump/go to.
    while currently I can not see var. screen on both the places and when switching the var. scree. display on in web template , it shows the screen at both the places.
    Please suggest.
    Thanks,
    Anu

    Hi Anu,
    "And when I am using another var. in assignment details which is ready for input (in both the queries), its not helping."
    Did you try using such a variable? What kind of a problem do you face? I am sorry I am still trying to understand your problem. I am just saying that which variable you use is not important for the first query. Only in the second query, add a variable with ready for input (I am not sure why the other doesn't work, I just tried and it gave an error, that's why I suggest this) and in RRI connection make the assignment with this variable. Please try this and let me know the result.

  • How to show list of items when the user pressed tab key in an empty field

    Hi all
    i would like to know if there is a way to open a form with items list which will be shown to the user when he pressed the tab key within a field for instance "item code" field will present a search form with a table filled with item codes and their description.
    i'm currently working in 2004 version. i know how to catch the event.
    i'm creating a form with a matrix object binded to a datasource which is connected to the data base table which contains all the items.
    what would like to know if there is a better way to this. maybe using buisness partner objects. and if so how
    appriciate the help
    Yoav

    You Should use Formatted Search in this case.
    You must create and associate a query for your field.
    click on the field you want items to be listed and press Shift + F2
    catch the keydown event of this field  and check pval.charpressed = 9 (tab key press)
    then execute
    SBO_Application.SendKeys("+")

Maybe you are looking for

  • Can't find driver for printer

    I have an HP PSC 750 connected to an airport express base station. It shows up in the printer browser when I click the add printer button (it says Bonjour under the connection type). However, under the 'print using' drop menu it won't auto select a d

  • Classpath problem

    i am here stuck.. my dir structure is c:\my\xxx\yyy\zzz i have a code ... package xxx.yyy.zzz; class A // some code }i have compiled sucessfully and put the clsss file into c:\my\xxx\yyy\zzz folder. now i want to import it in another class like... pa

  • Mac stuck

    Hey, I was using photoshop illustrator and some other programs, I started twitter for mac (newest version from the app store) and clicked speak tweet or something like that. He started talking and stopped when there was a link and now he doesn't resp

  • Can I install the LR4 upgrade and still keep my LR3 installed?

    I have LR 3 and I would like to upgrade to LR 4. Can I install the upgrade to LR 4 and still keep my LR 3 installation intact so that I can switch back and forth between the two versions if I want to?

  • Deleting Resources

    I'm trying to a delete a resource from Tidal Client Side and getting below message (Windows Master) Unable to delete record. It may be in use! (The DELETE statement conflicted with the REFERENCE constraint "FK__reslock__resmst___3C34F16F". The confli