<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Tue Jun 29 06:02:07 GMT+01:00 1999 -->
<TITLE>
Swing 1.1 API Specification: Interface  TreeModel
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="class-use/TreeModel.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Swing 1.1</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/swing/tree/TreeCellRenderer.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/swing/tree/TreeNode.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="TreeModel.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.swing.tree</FONT>
<BR>
Interface  TreeModel</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../javax/swing/tree/DefaultTreeModel.html">DefaultTreeModel</A></DD>
</DL>
<HR>
<DL>
<DT>public abstract interface <B>TreeModel</B></DL>

<P>
The interface that defines a suitable data model for a JTree.
<P>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->


<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/tree/TreeModel.html#addTreeModelListener(javax.swing.event.TreeModelListener)">addTreeModelListener</A></B>(<A HREF="../../../javax/swing/event/TreeModelListener.html">TreeModelListener</A>&nbsp;l)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a listener for the TreeModelEvent posted after the tree changes.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/tree/TreeModel.html#getChild(java.lang.Object, int)">getChild</A></B>(java.lang.Object&nbsp;parent,
         int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the child of <I>parent</I> at index <I>index</I> in the parent's
 child array.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/tree/TreeModel.html#getChildCount(java.lang.Object)">getChildCount</A></B>(java.lang.Object&nbsp;parent)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of children of <I>parent</I>.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/tree/TreeModel.html#getIndexOfChild(java.lang.Object, java.lang.Object)">getIndexOfChild</A></B>(java.lang.Object&nbsp;parent,
                java.lang.Object&nbsp;child)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index of child in parent.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/tree/TreeModel.html#getRoot()">getRoot</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the root of the tree.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/tree/TreeModel.html#isLeaf(java.lang.Object)">isLeaf</A></B>(java.lang.Object&nbsp;node)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if <I>node</I> is a leaf.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/tree/TreeModel.html#removeTreeModelListener(javax.swing.event.TreeModelListener)">removeTreeModelListener</A></B>(<A HREF="../../../javax/swing/event/TreeModelListener.html">TreeModelListener</A>&nbsp;l)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a listener previously added with <B>addTreeModelListener()</B>.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/swing/tree/TreeModel.html#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)">valueForPathChanged</A></B>(<A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A>&nbsp;path,
                    java.lang.Object&nbsp;newValue)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Messaged when the user has altered the value for the item identified
 by <I>path</I> to <I>newValue</I>.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->


<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="getRoot()"><!-- --></A><H3>
getRoot</H3>
<PRE>
public java.lang.Object <B>getRoot</B>()</PRE>
<DL>
<DD>Returns the root of the tree.  Returns null only if the tree has
 no nodes.<DD><DL>
<DT><B>Returns:</B><DD>the root of the tree</DL>
</DD>
</DL>
<HR>

<A NAME="getChild(java.lang.Object, int)"><!-- --></A><H3>
getChild</H3>
<PRE>
public java.lang.Object <B>getChild</B>(java.lang.Object&nbsp;parent,
                                 int&nbsp;index)</PRE>
<DL>
<DD>Returns the child of <I>parent</I> at index <I>index</I> in the parent's
 child array.  <I>parent</I> must be a node previously obtained from
 this data source. This should not return null if <i>index</i>
 is a valid index for <i>parent</i> (that is <i>index</i> >= 0 &&
 <i>index</i> < getChildCount(<i>parent</i>)).<DD><DL>
<DT><B>Parameters:</B><DD><CODE>parent</CODE> - a node in the tree, obtained from this data source<DT><B>Returns:</B><DD>the child of <I>parent</I> at index <I>index</I></DL>
</DD>
</DL>
<HR>

<A NAME="getChildCount(java.lang.Object)"><!-- --></A><H3>
getChildCount</H3>
<PRE>
public int <B>getChildCount</B>(java.lang.Object&nbsp;parent)</PRE>
<DL>
<DD>Returns the number of children of <I>parent</I>.  Returns 0 if the node
 is a leaf or if it has no children.  <I>parent</I> must be a node
 previously obtained from this data source.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>parent</CODE> - a node in the tree, obtained from this data source<DT><B>Returns:</B><DD>the number of children of the node <I>parent</I></DL>
</DD>
</DL>
<HR>

<A NAME="isLeaf(java.lang.Object)"><!-- --></A><H3>
isLeaf</H3>
<PRE>
public boolean <B>isLeaf</B>(java.lang.Object&nbsp;node)</PRE>
<DL>
<DD>Returns true if <I>node</I> is a leaf.  It is possible for this method
 to return false even if <I>node</I> has no children.  A directory in a
 filesystem, for example, may contain no files; the node representing
 the directory is not a leaf, but it also has no children.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - a node in the tree, obtained from this data source<DT><B>Returns:</B><DD>true if <I>node</I> is a leaf</DL>
</DD>
</DL>
<HR>

<A NAME="valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)"><!-- --></A><H3>
valueForPathChanged</H3>
<PRE>
public void <B>valueForPathChanged</B>(<A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A>&nbsp;path,
                                java.lang.Object&nbsp;newValue)</PRE>
<DL>
<DD>Messaged when the user has altered the value for the item identified
 by <I>path</I> to <I>newValue</I>.  If <I>newValue</I> signifies
 a truly new value the model should post a treeNodesChanged
 event.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>path</CODE> - path to the node that the user has altered.<DD><CODE>newValue</CODE> - the new value from the TreeCellEditor.</DL>
</DD>
</DL>
<HR>

<A NAME="getIndexOfChild(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
getIndexOfChild</H3>
<PRE>
public int <B>getIndexOfChild</B>(java.lang.Object&nbsp;parent,
                           java.lang.Object&nbsp;child)</PRE>
<DL>
<DD>Returns the index of child in parent.</DL>
<HR>

<A NAME="addTreeModelListener(javax.swing.event.TreeModelListener)"><!-- --></A><H3>
addTreeModelListener</H3>
<PRE>
public void <B>addTreeModelListener</B>(<A HREF="../../../javax/swing/event/TreeModelListener.html">TreeModelListener</A>&nbsp;l)</PRE>
<DL>
<DD>Adds a listener for the TreeModelEvent posted after the tree changes.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>l</CODE> - the listener to add<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/TreeModel.html#removeTreeModelListener(javax.swing.event.TreeModelListener)"><CODE>removeTreeModelListener(javax.swing.event.TreeModelListener)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="removeTreeModelListener(javax.swing.event.TreeModelListener)"><!-- --></A><H3>
removeTreeModelListener</H3>
<PRE>
public void <B>removeTreeModelListener</B>(<A HREF="../../../javax/swing/event/TreeModelListener.html">TreeModelListener</A>&nbsp;l)</PRE>
<DL>
<DD>Removes a listener previously added with <B>addTreeModelListener()</B>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>l</CODE> - the listener to remove<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/TreeModel.html#addTreeModelListener(javax.swing.event.TreeModelListener)"><CODE>addTreeModelListener(javax.swing.event.TreeModelListener)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="class-use/TreeModel.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Swing 1.1</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/swing/tree/TreeCellRenderer.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/swing/tree/TreeNode.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="TreeModel.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries.<br>Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font>
</BODY>
</HTML>
