Widget tree

The root of thinlet's widget hierarchy is a desktop, it contains mainly panels and dialogs.

public Object getDesktop()

You can observe the whole tree.

  • A panel, desktop, or dialog could contain components,
  • a combobox choices,
  • a tabbedpane tabs,
  • a tab a single component,
  • a list items,
  • a table rows,
  • a header columns,
  • a row cells,
  • a tree, or a node nodes,
  • a menubar, a menu, or a popupmenu menus, menuitems, checkboxmenuitems, and separators,
  • and a splitpane two components.
A table contains rows, but also a single header widget, similarly a container component may contain components, but also a single popupmenu widget. Use the getWidget method for it.

public int getCount(Object component)
public Object getItem(Object component, int index)
public Object[] getItems(Object component)
public Object getWidget(Object component, String key)
public static String getClass(Object component)
public Object getParent(Object component)

It is possible to find a widget by name (starting from the root desktop or a given component), but probably it's more appropriate to identify components as event parameters.

public Object find(String name)
public Object find(Object component, String name)

The following methods are useful for combobox, tabbedpane, list, table, or tree components:

public int getSelectedIndex(Object component)
public Object getSelectedItem(Object component)
public Object[] getSelectedItems(Object component)

At runtime you can change the widget tree, create new widgets, add, or remove these.

public static Object create(String classname)
public void add(Object component)
public void add(Object parent, Object component)
public void add(Object parent, Object component, int index)
public void remove(Object component)
public void removeAll(Object component)