Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module : java.desktop - Package : javax.swing
Version documentée : Java SE 17

Classe « JTree »

Informations générales

Héritage

java.lang.Object
    java.awt.Component
        java.awt.Container
            javax.swing.JComponent
                javax.swing.JTree

Interfaces implémentées

javax.accessibility.Accessible
javax.swing.Scrollable

Définition

public class JTree extends javax.swing.JComponent
implements javax.accessibility.Accessible,
javax.swing.Scrollable

Description

A venir.

Liste des attributs

Tous les attributs Attributs d'instance Attributs statiques Attributs dépréciés
QualificateursTypeNomDescription
public static String ANCHOR_SELECTION_PATH_PROPERTY
public static String CELL_EDITOR_PROPERTY
public static String CELL_RENDERER_PROPERTY
public static String EDITABLE_PROPERTY
public static String EXPANDS_SELECTED_PATHS_PROPERTY
public static String INVOKES_STOP_CELL_EDITING_PROPERTY
public static String LARGE_MODEL_PROPERTY
public static String LEAD_SELECTION_PATH_PROPERTY
public static String ROOT_VISIBLE_PROPERTY
public static String ROW_HEIGHT_PROPERTY
public static String SCROLLS_ON_EXPAND_PROPERTY
public static String SELECTION_MODEL_PROPERTY
public static String SHOWS_ROOT_HANDLES_PROPERTY
public static String TOGGLE_CLICK_COUNT_PROPERTY
public static String TREE_MODEL_PROPERTY
public static String VISIBLE_ROW_COUNT_PROPERTY
protected TreeCellEditor cellEditor
protected TreeCellRenderer cellRenderer
protected boolean editable
protected boolean invokesStopCellEditing
protected boolean largeModel
protected boolean rootVisible
protected int rowHeight
protected boolean scrollsOnExpand
protected TreeSelectionModel selectionModel
protected TreeSelectionRedirector selectionRedirector
protected boolean showsRootHandles
protected int toggleClickCount
protected TreeModel treeModel
protected TreeModelListener treeModelListener
protected int visibleRowCount

Liste des constructeurs

Constructeurs Constructeurs dépréciés
ConstructeurDescription
JTree()
JTree( TreeModel newModel )
JTree( Hashtable<?, ?> value )
JTree( TreeNode root )
JTree( Object[] value )
JTree( Vector<?> value )
JTree( TreeNode root, boolean asksAllowsChildren )

Liste des propriétés (getters/setters)

Propriétés Propriétés dépréciées
QualificateursTypeNomR/W
public AccessibleContext accessibleContext R/-
public TreePath anchorSelectionPath R/W
public TreeCellEditor cellEditor R/W
public TreeCellRenderer cellRenderer R/W
protected static TreeModel defaultTreeModel R/-
public boolean dragEnabled R/W
public DropLocation dropLocation R/-
public DropMode dropMode R/W
public boolean editable R/W
public boolean editing R/-
public TreePath editingPath R/-
public boolean expandsSelectedPaths R/W
public boolean fixedRowHeight R/-
public boolean invokesStopCellEditing R/W
public boolean largeModel R/W
public Object lastSelectedPathComponent R/-
public TreePath leadSelectionPath R/W
public int leadSelectionRow R/-
public int maxSelectionRow R/-
public int minSelectionRow R/-
public TreeModel model R/W
public Dimension preferredScrollableViewportSize R/-
public boolean rootVisible R/W
public int rowCount R/-
public int rowHeight R/W
public boolean scrollableTracksViewportHeight R/-
public boolean scrollableTracksViewportWidth R/-
public boolean scrollsOnExpand R/W
public int selectionCount R/-
public boolean selectionEmpty R/-
public TreeSelectionModel selectionModel R/W
public TreePath selectionPath R/W
public TreePath[] selectionPaths R/W
public int selectionRow -/W
public int[] selectionRows R/W
public boolean showsRootHandles R/W
public int toggleClickCount R/W
public TreeExpansionListener[] treeExpansionListeners R/-
public TreeSelectionListener[] treeSelectionListeners R/-
public TreeWillExpandListener[] treeWillExpandListeners R/-
public TreeUI uI R/W
public String uIClassID R/-
public int visibleRowCount R/W

Propriétés héritées de la classe javax.swing.JComponent

actionMap, alignmentX, alignmentY, ancestorListeners, autoscrolls, background, baselineResizeBehavior, border, componentPopupMenu, debugGraphicsOptions, defaultLocale, doubleBuffered, enabled, font, foreground, graphics, height, inheritsPopupMenu, inputMap, inputVerifier, insets, managingFocus, maximumSize, minimumSize, nextFocusableComponent, opaque, optimizedDrawingEnabled, paintingForPrint, paintingOrigin, paintingTile, preferredSize, registeredKeyStrokes, requestFocusEnabled, rootPane, toolTipText, topLevelAncestor, transferHandler, uI, uIClassID, validateRoot, verifyInputWhenFocusTarget, vetoableChangeListeners, visible, visibleRect, width, x, y

Propriétés héritées de la classe java.awt.Container

alignmentX, alignmentY, componentCount, components, containerListeners, focusCycleRoot, focusTraversalPolicy, focusTraversalPolicyProvider, focusTraversalPolicySet, font, insets, layout, maximumSize, minimumSize, preferredSize, validateRoot

Propriétés héritées de la classe java.awt.Component

accessibleContext, alignmentX, alignmentY, background, backgroundSet, baselineResizeBehavior, bounds, colorModel, componentListeners, componentOrientation, cursor, cursorSet, displayable, doubleBuffered, dropTarget, enabled, focusCycleRootAncestor, focusListeners, focusOwner, focusTraversable, focusTraversalKeysEnabled, focusable, font, fontSet, foreground, foregroundSet, graphics, graphicsConfiguration, height, hierarchyBoundsListeners, hierarchyListeners, ignoreRepaint, inputContext, inputMethodListeners, inputMethodRequests, keyListeners, lightweight, locale, location, locationOnScreen, maximumSize, maximumSizeSet, minimumSize, minimumSizeSet, mixingCutoutShape, mouseListeners, mouseMotionListeners, mousePosition, mouseWheelListeners, name, opaque, parent, preferredSize, preferredSizeSet, propertyChangeListeners, showing, size, toolkit, treeLock, valid, visible, width, x, y

Propriétés héritées de la classe java.lang.Object

class

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes concrètes Méthodes abstraites Méthodes dépréciées
QualificateursType de retourPrototype de la méthodeDescription
public void addSelectionInterval( int index0, int index1 )
public void addSelectionPath( TreePath path )
public void addSelectionPaths( TreePath[] paths )
public void addSelectionRow( int row )
public void addSelectionRows( int[] rows )
public void addTreeExpansionListener( TreeExpansionListener tel )
public void addTreeSelectionListener( TreeSelectionListener tsl )
public void addTreeWillExpandListener( TreeWillExpandListener tel )
public void cancelEditing()
public void clearSelection()
protected void clearToggledPaths()
public void collapsePath( TreePath path )
public void collapseRow( int row )
public String convertValueToText( Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus )
protected static TreeModel createTreeModel( Object value )
protected TreeModelListener createTreeModelListener()
public void expandPath( TreePath path )
public void expandRow( int row )
public void fireTreeCollapsed( TreePath path )
public void fireTreeExpanded( TreePath path )
public void fireTreeWillCollapse( TreePath path )
public void fireTreeWillExpand( TreePath path )
protected void fireValueChanged( TreeSelectionEvent e )
public AccessibleContext getAccessibleContext()
public TreePath getAnchorSelectionPath()
public TreeCellEditor getCellEditor()
public TreeCellRenderer getCellRenderer()
public TreePath getClosestPathForLocation( int x, int y )
public int getClosestRowForLocation( int x, int y )
protected static TreeModel getDefaultTreeModel()
protected Enumeration<javax.swing.tree.TreePath> getDescendantToggledPaths( TreePath parent )
public boolean getDragEnabled()
public DropLocation getDropLocation()
public DropMode getDropMode()
public TreePath getEditingPath()
public Enumeration<javax.swing.tree.TreePath> getExpandedDescendants( TreePath parent )
public boolean getExpandsSelectedPaths()
public boolean getInvokesStopCellEditing()
public Object getLastSelectedPathComponent()
public TreePath getLeadSelectionPath()
public int getLeadSelectionRow()
public int getMaxSelectionRow()
public int getMinSelectionRow()
public TreeModel getModel()
public TreePath getNextMatch( String prefix, int startingRow, Bias bias )
protected TreePath[] getPathBetweenRows( int index0, int index1 )
public Rectangle getPathBounds( TreePath path )
public TreePath getPathForLocation( int x, int y )
public TreePath getPathForRow( int row )
public Dimension getPreferredScrollableViewportSize()
public Rectangle getRowBounds( int row )
public int getRowCount()
public int getRowForLocation( int x, int y )
public int getRowForPath( TreePath path )
public int getRowHeight()
public int getScrollableBlockIncrement( Rectangle visibleRect, int orientation, int direction )
public boolean getScrollableTracksViewportHeight()
public boolean getScrollableTracksViewportWidth()
public int getScrollableUnitIncrement( Rectangle visibleRect, int orientation, int direction )
public boolean getScrollsOnExpand()
public int getSelectionCount()
public TreeSelectionModel getSelectionModel()
public TreePath getSelectionPath()
public TreePath[] getSelectionPaths()
public int[] getSelectionRows()
public boolean getShowsRootHandles()
public int getToggleClickCount()
public String getToolTipText( MouseEvent event )
public TreeExpansionListener[] getTreeExpansionListeners()
public TreeSelectionListener[] getTreeSelectionListeners()
public TreeWillExpandListener[] getTreeWillExpandListeners()
public TreeUI getUI()
public String getUIClassID()
public int getVisibleRowCount()
public boolean hasBeenExpanded( TreePath path )
public boolean isCollapsed( int row )
public boolean isCollapsed( TreePath path )
public boolean isEditable()
public boolean isEditing()
public boolean isExpanded( TreePath path )
public boolean isExpanded( int row )
public boolean isFixedRowHeight()
public boolean isLargeModel()
public boolean isPathEditable( TreePath path )
public boolean isPathSelected( TreePath path )
public boolean isRootVisible()
public boolean isRowSelected( int row )
public boolean isSelectionEmpty()
public boolean isVisible( TreePath path )
public void makeVisible( TreePath path )
protected String paramString()
protected boolean removeDescendantSelectedPaths( TreePath path, boolean includePath )
protected void removeDescendantToggledPaths( Enumeration<javax.swing.tree.TreePath> toRemove )
public void removeSelectionInterval( int index0, int index1 )
public void removeSelectionPath( TreePath path )
public void removeSelectionPaths( TreePath[] paths )
public void removeSelectionRow( int row )
public void removeSelectionRows( int[] rows )
public void removeTreeExpansionListener( TreeExpansionListener tel )
public void removeTreeSelectionListener( TreeSelectionListener tsl )
public void removeTreeWillExpandListener( TreeWillExpandListener tel )
public void scrollPathToVisible( TreePath path )
public void scrollRowToVisible( int row )
public void setAnchorSelectionPath( TreePath newPath )
public void setCellEditor( TreeCellEditor cellEditor )
public void setCellRenderer( TreeCellRenderer x )
public void setDragEnabled( boolean b )
public void setDropMode( DropMode dropMode )
public void setEditable( boolean flag )
protected void setExpandedState( TreePath path, boolean state )
public void setExpandsSelectedPaths( boolean newValue )
public void setInvokesStopCellEditing( boolean newValue )
public void setLargeModel( boolean newValue )
public void setLeadSelectionPath( TreePath newPath )
public void setModel( TreeModel newModel )
public void setRootVisible( boolean rootVisible )
public void setRowHeight( int rowHeight )
public void setScrollsOnExpand( boolean newValue )
public void setSelectionInterval( int index0, int index1 )
public void setSelectionModel( TreeSelectionModel selectionModel )
public void setSelectionPath( TreePath path )
public void setSelectionPaths( TreePath[] paths )
public void setSelectionRow( int row )
public void setSelectionRows( int[] rows )
public void setShowsRootHandles( boolean newValue )
public void setToggleClickCount( int clickCount )
public void setUI( TreeUI ui )
public void setVisibleRowCount( int newCount )
public void startEditingAtPath( TreePath path )
public boolean stopEditing()
public void treeDidChange()
public void updateUI()

Méthodes héritées de la classe javax.swing.JComponent

addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI

Méthodes héritées de la classe java.awt.Container

add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponentZOrder, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree

Méthodes héritées de la classe java.awt.Component

action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFocusable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFocusable, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate

Méthodes héritées de la classe java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait