本文整理汇总了Java中com.googlecode.lanterna.gui2.BorderLayout类的典型用法代码示例。如果您正苦于以下问题:Java BorderLayout类的具体用法?Java BorderLayout怎么用?Java BorderLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BorderLayout类属于com.googlecode.lanterna.gui2包,在下文中一共展示了BorderLayout类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LanternaMenuPanel
import com.googlecode.lanterna.gui2.BorderLayout; //导入依赖的package包/类
public LanternaMenuPanel() {
super(new BorderLayout());
Panel panel = new Panel();
panel.setLayoutManager(new BorderLayout());
panel.setPreferredSize(new TerminalSize(Integer.MAX_VALUE, 1));
bar = new MenuBar();
updateMenu(null);
panel.addComponent(bar, Location.LEFT);
if (Application.getInstance().hasSearchPages()) {
panel.addComponent(createSearchField(), Location.RIGHT);
}
addComponent(panel, Location.TOP);
}
示例2: LanternaEditorLayout
import com.googlecode.lanterna.gui2.BorderLayout; //导入依赖的package包/类
public LanternaEditorLayout(IContent content, Action[] actions) {
setLayoutManager(new BorderLayout());
addComponent((Component) content, Location.CENTER);
Panel panelActions = new Panel(new LinearLayout(Direction.HORIZONTAL));
for (final Action action : actions) {
Button button = new Button(action.getName());
button.addListener(b -> LanternaFrontend.run(b, () -> action.action()));
panelActions.addComponent(button);
}
addComponent(panelActions, Location.BOTTOM);
}
示例3: main
import com.googlecode.lanterna.gui2.BorderLayout; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
Terminal terminal = new DefaultTerminalFactory().createTerminal();
Screen screen = new TerminalScreen(terminal);
screen.startScreen();
Panel panel = new Panel(new BorderLayout());
Table<String> table = new Table<>("- Quotation -");
table.getTableModel().addRow("135.09");
table.getTableModel().addRow("134.56");
table.getTableModel().addRow("134.27");
table.getTableModel().addRow("133.90");
table.getTableModel().addRow("132.81");
table.setLayoutData(BorderLayout.Location.RIGHT);
panel.addComponent(table);
TextBox textBox = new TextBox("EMPTY", TextBox.Style.MULTI_LINE);
textBox.setLayoutData(BorderLayout.Location.CENTER);
panel.addComponent(textBox);
// Create window to hold the panel
BasicWindow window = new BasicWindow();
window.setComponent(panel);
window.setHints(Arrays.asList(Window.Hint.FULL_SCREEN));
// Create gui and start gui
MultiWindowTextGUI gui = new MultiWindowTextGUI(screen, new DefaultWindowManager(),
new EmptySpace(TextColor.ANSI.BLUE));
gui.addWindowAndWait(window);
}