No scrolling of leaves in a JTree

I have a JTree in a JScrollpane. There is one main node and three nodes under this (with leaves when you expand them). When I resize the window, so that only the tree nodes are visible, there IS scrolling. But when I expand a node with all its leaves, no scrolling is available. The list of leaves is longer than the frame itself, but yet, there is no scrolling. It seems that the leaves are invisible for the scrollpane, but that it can 'see' the nodes...
Can anybody please tell me what I have forgotten to do?

can you change the height to 100% and see whether you have the same issue

Similar Messages

  • Scroll bar hides bottom of JTree

    I have a dialog with a JTree in a JScrollPane and it's possible to have the dialog at just the right size that the scroll pane becomes confused. Both scroll bars are displayed and when I try to scroll down to the bottom of the tree, the scroll pane keeps resetting itself so that the horizontal scroll bar covers the bottom of the tree. If I want to see the bottom of the trr, I must resize the dialog. I looked in the bug database but didn't find anything similar to this problem.
    Ken

    It's not that the vertical scrollbar is the wrong size. It's that the VSB's thumb won't stay all the way at the bottom. Instead, it springs back to a position approx. halfway. The problem occurs when there's enough text in a tree entry to force the display of the HSB and the VSB's thumb is all the way at the bottom. I can't include a screen shot here as the boss doesn't want to have to mess with proprietary info and non-disclosure agreements, so I hope the description I gave is sufficient.

  • About a JTree of mixed String and JLabel leafs

    Dear Java and Swing freaks,
    Why do I get the text code instead of the expected JLabel in the leaves of my JTree ?
    I want to construct a Jtree in which each tree leaf is made of a JLabel (displaying an amount and with a coloured background), followed by a normal String (the label of this amount).
    An array (of arrays) of Ojects describes the tree that I want to display in a Swing JPanel of Container, as in the "2.1 Simple JTREE Example" at URL
    http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JTree.html
    So, using the "DefaultMutableTreeNode" class and a "private DefaultMutableTreeNode processHierarchy(Object[] hierarchy)" re-entering function.
    Either the 'nodeSpecifier' is of type 'new Object[]', and the 'processHierarchy()' interpretes it as a new node,
    Or the 'nodeSpecifier' is of type 'JLabel' (or 'String'), and the 'processHierarchy()' has to interprete it as a new leaf.
    Of course, 'JLabel', as 'String', is also a subclass of 'Object'.
            BigDecimal TotalDistrNetBeh1= 1.11;
            Object[] hi�rarchie =
            { "Blablabla",
              new Object[]
              { "Bloc de compteurs",
                new Object[] { "Total1" + " : The 1st listed item = The title of this node",
                                     new JLabel(TotalDistrNetBeh1.toPlainString()),
                       /* + "DistrNetBeh1" */
                                     new JLabel(" 2.22")
                       /* + "DistrNetBeh2" */
                new Object[] { "Total2" + " : Title of this node",
                                     new JLabel("Total Bijdrage Herniewbare energie"),
                   /* Test : Leaf of type 'String' mixed with leaves of type 'JLabel'.
                                     "Total Opties : French and Dutch",
                                     "<html>Total Bijdrage <font color=red>WarmteKrachtKoppeling</font></html>",
                                     TotalDistrNetBeh1.toPlainString() + "Test1",
                                     new JLabel("<html>Total <font color=blue>Test2</font></html>")
            };In the displayed tree, rows with JPanel appear like this :
    javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=8388608,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,horizontalAlignment=LEADING,horizontalTextPosition=TRAILING,iconTextGap=4,labelFor=,text= 2.22,verticalAlignment=CENTER,verticalTextPosition=CENTER]
    <b>instead of simply " 2.22"</b>, as if there is a hiden (java.lang.String) casting. Why ?
    Nevertheless, the 'nodeSpecifier' argument in
            else
              child = new DefaultMutableTreeNode(nodeSpecifier); // Leafis casted to (javax.swing.JLabel)
    and 'child' and 'node' - both of 'Object' type - seem to be casted to (javax.swing.tree.DefaultMutableTreeNode)
    For memo :
        private DefaultMutableTreeNode constructHi�rarch(Object[] hi�rarchie)
        { DefaultMutableTreeNode node = new DefaultMutableTreeNode(hi�rarchie[0]);
          DefaultMutableTreeNode child;
          for(int i=1; i<hi�rarchie.length; i++)
          { Object nodeSpecifier = hi�rarchie;
    if (nodeSpecifier instanceof Object[]) // Node with children
    // Re-entering the function
    child = constructHi�rarch((Object[])nodeSpecifier);
    else
    child = new DefaultMutableTreeNode(nodeSpecifier); // Leaf
    node.add(child);
    return(node);
    Is it "DefaultMutableTreeNode(nodeSpecifier)" or "add(child)" that cannot operate properly with a argument of type 'JLabel' ?
    How to solve it ?
    Sorry, I'm a beginner in Java and Swing.
    Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Learn to properly use a TreeCellRenderer
    You never need to add a Component to a JTree, ie JLabel. You add the data, like a String, and then render the component you want to appear. Already, the String you have in your JTree are being rendered using JLabels, with a White Background. Hence, you need to provide a custom renderer that allows you to display different coloured rows depending on your condition or requirements.
    Read a little more on the TreeCellRenderer here: http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    ICE

  • Horizontally centering flash .swf" and disallowing horizontal scroll??

    Is it possible to center a flash .swf file on a website, and then disable horizontal scrolling?
    I made my website in Flash Catalyst, and I made the width 1700px and the height 1200px. I made the width large because I wanted it to look good in the largest screen resolutions, but my biggest problem now that I've finished making the website is putting it up. Simply embedding it makes it scroll horizontally all the way to 1700px, which isn't good for those with small browsers.
    Originally, I was planning on making the flash file the background in CSS (using body {background: url(FILE.swf) no-repeat #000 top center}) but then I found out you can't put .swf's as backgrounds.
    Basically, I want to know if it's possible to center the .swf horizontally, and then disallow horizontal scrolling. I want to keep vertical scrolling,
    Any help appreciated!

    Is it possible to center a flash .swf file on a website, and then disable horizontal scrolling?
    Yes, but it introduces other problems. With scrolling disabled, you might not be able to see all the page. I DO NOT recommend what you are trying to do. Flash scaling would most likely give you better results.
    Background images if intended to cover a large area are typically very small images which are repeated to create a pattern. Using one large image will still never cover all the possible screen resolutions or page sizes... for example larger than 1700 or taller than 1200 pixels.
    Centering requires a set dimension, like 1700 so auto set margins would center it, but it still may not cover 100% as using a width of 100% would.
    That being said, turn off horizontal scroll and leave vert on with:
    overflow-y: auto !important;
    overflow-x: hidden !important
    then you'll need to use z-indexing to lay anything else over the top of you background .swf
    Here a sample page that should get you going... dimensions are smaller so you can see how it works... the principle is the same.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>No Scroll</title>
    <style type="text/css">
    <!--
    body, html {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    overflow-y: auto !important;
    overflow-x: hidden !important
    #main_container {
    position: relative;
    width: 800px;
    height:800px;
    background-color:#ff0000;
    border:none;
    padding: 0px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    #flash {
    position: relative;
    width: 800px;
    height:600px;
    background-color:#cccccc;
    border:none;
    padding: 0px;
    margin-left: auto;
    margin-right: auto;
    z-index: 2;
    #content {
    position: relative;
    top:-600px;
    width: 400px;
    height:300px;
    background-color:#00ff00;
    border:none;
    padding: 0px;
    margin-left: auto;
    margin-right: auto;
    overflow: auto;
    z-index: 5;
    -->
    </style>
    </head>
    <body>
    <div id="main_container">
    <div id="flash">
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600" id="overflow" align="middle">
      <param name="allowScriptAccess" value="sameDomain" />
      <param name="movie" value="overflow.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffff00" /><embed src="overflow.swf" quality="high" bgcolor="#ffff00" width="800" height="600" name="overflow" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
      </object>
    </div>
    <div id="content">
    <p align="center">This is the center</p>
    </div>
    </div>
    </body>
    </html>
    Best of luck!
    Adninjastrator

  • Any component as leaf for JTree problems

    hi,
    I'm trying to get arbitary components as leaves in a JTree and it looks like its very nearly there, but there are two (related?) problems.
    1) If you click around on the top 3 tree components then it gets stuck in a loop of rendering and causes a stack exception to be thrown.
    2) For the embedded JTree component, expanding its nodes doesn't update the parent tree
    both may be because current the row height is set at the wrong time (in the TreeCellRenderer)
    any help would be really appreciated!
    thanks,
    asjf
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import java.util.*;
    public class ComponentTree
         public static void main(String args[])
              try{(new UIManager()).setLookAndFeel((new UIManager()).getSystemLookAndFeelClassName());}
              catch(Exception e){}
              DefaultMutableTreeNode c0 = new DefaultMutableTreeNode(new JButton("root"));
              DefaultMutableTreeNode c1 = new DefaultMutableTreeNode(new JButton("c1"));
              DefaultMutableTreeNode c2 = new DefaultMutableTreeNode(new JList(new Object [] {"A","B","C"}));
              DefaultMutableTreeNode c3 = new DefaultMutableTreeNode(new JTable(new Object [][] {{"Active","true"},{"User","root"}}, new Object [] {"Name","Value"}));
              DefaultMutableTreeNode c4 = new DefaultMutableTreeNode(new JTree());
              DefaultMutableTreeNode c5 = new DefaultMutableTreeNode(new JList(new Object [] {"D","E","F"}));
              DefaultMutableTreeNode c6 = new DefaultMutableTreeNode(new JCheckBox("Active",true));
              DefaultTreeModel dtm = new DefaultTreeModel(c0);
                   dtm.insertNodeInto(c6,c0,0);
                   dtm.insertNodeInto(c1,c0,0);
                   dtm.insertNodeInto(c2,c0,0);
                   dtm.insertNodeInto(c5,c2,0);
                   dtm.insertNodeInto(c3,c1,0);
                   dtm.insertNodeInto(c4,c3,0);
              JTree tree = new JTree(dtm);
                   tree.setEditable(true);
                   tree.setCellRenderer(new DefaultTreeCellRenderer()
                        public Component getTreeCellRendererComponent(     JTree tree,     Object value, boolean isSelected, boolean expanded, boolean leaf, int row, boolean hasFocus)
                             System.out.println("Render row "+row);
                             Component c = (Component) ((DefaultMutableTreeNode) value).getUserObject();
                             if(c instanceof JCheckBox)
                                  c.setBackground(UIManager.getColor("Tree.textBackground"));
                             tree.setRowHeight(c.getHeight());                    
                             return c;     
                   tree.setCellEditor(new DefaultTreeCellEditor(tree,(DefaultTreeCellRenderer)tree.getCellRenderer())
                        public boolean isCellEditable(EventObject evt){return true;}
                        public Component getTreeCellEditorComponent(     JTree tree,     Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
                             return (Component) ((DefaultMutableTreeNode) value).getUserObject();
              JFrame frame = new JFrame("ComponentTree");
                   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   frame.getContentPane().add(tree);     
                   frame.pack();
                   frame.show();
    }

    thanks!
    this seems an awful lot of code to get this working - it should be possible to have a single CellEditor/Renderer??
    also running the code - its very hard to select checkbox items, and the JLists seem to disable themselves when the main tree updates?
    its also not general to any Component (?) (although we probably only want JComponent) so we can't add a JTree as a leaf?
    I'm guessing there is a simpler way to get this working?

  • JTree Icon question

    Currently, ALL leaves in the JTree are displayed with a certain icon that looks like a piece of paper. What should I do if I want only leaves at depth 4 to have the piece of paper icon and all the rest to have folder icons even if they are leaves?
    Thanks

    I guess a custom renderer is in order.
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display

  • Amplitube Hoizontal Scrolling Issue

    Amplitube Free. Horizontal scroll bar at top can be pulled to the left but will not stay. Two items off screen are no longer available... songs, and add

    10 September 2010
    I have a Dell xps studio 8100 with inteli7 OS and using the latest version of iTunes
    I have been experiencing scrolling problems in library of iTunes only the bottom 3 lines change when scrolling down and only the top 3 lines change when scrolling up leaving the middle of list static.
    This scrolling issue is only evident in iTunes library I can page down and I can change mouse wheel settings to compensate but this will result in problems in other programs and browser, the normal wheel setting of 3 runs perfectly in all other situations and other programs and browsers, the problem only associated with iTunes Library.
    I have tried uninstalling and reinstalling iTunes to no avail, I have also disabled multi screen function no change.
    I have searched through a lot of forums and note others have similar problems but as yet no fixes that help my situation.
    Any help or guidance would be welcome
    Regards Alan Hawkins

  • JTree not Updating - please help

    I am totally perplexed.
    I created a pretty standard implmentation of a JTree, utilizing the DefaultTreeModel, DefaultMutableTreeNodes, etc. The JTree is contained in a JScrollPane. The tree displays a string value that is one of the properties of the UserObject of the node, for which purpose I created my own subclass renderer and an editor. A JButton causes a new node to be added to the root node. All was working fine, until...
    I put the JTree and the TreeModel in a new class, along with the method to populate it. I created a method that passes a handle to the JTree ("getTree()") which I use to instantiate the JScrollPane ("new JScrollPane(tree)"). Now when I add a node to the root, it doesn't display!
    I have tried "tree.revalidate()", "tree.updateUI()", "scrollpane.revalidate()", "tree.repaint()", "dialog.repaint()" all to no avail. If I close the dialog and reopen it, everything displays fine.
    Can anyone tell me what I'm doing wrong?
    Thanks very much...

    Here are the two classes. Your help is greatly appreciated.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    import java.util.*;
    public class CategoryMaintFrame extends AnyInternalFrame {
    private JDesktopPane desktop;
    private JFrame parentFrame;
    // CENTER
    private JScrollPane scroller;
    private CategTree categTree;
    private JTree cTree;
    private DefaultTreeModel theModel;
    // SOUTH
    private JPanel buttonPanel;
    private JButton addRootButton;
    private JButton cancelButton;
    private JButton okButton;
    private ActionListener al;
    // OTHER PROPERTIES
    private Project theProject;
    private AllCategories theCategs;
    private DefaultMutableTreeNode theRoot;
    private CategoryPopUp popUpMenu;
    // CONSTRUCTOR
    public CategoryMaintFrame(JDesktopPane pane, AllCategories categs, Project proj) {
    super("Global and Project-Specific Categories");
    desktop = pane;
    parentFrame = (JFrame) pane.getParent().getParent().getParent();
    theCategs = categs;
    theProject = proj;
    this.getContentPane().setLayout(new BorderLayout());
    buildGUI();
    setButtonListeners();
    setSize(400,300);
    addInternalFrameListener(new InternalFrameAdapter() {
    public void InternalFrameClosing(WindowEvent we) {
    CategoryMaintFrame.this.dispose();
    desktop.add(this);
    setVisible(true);
    private void buildGUI() {
    // NORTH, EAST & WEST
    JLabel fillerW = new JLabel("");
    fillerW.setPreferredSize(new Dimension(20,20));
    this.getContentPane().add(fillerW, BorderLayout.WEST);
    JLabel fillerE = new JLabel("");
    fillerE.setPreferredSize(new Dimension(20,20));
    getContentPane().add(fillerE, BorderLayout.EAST);
    JLabel fillerN = new JLabel("");
    fillerN.setPreferredSize(new Dimension(20, 20));
    getContentPane().add(fillerN, BorderLayout.NORTH);
    // CENTER: TREE
    // the Root is a non-data-based node created to root all of
    // the category trees
    theRoot = new DefaultMutableTreeNode("theRoot");
    categTree = new CategTree(theCategs, theProject);
    cTree = categTree.getTree();
    cTree.setEditable(true);
    cTree.setRootVisible(true);
    theModel = (DefaultTreeModel) cTree.getModel();
    scroller = new JScrollPane(categTree.getTree());
    this.getContentPane().add(scroller, BorderLayout.CENTER);
    // SOUTH: BUTTONS
    buttonPanel = new JPanel();
    addRootButton = new JButton("Add Root");
    buttonPanel.add(addRootButton);
    okButton = new JButton("Done");
    buttonPanel.add(okButton);
    getContentPane().add(buttonPanel, BorderLayout.SOUTH);
    private void setButtonListeners() {
    al = new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    if (ae.getActionCommand() == "Add Root") {              
    Category newCateg = new Category();
    newCateg.setTitle("<un-named>");
    newCateg.setProjectID(new Integer(0));
    newCateg.setProject(new Project(0));
    newCateg.setIsRoot(true);
    theCategs.addCategory(newCateg);
    DefaultMutableTreeNode newRoot = new DefaultMutableTreeNode(newCateg);
    ((DefaultTreeModel) cTree.getModel()).insertNodeInto(newRoot,
    theRoot, theRoot.getChildCount());
    theModel.reload(newRoot);
    } else if (ae.getActionCommand() == "Done") {
    CategoryMaintFrame.this.dispose();
    addRootButton.addActionListener(al);
    okButton.addActionListener(al);
    popUpMenu = new CategoryPopUp(theCategs, parentFrame, theProject);
    cTree.addMouseListener(popUpMenu);
    ((DefaultTreeModel) cTree.getModel()).addTreeModelListener(new MyTreeModelListener());
    class MyTreeModelListener implements TreeModelListener {
    public void treeNodesChanged(TreeModelEvent e) {
    System.out.println("model change detected");
    DefaultMutableTreeNode node;
    node = (DefaultMutableTreeNode)
    (e.getTreePath().getLastPathComponent());
    * If the event lists children, then the changed
    * node is the child of the node we've already
    * gotten. Otherwise, the changed node and the
    * specified node are the same.
    try {
    int index = e.getChildIndices()[0];
    node = (DefaultMutableTreeNode)
    (node.getChildAt(index));
    } catch (NullPointerException exc) {}
    Category chgdCateg = (Category) node.getUserObject();
    theCategs.changeCategory(chgdCateg);
    public void treeNodesInserted(TreeModelEvent e) {
    System.out.println("model insert detected");
    DefaultMutableTreeNode node;
    node = (DefaultMutableTreeNode) e.getTreePath().getLastPathComponent();
    if (!node.isRoot()) { // the root of the tree isn't a category; if
    // we added a node without a parent (a root category),
    // don't create a category relationship
    Category parCateg = (Category) node.getUserObject();
    try {
    int index = e.getChildIndices()[0];
    node = (DefaultMutableTreeNode) node.getChildAt(index);
    Category addCateg = (Category) node.getUserObject();
    theCategs.addCategory(addCateg);
    theCategs.addCategoryRelation(parCateg, addCateg);
    } catch (NullPointerException exc) {}
    public void treeNodesRemoved(TreeModelEvent e) { 
    System.out.println("model remove detected");
    DefaultMutableTreeNode anode, bnode;
    anode = (DefaultMutableTreeNode) e.getTreePath().getLastPathComponent();
    // get all of the children (not just immediate children) of the parent and
    // delete them
    Category delCateg;
    Vector allChildren = new Vector();
    Object[] nodeChildren = e.getChildren();
    // load the immediate children into a vector
    for (int i = 0; i < nodeChildren.length; i++) {
    anode = (DefaultMutableTreeNode) nodeChildren;
    allChildren.addElement(anode);
    boolean moreChildren = true;
    int i = 0;
    // iterate thru the vector, deleting the Categories, and adding their
    // children (if any) the end of the vector so they are likewise deleted
    while (moreChildren) {
    anode = (DefaultMutableTreeNode) allChildren.elementAt(i);
    delCateg = (Category) anode.getUserObject();
    // get this node's children, and store then in the vector
    Enumeration en = anode.children();
    while(en.hasMoreElements()) {
    bnode = (DefaultMutableTreeNode) en.nextElement();
    allChildren.addElement(bnode);
    theCategs.removeCategoryRelation(delCateg, (Category) bnode.getUserObject());
    // delete it from the collection and the database
    theCategs.deleteCategory(delCateg);
    delCateg = null;
    anode = null;
    i++;
    if (i >= allChildren.size())
    moreChildren = false;
    public void treeStructureChanged(TreeModelEvent e) {
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.util.*;
    public class CategTree {
    private JTree cTree;
    private DefaultTreeModel theModel;
    private Project theProject;
    private AllCategories theCategs;
    private DefaultMutableTreeNode theRoot;
    // CONSTRUCTOR
    public CategTree(AllCategories categs, Project proj) {
    super();
    theCategs = categs;
    theProject = proj;
    // the Root is a non-data-based node created to root all of
    // the category trees
    theRoot = new DefaultMutableTreeNode("theRoot");
    theModel = new DefaultTreeModel(theRoot);
    cTree = new JTree(theModel);
    CategoryNodeRenderer cnr = new CategoryNodeRenderer();
    cnr.setPreferredSize(new Dimension(200,20));
    cTree.setCellRenderer(cnr);
    cTree.setCellEditor(new CategoryNodeEditor(cTree, cnr, theCategs));
    cTree.setEditable(false);
    cTree.setRootVisible(false);
    cTree.setExpandsSelectedPaths(true);
    cTree.setScrollsOnExpand(true);
    cTree.setShowsRootHandles(true);
    cTree.setToggleClickCount(0);
    cTree.setVisibleRowCount(20);
    initializeTreeModel();
    public DefaultTreeModel getTreeModel() {
    return theModel;
    public JTree getTree() {
    return cTree;
    public DefaultMutableTreeNode getRootNode() {
    return theRoot;
    public void initializeTreeModel() {
    Vector allNodes = new Vector();
    // insert all of the root categories in the root of the tree and
    // store a ref to the node in a vector
    Vector allRoots = theCategs.getAllRoots(theProject);
    for (int i = 0; i < allRoots.size(); i++) {
    Category nextRoot = (Category) allRoots.elementAt(i);
    DefaultMutableTreeNode nextNode = new DefaultMutableTreeNode(nextRoot);
    theModel.insertNodeInto(nextNode, theRoot, theRoot.getChildCount());
    allNodes.addElement(nextNode);
    // now insert the children of each node in the vector in the tree, and store
    // it in the vector, incrementing to the end of the vector
    // int totalNodes = theCategs.getCategoryCount();
    boolean moreNodes = allNodes.size() > 0? true : false;
    int i = 0;
    while (moreNodes) {
    DefaultMutableTreeNode nextParent = (DefaultMutableTreeNode) allNodes.elementAt(i);
    Category parentCateg = (Category) nextParent.getUserObject();
    Vector children = theCategs.getParentsChildren(parentCateg, theProject);
    for (int j = 0; j < children.size(); j++) {
    Category nextChild = (Category) children.elementAt(j);
    DefaultMutableTreeNode nextNode = new DefaultMutableTreeNode(nextChild);
    theModel.insertNodeInto(nextNode, nextParent, nextParent.getChildCount());
    allNodes.addElement(nextNode);
    i++;
    if (i >= allNodes.size())
    moreNodes = false;
    theModel.reload();
    public void expandAllPaths() {
    Enumeration e= theRoot.depthFirstEnumeration();
    while (e.hasMoreElements()) {
    DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.nextElement();
    cTree.makeVisible(new TreePath(node.getPath()));

  • T440 scrolling issue

    Hey everyone, 
    I have a T440 and I have noticed that sometimes when I am two finger scrolling it will cause the screen to jump upwards (I am using reverse-Y axis scrolling; when it is non-reversed it causes it to jump down). It seems to do this at random - no matter if I scroll fast or slowly it will do the jump, maybe 30% of the time. I have installed all hardware updates, and everything else is up to date, so I am not sure what it could be/what else I could do to solve it. 
    Any help would be great
    Thanks,

    10 September 2010
    I have a Dell xps studio 8100 with inteli7 OS and using the latest version of iTunes
    I have been experiencing scrolling problems in library of iTunes only the bottom 3 lines change when scrolling down and only the top 3 lines change when scrolling up leaving the middle of list static.
    This scrolling issue is only evident in iTunes library I can page down and I can change mouse wheel settings to compensate but this will result in problems in other programs and browser, the normal wheel setting of 3 runs perfectly in all other situations and other programs and browsers, the problem only associated with iTunes Library.
    I have tried uninstalling and reinstalling iTunes to no avail, I have also disabled multi screen function no change.
    I have searched through a lot of forums and note others have similar problems but as yet no fixes that help my situation.
    Any help or guidance would be welcome
    Regards Alan Hawkins

  • JTextArea is making cells bigger with TableLayout

    I've added a JTextArea onto a JPanel which has TableLayout as its layout manager. I've attached a JScrollPane onto the JTextArea.
    Im trying to make the scroll pane do its job when the text becomes too much for the cells' allocation for the JTextArea. Right now its just making the cells bigger which forces the whole GUI to scroll downwards (or sideways) as opposed to just the JTextArea scrolling and leaving the cell sizes the same.
    Hope im making sense.
    Any ideas?

    Hi,
    sure that the size of the corresponding column and row was set to TableLayout.FILL (you specify this by calling the constructor of TableLayout)? I have got the same effect if I had set the size to TableLayout.PREFERRED ...

  • Changing elements in a JScrollPane

    Hi all,
    I was wondering, is it possible to change the elements inside a JScrollPane. That is, say I had two buttons A and B. If I press button A, I would like the JScrollPane to display a JLabel in it, but If I press button B, I would like the scroll pane to display a JTree in it. All using the same scroll pane of course. Is this sort of functionality possible?
    Thanks in advance.

    scrollPane.getViewport().setView(...);

  • Lumia 800 - Strange UI Behavior after Touch!!!

    When moving my finger horizontally or vertically (more noticeable when vertically scrolling) and leaving my finger on the screen after the move, the UI begins to shake up and down or side to side depending on whether I moved the UI vertically or horizontally. I found this when playing assassins creed first, the virtual joy stick under my thumb was moving on its own when my thumb was still. Trying this on the start screen by scrolling up or down a little and leaving my finger on the screen presented me with the UI moving on its own.
    This is quite frustrating especially in game that require me to leave my finger/thumb on the screen. This behavior is noticeable in all elements for me, menus, internet browser, all hubs and so on. If you want to try it on your devices let me know if you have experienced the same thing. Remember just go to the start screen, scroll up or down slightly and don't take your finger off the screen, after a second or two the UI may start moving on its own like it does with me.
    If there is anyway to reset the screen calibration through diagnostics apps or anything let me know please.
    I have uploaded a video, its pretty poor quality but if you watch the calendar tile whilst I keep my finger still you will see how the UI moves on its own. More noticeable when you see it in person. http://youtu.be/vaJGcN7UfoE

    It doesn't do that on mine Lumia, and I have put mine of my desk keeping my fingers steady after scrolling. Usually capacitive screens, and especially amoled ones are quite sensitive, and from looking at your video where you hold the phone in one hand up in front of cam and touches it with your other hand while the device is shaking like crazy doesn't make it easy to actually know if it's your or the device.
    I guess you of course have done this already, but if not lay it down on a desk or table. Hold it tight with one hand and do the scrolling with your other hand. Then make sure the phone is dead still and so with your finger. Does it still do it?
    I haven't found a setting or way to calibrate the screen. And it might only be my ignorance, but I haven't seen any setting or so regarding calibrating screen on any on my previous devices - I guess I have had 6-8 phones with capacitive displays.
    I know that at least some of the s60 Nokia devices with resistive screen had it, but that's something else.

  • Many of my photos appear briefly as I scroll down the page then disappear leaving a box outlined with a broken-line.  The menu bar says that I have 300 pictures hidden, but I am unable to get them unhidden.

    I am experiencing difficulty with iPhoto '11.  Some of more recent photos can not be accessed.  As I scroll down the page of photos, the most recent ones appear briefly, then disappear to be replaced with a box outlined by a broken-line.  The menu bar says that I have 317 photos hidden.  Hiding photos is not something that I normally do, can't imagine why these are hidden.  Anyway, when I try to unhide the photos, I can view them as an event, but if I click on a single photo, or try to move it into an album, the photo does not display.  Instead I get a dark exclamation point within a triangle.  Another problem with these same photos is on the event page there is no key photo for these events only a dark screen.  I can't find an answer to my problem.  Has anyone experienced this?  What is the problem and how can I correct it?  

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Scroll bar hidden by Jtree.setPreferredSize()

    After a lot investigation, I have found that using the method setPreferredSize() for a JTree object has a strange side effect. In fact the vertical Scroll bar does not display.
    In the following program, all works fine because the setPreferredSize() is commented out. Now if you get rid of the // in front of this line, then you will notice the the scroll bar has disappeared.
    any idea ? Thanks. Here is my code.
    import java.util.*;
    import javax.swing.tree.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestSplit extends JFrame {
         private JPanel JFrameContentPane = null;
         private JPanel JPanel1 = null;
         private JScrollPane JScrollPane1 = null;
         private JSplitPane JSplitPane1 = null;
         private JTree JTree1 = null;
         private JTree JTree2 = null;
         private DefaultMutableTreeNode top =null;
         private DefaultTreeModel tM =null;
    public TestSplit() {
         super();
         initialize();
    public TestSplit(String title) {
         super(title);
         initialize();
    private javax.swing.JPanel getJFrameContentPane() {
         if (JFrameContentPane == null) {
              try {
                   JFrameContentPane = new javax.swing.JPanel();
                   JFrameContentPane.setName("JFrameContentPane");
                   JFrameContentPane.setLayout(null);
                   getJFrameContentPane().add(getJSplitPane1(), getJSplitPane1().getName());
              } catch (java.lang.Throwable Exc) {}
         return JFrameContentPane;
    private javax.swing.JPanel getJPanel1() {
         if (JPanel1 == null) {
              try {
                   JPanel1 = new javax.swing.JPanel();
                   JPanel1.setName("JPanel1");
                   JPanel1.setLayout(null);
                   getJPanel1().add(getJTree2(), getJTree2().getName());
              } catch (java.lang.Throwable Exc) {}
         return JPanel1;
    private javax.swing.JScrollPane getJScrollPane1() {
         if (JScrollPane1 == null) {
              try {
                   JScrollPane1 = new javax.swing.JScrollPane();
                   JScrollPane1.setName("JScrollPane1");
                   JScrollPane1.setMinimumSize(new java.awt.Dimension(70, 22));
                   getJScrollPane1().setViewportView(getJTree1());
              } catch (java.lang.Throwable Exc) {}
         return JScrollPane1;
    private javax.swing.JSplitPane getJSplitPane1() {
         if (JSplitPane1 == null) {
              try {
                   JSplitPane1 = new javax.swing.JSplitPane(javax.swing.JSplitPane.HORIZONTAL_SPLIT);
                   JSplitPane1.setName("JSplitPane1");
                   JSplitPane1.setBounds(91, 8, 213, 251);
                   JSplitPane1.setDividerLocation(100);
                   getJSplitPane1().add(getJScrollPane1(), "left");
                   getJSplitPane1().add(getJPanel1(), "right");
              } catch (java.lang.Throwable Exc) {}
         return JSplitPane1;
    private javax.swing.JTree getJTree1() {
         if (JTree1 == null) {
              try {
                   JTree1 = new javax.swing.JTree();
                   JTree1.setName("JTree1");
                   JTree1.setModel(tM);
                   // JTree1.setPreferredSize(new java.awt.Dimension(78, 72));
                   JTree1.setBounds(0, 0, 78, 72);
              } catch (java.lang.Throwable Exc) {}
         return JTree1;
    private javax.swing.JTree getJTree2() {
         if (JTree2 == null) {
              try {
                   JTree2 = new javax.swing.JTree();
                   JTree2.setName("JTree2");
                   JTree2.setBounds(8, 6, 91, 235);
              } catch (java.lang.Throwable Exc) {}
         return JTree2;
    private void initialize() {
         try {
              try
                   top = new DefaultMutableTreeNode("Liste des adh�rents");
                   DefaultMutableTreeNode membre = null;
                   for (int i=1;i<50; i++)
                   {membre = new DefaultMutableTreeNode("Ligne #" + i);top.add(membre);}
                   tM = new DefaultTreeModel(top);
              catch (Exception ex) {ex.printStackTrace();System.exit(0); }setName("TestSplit");
              setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
              setSize(523, 328);
              setContentPane(getJFrameContentPane());
         } catch (java.lang.Throwable Exc) {}
    public static void main(java.lang.String[] args) {
    try {UIManager.setLookAndFeel ("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");}
    catch (Exception e) {} // Can't change look and feel}
    TestSplit f = new TestSplit("ScollTest with a tree");
    f.addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e) {System.exit(0);}});
    f.setVisible(true);

    For what it is worth -- I've observed this on my project, too.
    I just setPreferredSize on the JScrollPane that held the JTree, rather than on the JTree itself.

  • JTree in JScrollPane doesn't scroll

    I have a JTree in a JScrollPane that doesn't scroll.
    Background: it used to!
    History: I moved the creation of the JTree to inside an Object that returns it with a ".getTree()" method. Since then, it hasn't been scrolling. I even set the JScrollPane to always have scrollbars and they just sit there inactive.
    Does anyone know what this would happen and/or how to fix it?
    thanks.

    That actaully worked, but it was way to big. I'm not sure what I did, but I changed the values to Studio ONE's defaults and now it works ok.

Maybe you are looking for

  • Can I delete the previous backups from iCloud on my iPhone 5?

    I just got My iPhone 5 as well as a iPad 4. But I purchased the wrong iPad - before I returned the first one it backed itself up with iCloud and as we'll as the info from my iPhone 4S. It shows that I'm out of storage space but when I go to manage my

  • Network user access to local disk to solve I/O throughput issue?

    Not sure if this is the best forum for this, but... THE ISSUE: I work at a small university and am responsible for the Mac network and video dept (only 1 xserve and about 20-odd clients). Anyway, everyone uses network accounts. I have 3 iMacs for Fin

  • HTML Code for Smart Link Edit and Logout items

    I am using an HTML template and would like to include the Smart Link Edit and Logout items in a TABLE. How do I do this? Is there a way to get the code for these Smart Links (ORACLE tags) and include them?

  • BI - Administration Cockpit

    Hi 1)Can BI Admin Cockpit be used with NW2004s 3.x methodology (I mean we are on NW2004s SP-10 however we have used 3.x methodology for all cubes/queries and no DTP or transformations) 2)Can BI Admin cockpit be configured  directly in production or t

  • Error when install game

    On my new N79, I can see the demo games in faint. When I click on one I get message 'Unable to install game (Error - 1)'. Do I need to do something first? Thanks