protected void loadChildren ( ) { DynamicTreeNode newNode ; // Font font; // int randomIndex; NodeData dataParent = ( NodeData ) this . getUserObject ( ) ; FieldList fieldList = dataParent . makeRecord ( ) ; FieldTable fieldTable = fieldList . getTable ( ) ; m_fNameCount = 0 ; try { fieldTable . close ( ) ; // while (fieldTable.hasNext()) while ( fieldTable . next ( ) != null ) { String objID = fieldList . getField ( 0 ) . toString ( ) ; String strDescription = fieldList . getField ( 3 ) . toString ( ) ; NodeData data = new NodeData ( dataParent . getBaseApplet ( ) , dataParent . getRemoteSession ( ) , strDescription , objID , dataParent . getSubRecordClassName ( ) ) ; newNode = new DynamicTreeNode ( data ) ; /** Don't use add() here, add calls insert(newNode, getChildCount()) so if you want to use add, just be sure to set hasLoaded = true first. */ this . insert ( newNode , ( int ) m_fNameCount ) ; m_fNameCount ++ ; } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } /** This node has now been loaded, mark it so. */ m_bHasLoaded = true ; }
Messaged the first time getChildCount is messaged . Creates children with random names from names .