Search in sources :

Example 1 with FileDialogBuilder

use of com.googlecode.lanterna.gui2.dialogs.FileDialogBuilder in project security-lib by ncsa.

the class GUIDemo method componentTest.

public static void componentTest(Screen screen, TextGraphics textGraphics) {
    final WindowBasedTextGUI textGUI = new MultiWindowTextGUI(screen);
    final Window window = new MyWindow();
    Panel contentPanel = new Panel(new GridLayout(2));
    contentPanel.addComponent(new Button("open file", new Runnable() {

        @Override
        public void run() {
            input = new FileDialogBuilder().setTitle("Open File").setDescription("Choose a file").setActionLabel("Open").build().showDialog(textGUI);
        }
    }));
    window.setComponent(contentPanel);
    textGUI.addWindowAndWait(window);
    window.close();
}
Also used : Window(com.googlecode.lanterna.gui2.Window) FileDialogBuilder(com.googlecode.lanterna.gui2.dialogs.FileDialogBuilder) Panel(com.googlecode.lanterna.gui2.Panel) GridLayout(com.googlecode.lanterna.gui2.GridLayout) Button(com.googlecode.lanterna.gui2.Button) MessageDialogButton(com.googlecode.lanterna.gui2.dialogs.MessageDialogButton)

Aggregations

Button (com.googlecode.lanterna.gui2.Button)1 GridLayout (com.googlecode.lanterna.gui2.GridLayout)1 Panel (com.googlecode.lanterna.gui2.Panel)1 Window (com.googlecode.lanterna.gui2.Window)1 FileDialogBuilder (com.googlecode.lanterna.gui2.dialogs.FileDialogBuilder)1 MessageDialogButton (com.googlecode.lanterna.gui2.dialogs.MessageDialogButton)1