0

我正在使用Lanterna库来创建 TUI 应用程序。我想创建其中包含面板列表的全屏窗口。主面板应该是可滚动的。所以它应该看起来像这样:

 Window
+-------------------+
| Main panel        |
| +----------------+|
| | Panel #1       ||
| +----------------+|
| +----------------+|
| | Panel #1       ||
| +----------------+|
| ...               |
+-------------------+

我正在寻找使主面板可滚动的解决方案。

我目前的实现是:

Terminal terminal = new DefaultTerminalFactory().createTerminal();
Screen screen = new TerminalScreen(terminal);
screen.startScreen();

BasicWindow window = new BasicWindow();
window.setHints(List.of(Window.Hint.EXPANDED));

Panel mainPanel = new Panel();
window.setComponent(mainPanel);

// adding panels here: mainPanel.addComponent(new Panel());

MultiWindowTextGUI gui = new MultiWindowTextGUI(screen, new DefaultWindowManager(), new EmptySpace(TextColor.ANSI.BLUE));
gui.addWindowAndWait(window);
4

0 回答 0