JTerminal documentation Help

ListView

The ListView component shows a list of items.

ListViewComponent listViewComponent = new ListViewComponent(); listViewComponent.elements( Arrays.asList("Copper", "Iron", "Steel", "Bronze", "Aluminium", "Zinc", "Magnesium", "Tin", "Lead", "Gold", "Silver")); listViewComponent.attachScrollBar(); listViewComponent.width(15); listViewComponent.height(5);
listview example

Methods

Method

Description

void cursorStyle(TextStyle)

Sets the cursor style (Default: TextFont.REVERSED)

List<String> elements()

Returns a list of all items

void elements(List<String> elements)

Set all items

ScrollBar scrollBar()

Return the scrollbar config. If none is present, null is returned.

ScrollBar attachScrollBar()

Creating a new Scrollbar and return

void detachScrollBar()

Remove scrollbar

void updateScrollBar()

Updates the scrollbar if present

void cursor(int)

Sets cursor index

int cursor()

Return cursor index

Events

Event

Description

ListItemInteractEvent

Event on interaction of an item

Last modified: 01 Juni 2025