Refreshing the jtree in a jpanel

hi,
i created a jtree of files in a certain folder... if some files changed in my folder, how can i refresh the jtree in my jpanel...
thanks!!!

Hi,
look here:
http://forum.java.sun.com/thread.jspa?threadID=478780&messageID=2226565
L.P.

Similar Messages

  • The Jtree is not refreshing with new values when mouse click on the node

    hi ,
    I am creating a tree from a vector .The values in the vector is coming from the JTable data after satisfing the some condition. But the data in the Jtable is changing time to time so the data in the vector is also changing .
    But the problem is that when first I create a tree with that data the tree is created but for the next time I click on the tree node the tree is not changing i.e. it is not created with the new values that is stored in the vector at that time .what to do .Please help
    I am using DefaultMutableTreeNode for creating the tree .In starting I have created one root and the one it's child .Now the next subtree of the root child have to be created by this vector data. this subtree should be updated according to the values in the vecter.
    public void valueChanged(TreeSelectionEvent e) {
    //code here
    subtreecreat();
    //some function that create tree after cheching the some condition here
    subtreecreat() {
    Enumeration en=vector.elements();
    while(en.hasMoreElements())
    DefaultMutableTreeNode servername = new DefaultMutableTreeNode(en.nextElement());
    node.add(servername);
    Please help it is very urgent
    Thanks in Advance,
    anum

    Well, you can either use a custom TreeModel that tracks your Vector, or you can use a DefaultTreeModel and call model.reload(node) to refresh the tree below the specified node.

  • How can i refresh a jtree using DefaultMutableTreeNode?

    I already create a jtree using DefaultMutableTreeNode, and i also could implement to it the addMouseListener to do a action when the user press every node......Also i used the following instruction to remove all nodes: root_tree.removeAllChildren(); and it instruction remove all the nodes....but when i :
    fill the tree
    compile my program
    i see the tree in my jpanel....it is Ok!
    now.....
    fill the tree
    remove the tree
    compile my program
    i see only the root (this i wish) it is Ok!
    But now i would like that after that i press a combo element (in the actionperformed method):
    remove the tree
    fill the three with the new nodes
    show the tree
    But my tree always is the same :(......is like it to need a repaint ....but i already implement it...but i obtain the same result.....
    Do somebody have any suggestion...or idea how i can do a refresh in my jtree?....
    Anybody could help me please?
    Thanks in advance.....
    Mary

    Construct your tree like this:DefaultMutableTreeNode rootNode = xxx;
    DefaultTreeModel model = new DefaultTreeModel( rootNode );
    JTree tree = new JTree( model );When you update the root node, just tell the model to fire the appropriate change event by doing this:model.reload( rootNode );or this:model.nodeStructureChanged( rootNode );or this:model.setRoot( rootNode )

  • Refreshing the panels when new content added?

    Hey, guys. My first post here; hope I'm not too much of a JNewbie for you. :)
    I'm getting my feet wet in Swing, working on an invoice program for work. I want it to look like a regular invoice, with fields for SKU, description, cost per unit, units, and total per line item. Right now, I have those five fields in a Jpanel that I add to the bottom of the layout.
    The problem is that I need the ability to go to File => Add New Item... and have another JPanel with those five fields add to the bottom so a 2nd item can be added to the form below the first. I tried making a function that adds them to the panel, using the same type of syntax that the generated code (using a form builder in NetBeans) did. I don't see the lines get added.
    My thought is that there is some function I need to call to redraw or refresh the panel so that the new components start drawing. However, my Great Javadoc Adventure has turned up no clues.
    Can anyone please give me a hand with making this happen, or at the least coming up with an alternate solution that will achieve similar results?
    Thanks much.
    Jaeden Stormes
    [email protected]

    I tried revalidate() , but no change.
    Here's the function I'm using to try to add the item...
    private void NewLineItem()
    javax.swing.JPanel jLine = new javax.swing.JPanel();
    jLine.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    jItemCode.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jLine.add(jItemCode, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 110, -1));
    jCourseDelivery.setHorizontalAlignment(javax.swing.JTextField.LEFT);
    jLine.add(jCourseDelivery, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 0, 240, -1));
    jItemQuantity.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jLine.add(jItemQuantity, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 0, 110, -1));
    jItemRate.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jLine.add(jItemRate, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 0, 100, -1));
    jItemAmount.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    jLine.add(jItemAmount, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 0, 100, -1));
    jLineItemSection.add(jLine);
    jLineItemSection.revalidate();
    pack();
    JLineItemSection is a JPanel inside my frame.
    Any suggestions? I think the way I am using the AbsoluteContraints is screwed up, as I'm having a lot of trouble with the layouts in general. The form editor in NetBeans (at least, the version in 3.6) needs a LOT of work.

  • Custom JTree TreeCellRenderer with JPanel

    I have developed a custom TreeCellRenderer which extends JPanel to allow multple icons to be displayed and changed as the context changes. The JPanel has one or two icons and a JLabel which I control based on display context. The renderer works fine with one exception. If the initial string displayed beside the icons is short (such as 4 characters) when I try to display it with a longer string the JPanel does not resize to allow displaying the entire string. I've tried several variation to get the JPanel to resize. I've exanined the code in operation and it seems as though the size of the JLabel is being change correctly and the setPreferredSize on the JPanel is changing correctly. It just wont display without truncating the longer JLabel.
    I've reviews the forum to no avail.
    The code follows. Any thoughts are appreciated
    import javax.swing.ImageIcon;
    import java.awt.Image;
    import javax.swing.JLabel;
    import javax.swing.tree.TreeCellRenderer;
    import javax.swing.JTree;
    import com.logixpartners.planlogix.insuranceobject.*;
    import com.logixpartners.planlogix.utility.RtnObject;
    import java.awt.*;
    public class PLIconLabel extends javax.swing.JPanel implements TreeCellRenderer {
    ImageIcon a,b;
    int fWidth = 0;
    int sWidth = 0;
    String text = "";
    JLabel one, two, three;
    InsObject io;
    boolean selected;
    FontMetrics fontMetrics;
    int iconHeightPad = 0;
    int fontH, fontLen, iconH = 30+iconHeightPad;
    /** Creates a new instance of PLIconLabel */
    public PLIconLabel() {
    super(null); //null indicates no layour manager
    one = new JLabel();
    one.setIconTextGap(0);
    two = new JLabel();
    two.setIconTextGap(0);
    three = new JLabel();
    three.setIconTextGap(0);
    add(one);
    add(two);
    add(three);
    public void setIconOne(ImageIcon i) {
    a = i;
    fWidth = a.getImage().getWidth(this);
    one.setBounds(0,0, fWidth, a.getImage().getHeight(this)+iconHeightPad);
    if (b != null) {
    two.setBounds(fWidth,0,sWidth,b.getImage().getHeight(this)+iconHeightPad);
    three.setBounds(fWidth+sWidth+5,0,fontLen, iconH);
    one.setIcon(a);
    repaint();
    public void removeIconOne() {
    a = null;
    fWidth = 0;
    if (b != null) {
    two.setBounds(fWidth,0,sWidth,b.getImage().getHeight(this)+4);
    three.setBounds(fWidth+sWidth+5,0, fontLen, iconH);
    one.setIcon(a);
    repaint();
    public void setIconTwo(ImageIcon i) {
    b = i;
    sWidth = b.getImage().getWidth(this);
    two.setBounds(fWidth,0,sWidth,b.getImage().getHeight(this)+iconHeightPad);
    three.setBounds(fWidth+sWidth+5,0, fontLen, iconH);
    two.setIcon(b);
    repaint();
    public void removeIconTwo() {
    b = null;
    sWidth = 0;
    two.setIcon(b);
    two.setBounds(fWidth,0,0,0);
    three.setBounds(fWidth+sWidth+5,0,fontLen, iconH);
    repaint();
    public void setPLText(String t) {
    text = t;
    three.setText(t);
    fontMetrics = three.getFontMetrics(three.getFont());
    fontLen = fontMetrics.stringWidth(t);
    fontH = fontMetrics.getHeight();
    three.setBounds(fWidth+sWidth+5,0,
    fontLen+10,
    fontH);
    repaint();
    public java.awt.Component getTreeCellRendererComponent(JTree tree,
    Object value,
    boolean sel,
    boolean expanded,
    boolean leaf,
    int row,
    boolean hasFocus) {       
    try {
    io = (InsObject)value;
    } catch (java.lang.ClassCastException e) {
    e = e;
    setPLText(io.getBestName());
    if (io.getTypeOf().equals("Ref")){
    setPLText(io.getAttribute("Name"));
    // Setup colors for node selection
    if (sel) {
    setBackground(new java.awt.Color(64,128,128));
    } else {
    setBackground(new java.awt.Color(95,167,152));
    // Change text color of node
    three.setForeground(sel ? java.awt.Color.white : java.awt.Color.black);
    // Get proper Icon for Node
    if ((io.getClass().getName()).equals("com.logixpartners.planlogix.insuranceobject.InsObjectRef")){
    setIconTwo( (ImageIcon)((RtnObject)PLIcons.getIcon((String)io.getTypeOf())).getReturnValue());
    setIconOne((ImageIcon)PLIcons.get("RefPtr") );
    } else {
    removeIconOne();
    if (!expanded && !leaf) {
    setIconTwo( (ImageIcon)((RtnObject)PLIcons.getIconX((String)io.getTypeOf())).getReturnValue());
    } else {
    setIconTwo( (ImageIcon)((RtnObject)PLIcons.getIcon((String)io.getTypeOf())).getReturnValue());
    two.setToolTipText((String)io.getTypeOf());
    selected = sel;
    Dimension dim = new Dimension(three.getWidth()+60+fWidth+sWidth+20,iconH);
    setPreferredSize(dim);
    setMinimumSize(dim );
    setMaximumSize(dim );
    setSize(dim);
    validate();
    return this;
    }// end of class

    Addition to my original post. I found a forum post noting a similar problem. The suggest fix was to set the JTree row heigth to 0 (zero) and to add a getPreferredSize in the TreeCellRenderer, which gets called when row height is zero, and explicitly set the desired size. This works but with an exception. It seems as though the getPreferredSize is only called once when it is a leaf node being rendered. This seems to be true for expand, collaspe, and select.

  • How to dislay a frame when i clck on the node or leaf on the JTree

    Hi All,
    Iam doing project on swing. In that iam doing with JTree. The Jtree is displaying on the left side of the splitpane .My problem is if i click on the nodes or leaf in the JTree one panel should be open in on the right side of the spltpane. Iam pasting the code.please can any body knows the solution please send me.
    regards
    sonali
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.BorderFactory;
    import javax.swing.border.*;
    import java.awt.event.*;
    import javax.swing.tree.*;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.tree.TreeSelectionModel;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import java.net.URL;
    import javax.swing.*;
    import java.io.IOException;
    import javax.swing.JEditorPane;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.JFrame;
    import Test.Test1;
    public class JFrame1 extends javax.swing.JFrame {
    JScrollPane sp;
    JPanel topPanel;
    JPanel leftPanel;
    JPanel bottomPanel;
    JPanel rightPanel;
    Border b ;
    JTree tree;
    DefaultTreeModel treeModel;
         public JFrame1(){
              getContentPane().setLayout(null);
              setSize(405,305);
              setVisible(false);
              JPanel1.setLayout(null);
              getContentPane().add(JPanel1);
              JPanel1.setLayout(new GridLayout(1, 1));
              JPanel1.setBounds(0,0,405,305);
              JPanel1.add(JSplitPane1);
              JSplitPane1.setBounds(0,5,405,305);
              JSplitPane1.setContinuousLayout(false);
              topPanel = new JPanel();
              leftPanel = new JPanel();
              bottomPanel = new JPanel();
              topPanel.setLayout(new FlowLayout());
              leftPanel.setLayout(null);
              b = new EtchedBorder();
              leftPanel.setBorder(b);
              leftPanel.setBounds(0,0,300,305);
              bottomPanel.setLayout(new FlowLayout());
              rightPanel = new JPanel();
              rightPanel.setBounds(108, 0, 300, 305);
              JSplitPane1.setRightComponent(rightPanel);
              JSplitPane1.setLeftComponent(leftPanel);
              rightPanel.setLayout(null);
              topPanel.setBounds(0,0,305,25);
              b = new EtchedBorder(0);
              topPanel.setBorder(b);
              bottomPanel.setBounds(0,26,300,280);
              b = new BevelBorder(1, Color.black,Color.black);
              bottomPanel.setBorder(b);
              rightPanel.add(topPanel);
              rightPanel.add(bottomPanel);
              JSplitPane1.setDividerLocation(120);
              DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
    DefaultMutableTreeNode subroot = new DefaultMutableTreeNode("SubRoot");
    DefaultMutableTreeNode leaf1 = new DefaultMutableTreeNode("Leaf 1");
    DefaultMutableTreeNode leaf2 = new DefaultMutableTreeNode("Leaf 2");
    DefaultMutableTreeNode leaf3 = new DefaultMutableTreeNode("Leaf 3");
    DefaultMutableTreeNode subroot1 = new DefaultMutableTreeNode("SubRoot1");
    DefaultMutableTreeNode leaf11 = new DefaultMutableTreeNode("Leaf 11");
    DefaultMutableTreeNode leaf21 = new DefaultMutableTreeNode("Leaf 21");
    DefaultMutableTreeNode leaf31 = new DefaultMutableTreeNode("Leaf 31 skfjdsf sfjfdsl fslfkjdsfl sflkjaflksdfdslfjds lfsdlkfjdslk sdsdlkfjdsla fflkdasjfdslkjal");
    DefaultMutableTreeNode subroot2 = new DefaultMutableTreeNode("SubRoot2");
    DefaultMutableTreeNode leaf12 = new DefaultMutableTreeNode("Leaf 12");
    DefaultMutableTreeNode leaf22 = new DefaultMutableTreeNode("Leaf 22");
    DefaultMutableTreeNode leaf32 = new DefaultMutableTreeNode("Leaf 32");
    treeModel = new DefaultTreeModel(root);
    tree = new JTree(treeModel);
    treeModel.insertNodeInto(subroot, root, 0);
    treeModel.insertNodeInto(leaf1, subroot, 0);
    treeModel.insertNodeInto(leaf2, root, 1);
    treeModel.insertNodeInto(leaf3, root, 2);
    treeModel.insertNodeInto(subroot1, root, 3);
    treeModel.insertNodeInto(leaf11, subroot1, 0);
    treeModel.insertNodeInto(leaf21, subroot1, 1);
    treeModel.insertNodeInto(leaf31, subroot1, 2);
    treeModel.insertNodeInto(subroot2, root, 3);
    treeModel.insertNodeInto(leaf12, subroot2, 0);
    treeModel.insertNodeInto(leaf22, subroot2, 1);
    treeModel.insertNodeInto(leaf32, subroot2, 2);
    sp = new JScrollPane();
    sp.setBounds(0,0,300,305);
    sp.getViewport().add(tree);
    sp.setViewportBorder(BorderFactory.createRaisedBevelBorder());
    leftPanel.add(sp,BorderLayout.CENTER);
    //          SymPropertyChange lSymPropertyChange = new SymPropertyChange();
    //          JSplitPane1.addPropertyChangeListener(lSymPropertyChange);
              SymWindow aSymWindow = new SymWindow();
              this.addWindowListener(aSymWindow);
              SymComponent aSymComponent = new SymComponent();
              this.addComponentListener(aSymComponent);
         public JFrame1(String sTitle)
              this();
              setTitle(sTitle);
         public void setVisible(boolean b)
              if (b)
                   setLocation(50, 50);
              super.setVisible(b);
         static public void main(String args[])
              (new JFrame1()).setVisible(true);
         public void addNotify()
              Dimension size = getSize();
              super.addNotify();
              if (frameSizeAdjusted)
                   return;
              frameSizeAdjusted = false;
              Insets insets = getInsets();
              javax.swing.JMenuBar menuBar = getRootPane().getJMenuBar();
              int menuBarHeight = 0;
              if (menuBar != null)
                   menuBarHeight = menuBar.getPreferredSize().height;
              setSize(insets.left + insets.right + size.width, insets.top + insets.bottom + size.height + menuBarHeight);
         boolean frameSizeAdjusted = false;
         javax.swing.JPanel JPanel1 = new javax.swing.JPanel();
         javax.swing.JSplitPane JSplitPane1 = new javax.swing.JSplitPane();
         /*class SymPropertyChange implements java.beans.PropertyChangeListener{
              public void propertyChange(java.beans.PropertyChangeEvent event){
                   Object object = event.getSource();
                   if (object == JSplitPane1)
                        JSplitPane1_propertyChange(event);
    /*     void JSplitPane1_propertyChange(java.beans.PropertyChangeEvent event){
         System.out.println("!");
         sp.setSize((int)JSplitPane1.getLeftComponent().getBounds().getWidth()-2,(int)JSplitPane1.getLeftComponent().getBounds().getHeight()-2 );
         sp.repaint();
         tree.repaint();
         class SymWindow extends java.awt.event.WindowAdapter{
              public void windowActivated(java.awt.event.WindowEvent event){
                   Object object = event.getSource();
                   if (object == JFrame1.this)
                        JFrame1_windowActivated(event);
              public void windowIconified(java.awt.event.WindowEvent event){
                   Object object = event.getSource();
                   if (object == JFrame1.this)
                        JFrame1_windowIconified(event);
         void JFrame1_windowIconified(java.awt.event.WindowEvent event){
         void JFrame1_windowActivated(java.awt.event.WindowEvent event){
         class SymComponent extends java.awt.event.ComponentAdapter{
              public void componentShown(java.awt.event.ComponentEvent event){
                   Object object = event.getSource();
                   if (object == JFrame1.this)
                        JFrame1_componentShown(event);
              public void componentResized(java.awt.event.ComponentEvent event){
                   Object object = event.getSource();
                   if (object == JFrame1.this)
                        JFrame1_componentResized(event);
         void JFrame1_componentResized(java.awt.event.ComponentEvent event){
         System.out.println("!!");
              JPanel1.setSize(this.getContentPane().getMaximumSize());
              JSplitPane1.setSize((int)JPanel1.getMaximumSize().getWidth()-5,(int)JPanel1.getMaximumSize().getHeight()-5 );
              topPanel.setBounds(0, 0, rightPanel.getWidth()-3, 25);
              bottomPanel.setBounds(0,26,rightPanel.getWidth()-3,rightPanel.getHeight()-28);
              sp.setSize((int)leftPanel.getMaximumSize().getWidth(),(int)leftPanel.getMaximumSize().getHeight());
         sp.setAutoscrolls(true);
         //sp.setSize((int)JSplitPane1.getLeftComponent().getBounds().getWidth()-2,(int)JSplitPane1.getLeftComponent().getBounds().getHeight()-2 );
         sp.repaint();
         //sp.setSize((int)leftPanel.getSize().getWidth(),(int)leftPanel.getSize().getHeight() );
         void JFrame1_componentShown(java.awt.event.ComponentEvent event){
         System.out.println("!!!");
              JPanel1.setSize(this.getContentPane().getMaximumSize());
              JSplitPane1.setSize((int)JPanel1.getMaximumSize().getWidth()-5,(int)JPanel1.getMaximumSize().getHeight()-5 );
              topPanel.setBounds(0, 0, rightPanel.getWidth()-3, 25);
         sp.setSize((int)JSplitPane1.getLeftComponent().getBounds().getWidth()-2,(int)JSplitPane1.getLeftComponent().getBounds().getHeight()-2 );
         sp.repaint();
              bottomPanel.setBounds(0,26,rightPanel.getWidth()-3,rightPanel.getHeight()-28);
    }

    hi sculz,
    i develped the tree, and tree selection listener also the 4 th point i didnt able to do . here is the code belo what i did.
    iam not able to add the JSplit pane also.
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.event.*;
    public class Tree08 extends JFrame{
    Hashtable theHashtable = new Hashtable();
    int frameWidth = 300;
    int frameHeight = 305;
    int numberRows = 19;
    JTree tree;
    JPanel treePanel;
    String plafClassName =
    "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
    For future reference, the three plaf implementations
    are:
    com.sun.java.swing.plaf.metal.MetalLookAndFeel
    com.sun.java.swing.plaf.motif.MotifLookAndFeel
    com.sun.java.swing.plaf.windows.WindowsLookAndFeel
    JLabel display;
    public static void main(String args[]) {
    new Tree08();
    public Tree08 () {
    theHashtable.put("Cabbage","Good in slaw");
    theHashtable.put("Squash","The yellow variety");
    theHashtable.put("Onion","Not too hot");
    theHashtable.put("Squirrel","Likes to store nuts");
    theHashtable.put("Rabbit","Runs fast");
    theHashtable.put("Fox","Crazy like a ...");
    theHashtable.put("Horse","Fun to ride");
    theHashtable.put("Pig","Lives in mud");
    theHashtable.put("Cow","Gives us milk");
    theHashtable.put("Peach","From Georgia");
    theHashtable.put("Grape","Saueeze into wine");
    theHashtable.put("Apple","Red delicious");
    theHashtable.put("Orange","Very juicy");
    DefaultMutableTreeNode[] theTreeNodes = new
    DefaultMutableTreeNode[numberRows];
    theTreeNodes[0] = new DefaultMutableTreeNode("Sample
    Tree");
    theTreeNodes[1] = new
    DefaultMutableTreeNode("Vegetables");
    theTreeNodes[2] = new
    DefaultMutableTreeNode("Cabbage");
    theTreeNodes[3] = new
    DefaultMutableTreeNode("Squash");
    theTreeNodes[4] = new
    DefaultMutableTreeNode("Onion");
    theTreeNodes[5] = new
    DefaultMutableTreeNode("Animals");
    theTreeNodes[6] = new
    DefaultMutableTreeNode("Forrest");
    theTreeNodes[7] = new
    DefaultMutableTreeNode("Squirrel");
    theTreeNodes[8] = new
    DefaultMutableTreeNode("Rabbit");
    theTreeNodes[9] = new DefaultMutableTreeNode("Fox");
    theTreeNodes[10] = new
    DefaultMutableTreeNode("Farm");
    theTreeNodes[11] = new
    DefaultMutableTreeNode("Horse");
    theTreeNodes[12] = new DefaultMutableTreeNode("Pig");
    theTreeNodes[13] = new DefaultMutableTreeNode("Cow");
    theTreeNodes[14] = new
    DefaultMutableTreeNode("Fruit");
    theTreeNodes[15] = new
    DefaultMutableTreeNode("Peach");
    theTreeNodes[16] = new
    DefaultMutableTreeNode("Grape");
    theTreeNodes[17] = new
    DefaultMutableTreeNode("Apple");
    theTreeNodes[18] = new
    DefaultMutableTreeNode("Orange");
    theTreeNodes[0].add(theTreeNodes[1]);
    theTreeNodes[1].add(theTreeNodes[2]);
    theTreeNodes[1].add(theTreeNodes[3]);
    theTreeNodes[1].add(theTreeNodes[4]);
    theTreeNodes[0].add(theTreeNodes[5]);
    theTreeNodes[5].add(theTreeNodes[6]);
    theTreeNodes[6].add(theTreeNodes[7]);
    theTreeNodes[6].add(theTreeNodes[8]);
    theTreeNodes[6].add(theTreeNodes[9]);
    theTreeNodes[5].add(theTreeNodes[10]);
    theTreeNodes[10].add(theTreeNodes[11]);
    theTreeNodes[10].add(theTreeNodes[12]);
    theTreeNodes[10].add(theTreeNodes[13]);
    theTreeNodes[0].add(theTreeNodes[14]);
    theTreeNodes[14].add(theTreeNodes[15]);
    theTreeNodes[14].add(theTreeNodes[16]);
    theTreeNodes[14].add(theTreeNodes[17]);
    theTreeNodes[14].add(theTreeNodes[18]);
    treePanel = new TreePanel(theTreeNodes[0]);
    tree.addTreeSelectionListener(new MyTreeListener());
    Container content = getContentPane();
    content.add(treePanel,BorderLayout.CENTER);
    display = new JLabel("Display Selection Here");
    content.add(display,BorderLayout.SOUTH);
    setSize(frameWidth, frameHeight);
    setTitle("Copyright 1998, R.G.Baldwin");
    setVisible(true);
    this.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);}
    class MyTreeListener implements TreeSelectionListener{
    public void valueChanged(TreeSelectionEvent e) {
    DefaultMutableTreeNode theNode =
    (DefaultMutableTreeNode)
    (e.getPath().getLastPathComponent());
    if (theNode.isLeaf()) {
    display.setText((String)theHashtable.get(
    theNode.getUserObject()));
    class TreePanel extends JPanel {
    public TreePanel(TreeNode root){
    setLayout(new BorderLayout());
    tree = new JTree(root);
    JScrollPane sp = new JScrollPane(tree);
    add(sp, BorderLayout.CENTER);
    try{
    UIManager.setLookAndFeel(plafClassName);
    }catch(Exception ex){System.out.println(ex);}
    SwingUtilities.updateComponentTreeUI(this);
    for(int cnt = 0; cnt < numberRows; cnt++){
    tree.expandRow(cnt);
    regards
    sonali

  • Problem in refreshing a JTree

    Hi,
    Can anyone tell how to refresh a JTree(javax.swing.Jtree) used for displaying file system(both local and remote).
    I'm getting a problem if a file/directoy is added to the file system, after my Applet is loaded. Actually, i have used DefaultTreeModel's reload() method and calling it inside SwingUtilities.invokeLater() using Thread, but its not working.
    Plz help me out.
    Thanks

    Hi everybody,
    CAN ANYONE HELP ME OUT?????????

  • Refreshing a jtree(jdeveloper)

    if the tree is expanded then how can it be collapsed on a button's click event
    and if we have a value equivalent to a particular node of jtree then how we can expand the tree upto that level
    i m using jdeveloper and i have to display the in expanded form immediately after selecting a value in a jtable and when i click refresh button then tree must be collapsed

    The problem is that I'm not chaning a node directly. My custom nodes are based on a DOM Document, and I'm changing the contents of one of the document's elements using a text field. So what I need to do is inform the JTree that it needs to re-render.
    Calling treeDidChange() does force the tree to re-render, but the JLabel's at each node do not change their size - so when my renderer does a setText() for a node, the label's bounding box is still the size of the old text and I get a "..." showing that my new text is too big for the box.
    The only way I've found to solve it is to set a new renderer every time I change the model's data. However, this means I am creating tons of these render objects, one on each edit! Yuck!
    I'm sure there's a more elegant or correct way to do this.

  • How to refresh the client area

    i used javax.swing.JPanel and drawed many shapes with paintComponent method. i wonder how to refresh the client area.
    ps: i first used paint method to draw shapes, but i found a copy of the menu bar appeared. at last i found paintComponent method works, but when i tried to refresh the client area with repaint, the same scene appears.
    could some one help me?
    thanks in advance!

    when i tried to refresh the client area with repaint, the same scene appears. When you invoke repaint() on a component, the paintComponent() method of that component is invoked. So unless your code in that method is different, the image painted will be the same.

  • Not having to refresh the data in the main report but only in the subreport

    Hi SAP,
    I have a report that uses a stored procedure in the main report and uses regular database tables in the subreport.  The data returned from the stored procedure reports information from the month-end database (a cutoff point from the previous month's numbers) while the subreport reports information from the live database.  This report gets run everyday to show the changes in numbers from the live database.  Obviously the numbers from the month-end database remainds static until the next month's cutoff database is created. 
    My problem is that everyday when I run the report, the data needs to refresh from both the stored procedure in the main report and the live database tables in the subreport.  How can I leave the data returned from the stored procedure static or as is without refreshing the stored procedure returned data and just have the subreport data refresh itself?  The stored procedure really puts a strain on the database and I would like to cut-out the time to process the report as well.  Does anyone have any ideas?
    Zack

    Hi Zack,
    Try the following under Report options.
    1. Clear the check box of "Verify Stored Procedures on First Refresh" in the Main report.
    2. Select the check box of "Verify on First Refresh" in  the sub report.
    Hope this helps.

  • Can not refresh the metrics in schedular

    Post Author: sachinddalal
    CA Forum: Performance Management and Dashboards
    Hi,
    When I refresh the metric using schedular, the metric is not refreshed , nor schedular return any error. But when checked in metrics proparties, the last refresh date is not changed, niether the values are updated.
    Whe I try to refresh the metric manual, the values are refresh.
    Please help me to troubleshoot the problem of refreshing metric through schedular.
    Thanks,
    Regards
    Sachin Dalal

    Post Author: jezbraker
    CA Forum: Performance Management and Dashboards
    Scheduler is pretty horrid for refreshing metrics.Better of to use the Rules engine and create a rule thats based on a schedule that based on condition (1=1 works well ) then refreshes metircs.troubleshooting is best done with the trace options in setup/parameters.there are a few other ways or seeing what the schedulers up to - but id stick to rules if i were you.

  • How can I fast refresh the  materialized view !!

    I created a MV base on some tables in order to improve the querey speed.
    but the mv I have created falied to refresh fast.
    because there are two same table in the from clause:
    jcdm jc1,jcdm jc2
    create materialized view temp_mv
    nologging
    pctfree 0
    storage (initial 2048k next 2048k pctincrease 0)
    parallel
    build immediate
    refresh force
    on demand
    as
    select
    TAB_GSHX.rowid hx_rid,
    TAB_GSHD.rowid hd_rid ,
    JC1.rowid jc1_rid ,
    JC2.rowid jc2_rid ,
    YSHD_ID     HXID,          
    JC1.JCDM     QFD,     
    JC2.JCDM     JLD     
    FROM
    TAB_GSHX,
    TAB_GSHD,
    jCDM JC1,
    JCDM JC2
    WHERE
    YSHD_ID=YSHX_ID
    AND YSHD_QFD=JC1.JBJC_ID
    AND YSHD_JLD=JC2.JBJC_ID
    AND TO_CHAR(YSHX_time,'YYYYMMDD')='20030101'
    the column msgtxt of the table MV_CAPABILITIES_TABLE is :
    "the multiple instances of the same table or view" and " one or more joins present in mv".
    How can I succeed in fast refresh the above temp_mv!!!
    thanks.

    lianjun,
    When you are using Oracle9i there is a procedure which can help you setup the materialized view. If some option isn't working it gives you hint why it doesn't work.
    The procedure is dbms_mview.explain_mview.
    Take a look at the documentation how to use it. (In the Oracle9i DWH guide the package is explained.)
    Hope this helps
    With kind regards,
    Bas Roelands

  • Refreshing the Data Source View in Analysis Services

    I have added columns to the SQL Database table that is used as a dimension in an Analysis Services Cube.  The new columns will be used as additional Property Fields for the dimension.  When I attempted to refresh the Data Source view so that the additional columns are present, I am given the following error:
    System.Data
    Property not accessible because 'Parent Columns and Child Columns don't have type-matching columns'
    I have done nothing to the columns used for the parent of child and the error message provides nothing to gon on. Does anyone have any ideas on this?
    Gary

    Olga,
    Thanks for your response.  I will try and answer your questions
    1) I have not tried removing the columns yet.  I will try that this afternoon but have limited hope.  The two columns I added are simple text columns that will be used as attributes in the dimension.  I have made no change to the parent or child columns.
    2) The table I modified is the source table for a parent-child dimension.
    3) The reference to the "check list" does not take me to any kind of check list.
    4) The parent-child dimensions I am trying to modify have been in use for months and the parent and child columns do have the dame data types.
    5) I have also check the data types between the dimension table and the fact table.  they use the same data types (small int).
    6) I have not made a collection for the parent key, it is a single column. The remainder of your last paragraph is not clear to me. Can you give me an example.
    I am fairly inexperienced with Analysis Services, please talk slow and use small words  :-)
    Thanks again for your help!
    Gary

  • Visio Diagram is not refreshing the data from list

    Hi,
    I made a pivot diagram in visio 2013 and linked it with SharePoint 2013 list. I configured the Visio services, uploaded it document library. I can view the diagram in browser but it is not automatically refreshing not even by pressing the "Refresh"
    button.
    Instead i have to open it in visio, refresh the diagram manually and the save it in SP document library to refresh the diagram.
    I am using visio web access to view the diagram and also the auto-refresh is enable. 

    Hi Rizwan,
    Following url's might help you.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/79476e70-51cf-412a-aac9-ebb10e82572f/2010-visio-services-data-refresh-issue
    http://social.technet.microsoft.com/Forums/en-US/06d53cb3-2593-4dd0-a524-356bd9720231/visio-service-data-refresh-help
    Regards  Roy Joyson
    Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.
    Roy Joyson

  • Is there any way to prevent misbehaving solved by refreshing the browser?

    When I play my published Captivate 6 file in the browser (in this case Google Chrome), it sometimes gets "stuck" --- rollovers don't  work properly or buttons don't show up when they are supposed to. Sometimes I get the audio echo problem where audio from some previous slide plays on a future slide). None of these things happen during previews.
    If I refresh the browser and then continue where I left off, the problems are gone.
    What is causing this awful behavior? I am afraid I am disappointing my client, which I never want to do and have never done in the past!  We will have to publish instructions telling people that if anything goes wrong, they should just refresh their browsers. But some may not know how to do that, some may not read the instructions, etc. etc. causing support calls to my client and general dissatisfaction with the training.
    Is this just a shoddy product or did I not do something I need to do to get it to behave itself?
    Please advise! Thank you,
    Ellen

    hmm the a64 is locked so you cannot use a cpu multipier to have only cpu go faster..
    i oc with the fsb....but noticed that i may actually be over running my power, at high oc's(233)  if i unplug at least 3 hard drives, and some fans it will run microsofts memmory tester...but not with them in.
    you may be able to oc if you drop your mem speed down in bios to 333 or 200.
    so when you oc the memm will clib from there...i have seen good results from that.
    one person was able to catch my 232 results from dropping down to 200 mem speeds.

Maybe you are looking for

  • Service contract ITEM extractor

    Hello, I found the following extractors: 0CRM_SRV_CONTRACT_H: CRM Service - Contract Header Data 0CRM_SALES_CONTR_I: Sales Contract Item The first one gives the SERVICE contract header data, whereas the second one gives the SALES contract item data.

  • 3.1 Stacked bar chart shows no color by default - Override possible?

    I noticed in Studio 3.1, stacked bar charts show no color by default. I also read in the documentation that this is the default behavior: "The chart is initially displayed with no color dimension selected. End users can then select a color dimension.

  • Satellite L850-1HP unable to configure downloaded Windows Update files

    My laptop had issues from day one which were first the CD-ROM not opening, then the webcam and microphone turning off forever and not being able to be turned on again ever, and last but not least, this summer, my laptop would not connect to any WIFI

  • Looking for an advice

    Hello, my name is Tom. I bought three other producers webcams, looking for one, which I could fully control from my applications. Especially, I would like to control camera's gain and exposure time (shutter speed) at runtime. That means - NOT through

  • Disabling AD

    I want to convert my server from active director to just a file server, but all of the AD options are grayed out. Can I disable this option without starting over?