Scrollbars don't adapt after repopulating tree model

Hello there,
I already post this question in the java programming forum since I didn't notice that the swing forum is here...
I designed a JFrame with Netbeans 6.1 having a JTree in a JScrollPane. The scrollbars work fine after initialization but when I remove and add nodes into the tree's model the scrollbars don't adapt. For instance when I expand all nodes I cannot scroll to the bottom leaf.
I tried to add and remove the nodes in two different ways:
* With add() and removeAll() from DefaultMutableTreeNode;
* With insertNodeInto() and removeNodeFrom from DefaultTreeModel
Both ways have the same result...
I guess I have to do something after I repopulate the model but I cannot figure out what.
Can anyone help?
Thanks,
Bart.

This works for me:
package tree;
* TreePopulateDemo.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
public class TreePopulateDemo extends JFrame {
    private DefaultTreeModel model;
    private JButton btInsert;
    private JButton btRemove;
    private JScrollPane jScrollPane1;
    private JToolBar jToolBar1;
    private JTree jTree1;
    public TreePopulateDemo() {
        super("TreePopulateDemo");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setSize(250, 150);
        setLocationRelativeTo(null);
        jScrollPane1 = new JScrollPane();
        jTree1 = new JTree();
        jToolBar1 = new JToolBar();
        btRemove = new JButton();
        btInsert = new JButton();
        jScrollPane1.setViewportView(jTree1);
        getContentPane().add(jScrollPane1, BorderLayout.CENTER);
        jToolBar1.setRollover(true);
        btRemove.setText("Remove");
        btRemove.setFocusable(false);
        btRemove.setHorizontalTextPosition(SwingConstants.CENTER);
        btRemove.setVerticalTextPosition(SwingConstants.BOTTOM);
        btRemove.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent evt) {
                MutableTreeNode node = getSelectedNode();
                if (node != null) {
                    model.removeNodeFromParent(node);
        jToolBar1.add(btRemove);
        btInsert.setText("Insert");
        btInsert.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent evt) {
                MutableTreeNode parent = getSelectedNode();
                if (parent != null) {
                    DefaultMutableTreeNode newChild = new DefaultMutableTreeNode("Test");
                    model.insertNodeInto(newChild, parent, parent.getChildCount());
        jToolBar1.add(btInsert);
        getContentPane().add(jToolBar1, BorderLayout.PAGE_START);
        model = (DefaultTreeModel) jTree1.getModel();
    private MutableTreeNode getSelectedNode() {
        MutableTreeNode node = (MutableTreeNode) jTree1.getLastSelectedPathComponent();
        if(node == null){
            JOptionPane.showMessageDialog(this, "Please select a node");
        return node;
    public static void main(final String args[]) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TreePopulateDemo().setVisible(true);
}

Similar Messages

  • JTree - with two tree Models

    I have two types of tree Models that I would like to combine into one tree i did the combination this way:
    public CombainedTreeModel(BaseTreeModel firstSubTree,BaseTreeModel secondSubTree) {
    super(null);
    BaseTreeNode root=new BaseTreeNode("root");
    insertNodeInto(firstSubTree.getTreeRoot(),root,GuiConstants.INDEX_ZERO);
    insertNodeInto(secondSubTree.getTreeRoot(),root,GuiConstants.INDEX_ONE);
    and used the combined model (that is extends of BaseTreeModel -> DefaultTreeModel.) as the input of the tree.
    I see that there are elements in the tree but they are not visible.....
    what is the problem?

    I had a bit different interpertation for the MVC in swing:
    model - is a pure java class holds the data
    control- the treeModel that pass the commands to the model and after the comand was done - remove/add/update node from the tree and commite reload so the view will be refreshed
    view - the Jtree
    Everything in this model used to be ok until i combined two tree model to a third model so they will be displayed together.
    this is how I remove a node:
    public void removeContentServer(int contentServerId) throws BitBandGuiRemoveException, BitBandGuiFindException {
    if (logger.isDebugEnabled())
    logger.debug("ContentTreeModel.removeContentServer");
    BaseContentTreeNode contentServerNode = getContentServerNode(contentServerId);
    networkModel.removeContentServer(contentServerId);
    contentServerNode.removeFromParent();
    if (logger.isDebugEnabled()) {
    logger.debug("remove content server from the model" + contentServerId);
    synchronized (contentServerNode) {
    contentServerNode.removeFromParent();
    if (logger.isDebugEnabled()) {
    logger.debug("remove content server from the tree model");
    reload(root);
    }

  • Tree Model Implementation

    Hi All,
    I'm need to create a JATO tree implementation and need some advice. I
    want to modify the JATO sample tree implementation so that:
    1) The model is cached within the user's session.
    2) The model is created on demand. i.e. The data associated with the
    branches are only retrieved when the branches are opened.
    In the sample application E0115TreeView (view) creates a
    SimpleTreeModelImpl (model) each time it is instantiated and
    SimpleTreeModelImpl (model) creates dummy data each time it is
    instantiated.
    1) Is there a standard JATO technique for associating a model with a
    view (unlike the sample)? Does this involve the ModelTypeMapImpl class?
    My tree data is stored in LDAP, so I can't use a standard JATO database
    Model classes.
    2) The comment in the SimpleTreeModelImpl class definition indicates
    that it is normal practice to store the model in the user's session. Is
    there a standard JATO technique for doing this?
    3) What would be the best way to extend the sample so that I can create
    the model on-demand?
    Regards,
    Dennis Parrott.
    [Non-text portions of this message have been removed]

    Thanks Todd,
    That makes perfect sense.
    Regards,
    Dennis parrott.
    Todd Fast wrote:
    Hi Dennis--
    I have now added a SimpleTreeModel interface (which extends TreeModel) andhave added an
    mapping in ModelTypeMapImpl static initializer. i.e. To registerSimpleTreeModelImpl with the
    ModelManager.This is fine, but you can so without the additional interface if you want.
    You don't need to register the model in the ModelTypeMap, and you can
    instead just pass the implementation class to ModelManager.
    In the tree view constructor instead of creating the SimpleTreeModelImpleach time I use the
    ModelManager to retrieve the model, indicating that the model should bestored in the sesssion:
    public Treeview(View parent, String name) {
    super(parent, name);
    RequestContext requestContext = getRequestContext();
    ModelManager modelManager = requestContext.getModelManager();
    Class clazz = SimpleTreeModel.class;
    SimpleTreeModel simpleTreeModel =
    (SimpleTreeModel)modelManager.getModel( clazz,clazz.getName(), true, true );
    setPrimaryModel( simpleTreeModel );
    registerChildren();
    }This looks good, EXCEPT for the fact that you shouldn't be able to get the
    RequestContext at this point via the class's getRequestContext() method (it
    isn't set until after the constructor). However, you can use the static
    method RequestManager.getRequestContext() instead.
    The final bit I need to implement is the model creation on-demand.Currently the entire model
    is constructed on the first access and stored in the session. However,when model is large then
    this has a performance impact on constructing it for the first time.Instead I would like to
    construct peices of the model as the user accesses them. Any ideas?This is really a function of your model implementation. Nodes that are not
    needed in a particular rendering of a TreeModel are never accessed by the
    framework in that rendering, so you need to implement your model to lazily
    fetch sub-trees of the underlying data structure only as needed. Depending
    on the technology you are using, this may or may not be difficult.
    I suspect that right now you are fetching the entire tree data structure
    when the model is created, and this is the root of the problem. You need to
    fetch all nodes that are children of the root on the first request, then
    fetch child nodes of the next node the user expands on the next request, ad
    infinitum. Otherwise, you will have to settle for a one-time performance
    hit per session caused by retrieving the entire tree data structure at once.
    If you are using TreeModelBase as your superclass and just implementing the
    abstract methods therein, then the implementation of the firstChild() method
    is your opportunity to fetch the tree data lazily. This method will be
    called on a node to "step down" one level in the tree, and it will only be
    called for the nodes that are expanded. You should implement this method to
    figure out what node the model is on at the moment, then use that
    information to determine if you've already looked up that node's childre in
    the backend system, or if you need to go and fetch ONLY the current node's
    direct children. As the user descends through the tree, the tree will be
    fleshed out and cached lazily, one level at a time, via this mechanism.
    Does this make any sense?
    Todd
    To download the latest version of S1AF (JATO), please visit one of thefollowing locations:
    >
    Framework + IDE plugin for Sun ONE Studio 4 Update 1, Community Edition:
    http://wwws.sun.com/software/download/products/Appl_Frmwk_2.0_CE.html
    Framework + IDE pluign for Sun ONE Studio 4 Update 1, Enterprise Edition:
    http://wwws.sun.com/software/download/products/Appl_Frmwk_2.0_EE.html
    Previous versions of JATO:
    http://www.sun.com/software/download/developer/5102.html
    [Non-text portions of this message have been removed]

  • Ac adapter for hp simplesave model MD2000h

    lost or misplaced my ac adapter for hp simplesave  model MD2000h.  The external HD does not have any spec requirements written by the serial/model number.  I don't remember how the ac adapter looks like either.  Help?

    Hi Silvana,
    To find the right adapter there are a couple of ways we can do that. First, I found a link to the user guides for your external drive and from the User Manual I got support information. Their website is http://hpsupport.wdc.com and their toll free phone number is 1-866-444-7407. Try contacting them and they should be able to tell you the correct adapter.
    Link to User Guides:
    http://h10025.www1.hp.com/ewfrf/wc/manualCategory?cc=us&dlc=en&lang=en&lc=en&product=4023092&
    You can use the actual product number which you should be able find on a sticker on the external hard drive or the box it came in. If you find that product number you can order the part from HP Parts Store and I have included a link below.
    http://h20141.www2.hp.com/hpparts/
    I believe that your best option would be to contact their support.
    Thank you,
    Please click “Accept as Solution ” if you feel my post solved your issue.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Thank you,
    BHK6
    I work on behalf of HP

  • How to hide a tree node from the GUI but still keep it in the tree model?

    Hi, All
    I used a JTree in my project in which I have a DefaultTreeModel to store all the tree structure and a JTree show it on the screen. But for some reason, I want to hide some of the nodes from the user, but I don't want to remove them from the tree model because later on I still need to use them.
    I searched on the web, some people suggested method to hide the root node, but that's not appliable to my project because I want to hide some non-root nodes; Some people also suggested to collapse the parent node when there are child to hide, it is not appliable to me either, because there still some other childnodes (sibling of the node to hide) I want to show.
    How can I hide some of the tree node from the user? Thanks for any information.
    Linda

    Here's an example using a derivation of DefaultTreeModel that shows (or does not show) two types of Sneech (appologies to the good Dr Zeus) by overiding two methods on the model.
    Now, there are many things wrong with this example (using instanceof, for example), but it's pretty tight and shows one way of doing what you want.
    Note: to make it useful, you''d have to change the implementation of setShowStarBelliedSneeches() to do something more sophisticated than simply firing a structure change event on the root node. You'd want to find all the star bellied sneech nodes and call fireTreeNodesRemoved(). That way the tree would stay expanded rather than collapse as it does now.
    import javax.swing.JTree;
    import javax.swing.JScrollPane;
    import javax.swing.JOptionPane;
    import javax.swing.JCheckBox;
    import javax.swing.JPanel;
    import javax.swing.tree.TreePath;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.DefaultMutableTreeNode;
    import java.awt.Dimension;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Enumeration;
    class FilteredTree
         private class PlainBelliedSneech {
              public String toString() { return "Plain Bellied Sneech"; }
         private class StarBelliedSneech {
              public String toString() { return "Star Bellied Sneech"; }
         private class FilteredTreeModel
              extends DefaultTreeModel
              private boolean mShowStarBelliedSneeches= true;
              private DefaultMutableTreeNode mRoot;
              FilteredTreeModel(DefaultMutableTreeNode root)
                   super(root);
                   mRoot= root;
              public Object getChild(Object parent, int index)
                   DefaultMutableTreeNode node=
                        (DefaultMutableTreeNode) parent;
                   if (mShowStarBelliedSneeches)
                        return node.getChildAt(index);
                   int pos= 0;
                   for (int i= 0, cnt= 0; i< node.getChildCount(); i++) {
                        if (((DefaultMutableTreeNode) node.getChildAt(i)).getUserObject()
                                            instanceof PlainBelliedSneech)
                             if (cnt++ == index) {
                                  pos= i;
                                  break;
                   return node.getChildAt(pos);
              public int getChildCount(Object parent)
                   DefaultMutableTreeNode node=
                        (DefaultMutableTreeNode) parent;
                   if (mShowStarBelliedSneeches)
                        return node.getChildCount();
                   int childCount= 0;
                   Enumeration children= node.children();
                   while (children.hasMoreElements()) {
                        if (((DefaultMutableTreeNode) children.nextElement()).getUserObject()
                                            instanceof PlainBelliedSneech)
                             childCount++;
                   return childCount;
              public boolean getShowStarBelliedSneeches() {
                   return mShowStarBelliedSneeches;
              public void setShowStarBelliedSneeches(boolean showStarBelliedSneeches)
                   if (showStarBelliedSneeches != mShowStarBelliedSneeches) {
                        mShowStarBelliedSneeches= showStarBelliedSneeches;
                        Object[] path= { mRoot };
                        int[] childIndices= new int[root.getChildCount()];
                        Object[] children= new Object[root.getChildCount()];
                        for (int i= 0; i< root.getChildCount(); i++) {
                             childIndices= i;
                             children[i]= root.getChildAt(i);
                        fireTreeStructureChanged(this, path, childIndices, children);
         private FilteredTree()
              final DefaultMutableTreeNode root= new DefaultMutableTreeNode("Root");
              DefaultMutableTreeNode parent;
              DefaultMutableTreeNode child;
              for (int i= 0; i< 2; i++) {
                   parent= new DefaultMutableTreeNode(new PlainBelliedSneech());
                   root.add(parent);
                   for (int j= 0; j< 2; j++) {
                        child= new DefaultMutableTreeNode(new StarBelliedSneech());
                        parent.add(child);
                        for (int k= 0; k< 2; k++)
                             child.add(new DefaultMutableTreeNode(new PlainBelliedSneech()));
                   for (int j= 0; j< 2; j++)
                        parent.add(new DefaultMutableTreeNode(new PlainBelliedSneech()));
                   parent= new DefaultMutableTreeNode(new StarBelliedSneech());
                   root.add(parent);
                   for (int j= 0; j< 2; j++) {
                        child= new DefaultMutableTreeNode(new PlainBelliedSneech());
                        parent.add(child);
                        for (int k= 0; k< 2; k++)
                             child.add(new DefaultMutableTreeNode(new StarBelliedSneech()));
                   for (int j= 0; j< 2; j++)
                        parent.add(new DefaultMutableTreeNode(new StarBelliedSneech()));
              final FilteredTreeModel model= new FilteredTreeModel(root);
              JTree tree= new JTree(model);
    tree.setShowsRootHandles(true);
    tree.putClientProperty("JTree.lineStyle", "Angled");
              tree.setRootVisible(false);
              JScrollPane sp= new JScrollPane(tree);
              sp.setPreferredSize(new Dimension(200,400));
              final JCheckBox check= new JCheckBox("Show Star Bellied Sneeches");
              check.setSelected(model.getShowStarBelliedSneeches());
              check.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        model.setShowStarBelliedSneeches(check.isSelected());
              JPanel panel= new JPanel(new BorderLayout());
              panel.add(check, BorderLayout.NORTH);
              panel.add(sp, BorderLayout.CENTER);
              JOptionPane.showOptionDialog(
                   null, panel, "Sneeches on Beeches",
                   JOptionPane.DEFAULT_OPTION,
                   JOptionPane.PLAIN_MESSAGE,
                   null, new String[0], null
              System.exit(0);
         public static void main(String[] argv) {
              new FilteredTree();

  • Problem in Exploring the Decision Tree Model on Lesson 4 Basic Data Mining SSAS

    Hello everyone,
    I've tried to follow all the steps mentioned in Basic Data Mining Tutorials, but I've an odd problem in the Lesson 4 - Exploring the Decision Tree Model (http://technet.microsoft.com/en-us/library/cc879269.aspx).
    It's stated that "As you view the TM_Decision_Tree model
    in the Decision Tree viewer, you can see the most important attributes at the left side of the chart. “Most important” means that these attributes have the greatest influence on the outcome. Attributes further down the tree (to the right of the chart) have
    less of an effect. In this example, age is the single most important factor in predicting bike buying. The model
    groups customers by age, and then shows the next more important attribute for each age group. For example, in the group of customers aged 34 to 40, the number of cars owned is the strongest predictor after age."
    But, I got a different result from what mentioned in the tutorial. I got the number of cars owned as the most important attribute, then followed by the attribute age.
    Do you guys know why?
    Thanks in advance

    HI,
    BEGIN
       INSERT INTO DT_CA_SETTINGS_TEST (SETTING_NAME, SETTING_VALUE) VALUES
       (dbms_data_mining.TREE_TERM_MINPCT_NODE,to_char(1));
    END;
    That is not "Mode" its "NODE".
    Now Execute.
    Cheers..

  • Bette way to referenced tree model nodes from UI to perform actions on them

    A singleton facade is built.
    Its init() method loads several "tree model configs", each of them referenced by a name.
    This singleton creates a Project instance for a given "tree model config" calling the facade method -> createProject(String pjrName, String modelConfigName)
    When the Project is built a new Model instance is set ( remember the model instance is a tree holding nodes )
    The new Project instance built is added to a List that the facade has and then it's returned to the UI part that called ->createProject(prjName,modelconfigName)
    Given the Project instance the UI has to build a JTree representation of the model that the project references and the UI will have button actions that should call methods of the Nodes of the model referenced by the Project.
    Doing it this way the UI will be able to reference objects directly without going through the facade.
    Maybe I should return to the UI something like a ProjectKey instance instead of letting have the UI the Project instance ?
    It should be better if I process the possible node actions behind the Facade and not the UI, but how can I do it ?
    Having a ProjectKey in my UI I could ask the facade a model tree representation but not having the real nodes, otherwise having some NodeKey instances ?

    Sounds like you want to represent a tree structure, without a reference to the real tree.
    I'll take it further: maybe you don't want the UI to know there's a real tree data-structure with nodes and pointers to children, because maybe you build the tree on the fly from a database.
    So use the Builder pattern instead of committing to a specific data structure.
    Google results for Builder pattern: http://www.google.com/search?hl=en&q=builder+pattern&btnG=Google+Search
    Your UI should know how to construct nodes and children graphically, when told. This means it should have methods like addNode, but related to the domain: addSubProject maybe.
    A Project object is the Director, knowing which part goes where, but it doesn't know the real end result (a JPanel or HTML). So it has a method buildProject(Builder e) or exportProject(Exporter e), where all logic of assembling the parts is.
    When you have that, write a class JTreeProjectExporter implements Exporter.
    Hope this helps.

  • XML and Tree Model !!!

    I am wanting to implement the tree model from xml data.
    I am new to this so would appreicate any help filling in the gaps. My aim is to reflect this xml file in a JTreeTable format (I have left out the table model implementation.)
    A sample xml file looks like this :
    <?xml version="1.0" ?>
    <exam>
    <Column class="xTableModel">Attribute</Column>
    <Column class="String">Value</Column>
    <Question>
    <Id>1</Id>
    <Type>TF></Type>
    <Text>Napolean was french ?></Text>
    <Answer>True</Answer>
    <Mark>3</Mark>
    </Question>
    </exam>
    How I am Reading the file:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder parser = factory.newDocumentBuilder();
    doc = parser.parse(xmlfile);
    Tree Model Methods. //Not really sure what i am doing here.
    public Object getChild(Object node, int i)
    Node parent = ((Node) node);
    Object child = parent.getChildNodes().item(i);
    return child;
    public int getChildCount(Object node)
    Node parent = ((Node) node);
    // int child = parent.getChildNodes().getLength();
    return 1;
    public boolean isleaf(Object node)
    Node parent = ((Node)node);
    Node child = parent.getFirstChild();
    return (child == null);
    }

    you can use a adapter pattern to convert the xml element to a TreeModel, this can be used by JTree

  • Do i need a new charge adapter after updateing my i phone 3

    do i need a new charge adapter after updating my i phone 3.

    What do you mean by "updating"?  If you mean "updating the software", the answer is no.  If you mean buying a newer iPhone, the answer dpends upon which newer model you bought.

  • Column selection with column tree model

    Hello!
    I created a column tree model. I would like to be able to select a column when i click on its header. How can I do that? There is no problem to select one item. I try to select all the items of a column but if do that this is the lines which are selected. The item_selection parameter is set to 'X'.
    Thanks in advance,

    Hi,
    I am not sure if I understood your problem right. But just in case, if you are referring to this...
    You say you need a check box to select your nodes. So you would have to add your item names in a separate column and then add the check box in a separate column using ADD_COLUMN method. You would have to use treemcitac structure and make use of ADD_ITEMS to add them.
    Once you add the column for check box, code your logic and build your tree hierarchy with all the correct node keys. For example, the root node will have node_key = 1 and parent_key = 0. The node that comes under the root node in the first hierarchy level will have node_key = 2 and parent_key = 1. Code your logic so that you build your tree hierarchy.
    Build the tree structure using treemcnota as you have done. Add the nodes built using treemcnota using ADD_NODES.
    According to your requirement,
    COL1                                                                           COL2 (for checkbox)  } -> Build using treemcitac
    Preimport (Root)  -> Root Node
    Request Checks (Node_1)  -> parent_key = Preimport
    Check Req Status (Item_1) -> parent_key = Request Checks (Node_1)
    Check Req Scope (Item_2)
    Check Req Componenets (Item_3)
    Object List Checks (Node_2)
    Check obj type (Item_1)
    check deletions (Item_2)
    Object Checks (Node_3)
    "Build the tree nodes using treemcnota and add these nodes using ADD_NODES
    Again, I am not sure if your problem is this. Hope this might be helpful.

  • ADF 10g  TREE MODEL

    HI
    Can any one send me a Tree model example
    how can i made it generate manualy
    i have this but its not working its just apear the root without any children
    public Object getDefaultFocusRowKey() {
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    Object editor =
    app.getVariableResolver().resolveVariable(context, "editor");
    UIComponent comp =
    (UIComponent)app.getPropertyResolver().getValue(editor, "root");
    Object focusRowKey = null;
    if (comp != null && comp instanceof UIXTree) {
    UIXTree tree = (UIXTree)comp;
    Object oldKey = tree.getRowKey();
    try {
    tree.setRowKey(null);
    tree.setRowIndex(0);
    focusRowKey = tree.getRowKey();
    } finally {
    tree.setRowKey(oldKey);
    return focusRowKey;
    private TreeModel createTree() throws IntrospectionException {
    AppModuleImpl app =
    (AppModuleImpl)Configuration.createRootApplicationModule("model.app.AppModuleImpl",
    "AppModuleLocal");
    RowKeyPropertyModel rowKeyPropModel =
    new RowKeyPropertyModel(getTreeChild(app, 0), "root");
    return new RowKeyPropertyTreeModel(rowKeyPropModel, "root", "root");
    private List getTreeChild(AppModuleImpl app, int parent) {
    List root = new ArrayList();
    Map mapRoot = new HashMap();
    mapRoot.put("en_desc", "aaa");
    Map mapRoot2 = new HashMap();
    mapRoot2.put("en_desc", "hh");
    List rooth = new ArrayList();
    Map mapRooth = new HashMap();
    mapRooth.put("en_desc", "hh2");
    rooth.add(mapRooth);
    mapRoot2.put("root", rooth);
    root.add(mapRoot);
    root.add(mapRoot2);
    return root;
    }

    Hi Frank,
    RowKeySetImpl doesn't appear to exist in the 10g version I have, though there is a RowKeySet What I seems to be having trouble understanding is what format the path needs to be in and how I give it to the tree to force the expansion.
    After some reading on the topic I tried something like this:
    PathSet pathSet = new PathSet();
    pathSet.setTreeModel(getTreeModel());
    pathSet.getKeySet().addAll(ArrayList of Paths) // [0,0,2,3] for instance
    But regardless of what I use in the ArrayList (the tutorial I found used Strings, but I also tried Integers), I always ALWAYS get errors.
    I'm hoping there is an easier way to achieve this, it's frustrating the lack of documentation on 10g yet my hands are tied and I'm forced to continue down this path.

  • Failed to open model viewer error, for Decision Tree Model

    Oracle 11.0.2
    SQL Developer 3.0.04
    I am trying to follow ODM tutorial here :
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/11g/r2/prod/bidw/datamining/ODM11gR2.htm
    After completing initial analysis, I want to investigate the Decision Tree model more closely. As I choose View Models > CLAS_DT_1_1, I get an error message:
    Failed to open model viewer
    Details are:
    java.lang.RuntimeException: not instanceof RoundedTreeNode
         at oracle.dmt.dataminer.mviewer.dtree.model.TreeNode.assignPropertyChangeListener(Unknown Source)
         at oracle.dmt.dataminer.mviewer.dtree.DecisionTreeEditor.setPropertyChangeListener(Unknown Source)
         at oracle.dmt.dataminer.mviewer.dtree.DecisionTreeEditor.open(Unknown Source)
         at oracle.ideimpl.editor.EditorState.openEditor(EditorState.java:283)
         at oracle.ideimpl.editor.EditorState.createEditor(EditorState.java:184)
         at oracle.ideimpl.editor.EditorState.getOrCreateEditor(EditorState.java:95)
         at oracle.ideimpl.editor.SplitPaneState.canSetEditorStatePos(SplitPaneState.java:232)
         at oracle.ideimpl.editor.SplitPaneState.setCurrentEditorStatePos(SplitPaneState.java:195)
         at oracle.ideimpl.editor.TabGroupState.createSplitPaneState(TabGroupState.java:102)
         at oracle.ideimpl.editor.TabGroup.addTabGroupState(TabGroup.java:379)
         at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1403)
         at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1337)
         at oracle.ideimpl.editor.EditorManagerImpl.openEditor(EditorManagerImpl.java:1263)
         at oracle.ide.editor.EditorUtil.openDefaultEditorInFrame(EditorUtil.java:164)
         at oracle.dmt.dataminer.workflow.WorkflowContextMenu$2.actionPerformed(Unknown Source)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
         at java.awt.Component.processMouseEvent(Component.java:6504)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
         at java.awt.Component.processEvent(Component.java:6269)
         at java.awt.Container.processEvent(Container.java:2229)
         at java.awt.Component.dispatchEventImpl(Component.java:4860)
         at java.awt.Container.dispatchEventImpl(Container.java:2287)
         at java.awt.Component.dispatchEvent(Component.java:4686)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
         at java.awt.Container.dispatchEventImpl(Container.java:2273)
         at java.awt.Window.dispatchEventImpl(Window.java:2713)
         at java.awt.Component.dispatchEvent(Component.java:4686)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
         at java.awt.EventQueue.access$000(EventQueue.java:101)
         at java.awt.EventQueue$3.run(EventQueue.java:666)
         at java.awt.EventQueue$3.run(EventQueue.java:664)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
         at java.awt.EventQueue$4.run(EventQueue.java:680)
         at java.awt.EventQueue$4.run(EventQueue.java:678)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    I get this error for Decision Tree Model only. For other models, there is no problem. How can I fix it?
    Thank you.

    After setting system language to English, be sure to restart SQL Dev to retry the test.
    Make sure you have the latest patches installed.
    Go to menu: Help-> About. In the About dialog, select the Extensions tab and check if you have Data Miner version 11.2.0.2.04.40. If not, go to menu Help->Check for Updates, and install the SQL Developer and Data Miner patches.
    SQL Dev 3.0 is not certified with Java 7.
    Thanks,
    Marat
    Edited by: mspivak on Jan 10, 2012 12:33 PM
    Edited by: mspivak on Jan 10, 2012 12:33 PM
    Edited by: mspivak on Jan 10, 2012 12:34 PM

  • Execute an adapter after a scheduled task

    Hi guys,
    How do I execute an adapter after scheduled task??
    I have a gtc recon trusted, but doesn't has the user login, I need generate this login. I have created an adapter that genate this login, but I don't know what time to run this adapter and I don't know where I need insert the call to this adapter.
    Thanks

    If it is 9i write an pre-insert event handler instead of adapter. and attach on user data object
    for above you have to write a java class which has to extends tcBaseEvent class and then override the implementation method
    here you can generate your user login as per your logic and then set the usr_login.
    finally build the jar and put this under <IDM_HOME>/server/EventHandler folder

  • Re: Toshiba system driver don't execute after instalation

    toshiba system driver don't execute after instalation in windows 8 64 bit

    Hi
    I dont have this notebook model but if you try to install own Win8 version please install all stuff following this install order:
    Windows 8
    Intel RAID Driver
    Intel Chipset SW Installation Utility
    Intel Management Engine Interface
    Intel Rapid Storage Technology Driver
    Intel Display Driver
    NVIDIA Display Driver
    Realtek Audio Driver
    Intel Rapid Start Technology Software
    SRS Premium Sound
    Realtek Card Reader
    Realtek LAN Driver
    Wireless LAN Driver
    Intel Wireless Display
    Realtek Bluetooth Filter Driver Package
    Synaptics Touch Pad Driver
    TOSHIBA Flash Cards Support Utility
    TOSHIBA System Driver
    and so on.
    Toshiba system driver can be downloaded from here .

  • Fully expanded tree using tree model

    Hi every body,
    I have represented into jtree form after reading xml document using the tree model. But I want to displayed
    the fully expanded tree at the screen when program run.
    Please help me.
    Thanks
    Edited by: ahmadgee on Jul 11, 2008 3:42 AM

    Thanks for your help
    For get the the tree in expanded form, I am using the expandAPath funtion by the following way.
    public class XMLTreePanel extends JPanel {
           private JTree tree;
           private XMLTreeModel model;
           public XMLTreePanel() {
                    setLayout(new BorderLayout());
            model = new XMLTreeModel();
         tree = new JTree();
         tree.setModel(model);
         tree.setShowsRootHandles(true);
         tree.setEditable(false);
         expandAPath(tree);
         JScrollPane pane = new JScrollPane(tree);
         pane.setPreferredSize(new Dimension(300,400));
         add(pane, "Center");
         final JTextField text = new JTextField();
                    text.setEditable(false);
         add(text, "South");
         tree.addTreeSelectionListener(new TreeSelectionListener() {
              public void valueChanged(TreeSelectionEvent e) {
              Object lpc = e.getPath().getLastPathComponent();
              if (lpc instanceof XMLTreeNode) {
                   text.setText( ((XMLTreeNode)lpc).getText() );
    public void expandAPath(JTree tree){               
         for(int i=1; i<tree.getRowCount(); ++i) {
              tree.expandRow(i);            
    public void setDocument(Document document) {
         model.setDocument(document);
    public Document getDocument() {
         return model.getDocument();
    }

Maybe you are looking for

  • Error in Open Hub Transformation Routine

    Hi, I created an Open Hub Destination which has 67 fields. In the transformation, i am using 'routine' for one of the transformation rule. In the routine, the target field type is not defined automatically and I am not able to change it. When i save

  • XQuery performance vs. Lucene

    I'm trying to tune some databases for better query performance. I'm using the BDB XML Java API. The queries I'm trying to tune all return counts, i.e. count(...). Presently a query might take about 500ms to execute, but ideally it would take 50-100ms

  • It's telling me to delete my Iphone back-up because it's corrupted. Where

    what file do I delete? it's telling me that the back-up is corrupted and to delete it

  • "Mac Help" Search Box is suddenly missing!!

    Out of the blue when I access Mac Help the screen no longer displays the search box and magnifying glass icon. Everything else is there but it means the only way I can get help is to try and find something that matches my question in the Index. This

  • Adding a calendar to Calendar app

    I was wondering how to "add" a calendar to the calendar app on iPad and iPhone 4. Also how to change event colors?