所以我想围绕我的gui东西做一个框架,但是当我做screen.clear();时,它消失了。任何想法如何使其停留?我也不能创建一个方法makeFrame();或类似的东西,因为您需要使一些对象实际执行任何操作。请帮忙。这是框架的代码
for (int i = 0; i < 78; i++) {
tg.putString(i, 0, String.valueOf(Symbols.DOUBLE_LINE_HORIZONTAL));
}
for (int i = 0; i < 23; i++) {
tg.putString(0, i, String.valueOf(Symbols.DOUBLE_LINE_VERTICAL));
}
for (int i = 0; i < 78; i++) {
tg.putString(i, 23, String.valueOf(Symbols.DOUBLE_LINE_HORIZONTAL));
}
for (int i = 0; i < 23; i++) {
tg.putString(78, i, String.valueOf(Symbols.DOUBLE_LINE_VERTICAL));
}
tg.putString(0, 0, String.valueOf(Symbols.DOUBLE_LINE_TOP_LEFT_CORNER));
tg.putString(0, 23, String.valueOf(Symbols.DOUBLE_LINE_BOTTOM_LEFT_CORNER));
tg.putString(78, 0, String.valueOf(Symbols.DOUBLE_LINE_TOP_RIGHT_CORNER));
tg.putString(78, 23, String.valueOf(Symbols.DOUBLE_LINE_BOTTOM_RIGHT_CORNER));
但这东西也需要在这里
Terminal terminal = new DefaultTerminalFactory().createTerminal();
Screen screen = new TerminalScreen(terminal);
TextGraphics tg = screen.newTextGraphics();