Class SwingBrowser

java.lang.Object
eu.bandm.tools.util.ui.SwingBrowser

public class SwingBrowser extends Object
Utilities to display data in Java swing windows.
  • Method Details

    • displayTree

      public static JFrame displayTree(TreeNode tn, String windowname)
      Displays a treenode on a Java swing panel. The user must finally call result.setVisible(true);.
      Parameters:
      tn - the root of the tree of nodes
      windowname - to be shown as title of the window
      Returns:
      the created JFrame window object
    • displayTree

      public static JFrame displayTree(JTree tree, String windowname)
      Displays a tree on a Java swing panel. The user must finally call result.setVisible(true);.
      Parameters:
      tree - the root of the tree of nodes
      windowname - to be shown as title of the window
      Returns:
      the created JFrame window object
    • displayTree

      public static JFrame displayTree(TreeNode tn, String windowname, @Opt @Opt String buttonText, @Opt @Opt ActionListener buttonReaction, @Opt @Opt TreeSelectionListener selectionListener)
      Displays a treenode on a Java swing panel. The user must finally call result.setVisible(true);.
      Parameters:
      tn - the root of the tree of nodes
      windowname - to be shown as title of the window
      buttonText - the text to show on an optional button
      buttonReaction - what to do when the button is activated
      selectionListener - what to do when a node is selected
      Returns:
      the created JFrame window object
      See Also:
    • displayTree

      public static JFrame displayTree(JTree tree, String windowname, @Opt @Opt String buttonText, @Opt @Opt ActionListener buttonReaction, @Opt @Opt TreeSelectionListener selectionListener)
      Displays a tree on a Java swing panel. A JFrame (= a window) is created, filled with scroll bars and the tree graphic. If a button text is given, the buttonReaction may not be null, and a button with given text and reaction is inserted in the panel. When the selectionListener is not null, it is installed with single-node selection mode. The user must finally call result.setVisible(true);.
      Parameters:
      tree - a Java swing tree of nodes
      windowname - to be shown as title of the window
      buttonText - the text to show on an optional button
      buttonReaction - what to do when the button is activated
      selectionListener - what to do when a node is selected
      Returns:
      the created JFrame window object