Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ocadaruma/lowtable

Super simple swing component to render tables
https://github.com/ocadaruma/lowtable

Last synced: about 2 months ago
JSON representation

Super simple swing component to render tables

Awesome Lists containing this project

README

        

= lowtable

Super simple swing component to render tables.

image::img/example.png["Example",300]

== Installation
Add `com.mayreh.lowtable:lowtable:$VERSION` to the dependency.

== Usage

[source,java]
----
TableData data = TableData
.builder()
.header("target", "metricA", "metricB")
.addRow(Cell.of("foo"),
Cell.of("99.9999", TableCellStyle.builder().background(Defaults.SUCCESS_LIGHT).build()),
Cell.of("0.1", TableCellStyle.builder().background(Defaults.DANGER_LIGHT).build()))
.addRow(Cell.of("bar"),
Cell.of("1300000", TableCellStyle.builder().background(Defaults.SUCCESS_LIGHT).build()),
Cell.of("99", TableCellStyle.builder().background(Defaults.SUCCESS_LIGHT).build()))
.build();

Table table = new Table(TableStyle.DEFAULT, data);
table.setAutoSize();
table.saveAsPNG(file);
----