- static private void fullTestTable() throws IOException {
- final Table<String> table = new Table<String>("Column 1", "Column 2",
- "Column 3");
- table.getTableModel().addRow("1", "2", "3");
- table.setSelectAction(new Runnable() {
- @Override
- public void run() {
- List<String> data = table.getTableModel().getRow(
- table.getSelectedRow());
- for (int i = 0; i < data.size(); i++) {
- System.out.println(data.get(i));
- }
- }
- });
-
- Window win = new BasicWindow();
- win.setComponent(table);
-
- DefaultTerminalFactory factory = new DefaultTerminalFactory();
- Terminal terminal = factory.createTerminal();
-
- Screen screen = new TerminalScreen(terminal);
- screen.startScreen();
-
- // Create gui and start gui
- MultiWindowTextGUI gui = new MultiWindowTextGUI(screen,
- new DefaultWindowManager(), new EmptySpace(TextColor.ANSI.BLUE));
- gui.addWindowAndWait(win);
-
- screen.stopScreen();
+ /**
+ * Really, really ask for UTF-8 encoding.
+ */
+ static private void utf8() {
+ try {
+ System.setProperty("file.encoding", "UTF-8");
+ Field charset = Charset.class.getDeclaredField("defaultCharset");
+ charset.setAccessible(true);
+ charset.set(null, null);
+ } catch (SecurityException e) {
+ } catch (NoSuchFieldException e) {
+ } catch (IllegalArgumentException e) {
+ } catch (IllegalAccessException e) {
+ }