go To JTree Node - Java Swing

Java examples for Swing:JTree

Description

go To JTree Node

Demo Code


//package com.java2s;
import javax.swing.*;

import javax.swing.tree.TreePath;

public class Main {
    public static void goToNode(JTree t, TreePath path) {
        t.setSelectionPath(path);/* w ww . ja va 2 s.c o m*/
        t.scrollPathToVisible(path);
    }
}

Related Tutorials