Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

dérouler un jtree ?

2 réponses
Avatar
Vincent
bonjour,

comment dérouler ou enrouler un arbre ?

merci

Vincent

ps en c# c'est monarbre.expandall() et monarbre.collapseall()

2 réponses

Avatar
Real Gagnon
comment dérouler ou enrouler un arbre ?


Il y a plusieurs facons .

En voici une :

public void expandAll(JTree tree) {
int row = 0;
while (row < tree.getRowCount()) {
tree.expandRow(row);
row++;
}
}

Voir d'autres methodes sur :

"Expand or collapse a JTree"
http://www.rgagnon.com/javadetails/java-0210.html

Bye.
--
Real Gagnon from Quebec, Canada
* Java, Javascript, VBScript and PowerBuilder code snippets
* http://www.rgagnon.com/howto.html
* http://www.rgagnon.com/bigindex.html

Avatar
TestMan
comment dérouler ou enrouler un arbre ?


Il y a plusieurs facons .

En voici une :

public void expandAll(JTree tree) {
int row = 0;
while (row < tree.getRowCount()) {
tree.expandRow(row);
row++;
}
}

Voir d'autres methodes sur :

"Expand or collapse a JTree"
http://www.rgagnon.com/javadetails/java-0210.html

Bye.


Une autre "pour la route" :
http://www.exampledepot.com/egs/javax.swing.tree/ExpandAll.html

A+
TM