Exemplo n.º 1
0
    public void init(GameContainer container, StateBasedGame game) throws SlickException {
      indv = new Display(container);
      indv.setSendingGlobalEvents(false);

      float startx = 200;
      float starty = 180;
      float inc = 25;
      for (int i = 0; i < 5; i++) {
        Frame win = new Frame("Window " + i);
        win.setLocation(startx + (i * inc), starty + (i * inc));
        win.setSize(200, 150);
        win.setVisible(true);
        indv.add(win);
        indvWindows.add(win);
        if (i == 4) {
          win.grabFocus();
        } else if (i == 0) {
          win.setAlwaysOnTop(true);
          win.setTitle(win.getTitle() + " (Always on top)");
        }
      }
    }
Exemplo n.º 2
0
  public void initStatesList(GameContainer container) throws SlickException {
    Sui.setTheme(new BitterLemonTheme());
    SimpleSkin.setRoundRectanglesEnabled(true);
    singleton = new Display(container);
    singleton.setSendingGlobalEvents(false);

    Frame window = new Frame("Singleton Window");
    window.setSize(200, 150);
    window.setLocation(100, 100);
    window.setVisible(true);

    final CheckBox box = new CheckBox("Are you sure?");
    box.pack();
    box.setLocation(10, 25);
    window.add(box);
    window.setMinimumSize(150, 70);

    singletonWindows.add(window);
    singleton.add(window);

    this.addState(new State1());
    this.addState(new State2());
    this.addState(new State3());
  }