DefaultListCellRenderer

Extends
JLabel
Methods
2
Fields
None

Getting one

DefaultListCellRenderer.new()

Methods

MethodReturnsDescription
getListCellRendererComponent(list: any, value: any, index: number, isSelected: boolean, cellHasFocus: boolean)anyThis label, given the value's text (tostring, a table's toString(), "" for nil; an Icon value becomes its icon) and the cell's styl…
new()DefaultListCellRendererDefaultListCellRenderer.new(): an opaque label with the look's no-focus cell border, named List.cellRenderer.

Returned by

MethodReturnsDescription
DefaultListCellRendererClass.newDefaultListCellRendererDefaultListCellRenderer.new(): an opaque label with the look's no-focus cell border, named List.cellRenderer.

Method details

getListCellRendererComponent

getListCellRendererComponent: (DefaultListCellRenderer, list: any, value: any, index: number, isSelected: boolean, cellHasFocus: boolean) -> any

This label, given the value's text (tostring, a table's toString(), "" for nil; an Icon value becomes its icon) and the cell's style: the list's selection colours for a selected row and its own otherwise, its font and enabled state, the look's cell border for the focus state. A subclass overrides it and calls this one. It writes the text, colours, font, enabled state and border natively, so a subclass's setText (or setFont, setEnabled, setBorder) override is not called by it (change the value before calling it, or set the text after it returns), and the border it sets answers getBorder() as an EmptyBorder of the cell insets.

new

new: () -> DefaultListCellRenderer

DefaultListCellRenderer.new(): an opaque label with the look's no-focus cell border, named List.cellRenderer.