public static void main(String[] args)
    {
        final GUIScreen guiScreen = new TestTerminalFactory(args).createGUIScreen();
        guiScreen.getScreen().startScreen();
        
        final Window window1 = new Window("List box window");
        //window1.addComponent(new Widget(1, 1));

        Panel mainPanel = new Panel(new Border.Invisible(), Panel.Orientation.VERTICAL);
        final RadioCheckBoxList listBox = new RadioCheckBoxList();

        Thread thread = new Thread() {
            @Override
            public void run()
            {
                for(int i = 0; i < 30; i++) {
                    try {
                        Thread.sleep(250);
                    }
                    catch(InterruptedException e) {}
                    final Integer count = i + 1;
                    guiScreen.runInEventThread(new Action() {
                        public void doAction()
                        {
                            listBox.addItem("Item #" + count.intValue());
                        }
                    });
                    if(cancelThread)
                        break;
                }
            }
        };
        
        mainPanel.addComponent(listBox);
        window1.addComponent(mainPanel);

        Panel buttonPanel = new Panel(new Border.Invisible(), Panel.Orientation.HORISONTAL);
        Button exitButton = new Button("Exit", new Action() {
                public void doAction()  {
                    guiScreen.closeWindow();
                }
            });
        buttonPanel.addComponent(new EmptySpace(20, 1));
        buttonPanel.addComponent(exitButton);
        window1.addComponent(buttonPanel);
        thread.start();
        guiScreen.showWindow(window1, GUIScreen.Position.CENTER);
        cancelThread = true;
        guiScreen.getScreen().stopScreen();
    }