Among the uibooster library examples, it is related to 'table'. Is it possible to change?

Among the uibooster library examples, it is related to ‘table’. Is it possible to change?

Please refer to the image.
source code

import uibooster.*;
UiBooster booster;

void setup() {
  size(800, 400);

  booster = new UiBooster();

  // user showTableImmutable() for immutable tables
  String[][] modifiedData = booster.showTable(
      new String[][]{                                       // data in 2d array
              {"Jimmy Johnson", "35", "Zombieland"},
              {"Danny Durango", "23", "Hangover"},
              {"Larry Berry", "54", ""}
      },
      new String[] {"Name", "Age", "Favorite movie" },      // header
      "Favorite movies");         
      
      println(modifiedData);
      
      // window title
}

void draw() {
  background(10);
}

Can’t you adjust the size of ‘W1’, ‘W2’, and ‘W3’ before the ‘table’ window opens?

Hi @GWAK,

No! Not by using the interfaces provided by the library.
Nevertheless, you can look at the code and maybe tinker your own Table on which you can set the column widths…

If you have then access to the JTable object you can do s.th like

JTable table=...;
table.getColumnModel().getColumn(<a_column_number>).setPreferredWidth(<the_width>);
table.getColumnModel().getColumn(<a_column_number>).setMaxWidth(<the_width>);

Cheers
— mnse

1 Like

a link for you:

see Display Table data from a csv and return the rowID when the user clicks on a row - #2 by Chrisir

1 Like

@mnse

Thanks for your reply.

@Chrisir

Thanks for your reply.
I took a look at the source code. thank you.

1 Like