Exemplo n.º 1
0
  public GetDataFrame(PlayableApplet anApplet, AppletRecorder ar) {
    // call base class constructor
    super("Get Student Data");
    theApplet = anApplet;
    theAR = ar;

    resize(212, 206);
    start = new Button("Start");
    step = new Button("Step");
    step.disable();
    close = new Button("Cancel");

    makeSessionList();

    buttonsPanel = new Panel();
    buttonsPanel.add("West", start);
    buttonsPanel.add("Center", step);
    buttonsPanel.add("East", close);

    sessionsPanel = new Panel();
    sessionsPanel.resize(150, 150);
    sessionsPanel.add("Center", sessionList);

    add("North", new Label("Select a Session:", Label.LEFT));
    add("Center", sessionsPanel);
    add("South", buttonsPanel);

    show();
  }
Exemplo n.º 2
0
  public void layoutContainer(Container obj) {
    Rectangle r = obj.bounds();
    int width = r.width - TF_LEFT + TF_RIGHT;
    if (width < 0) return;

    int height = r.height - TF_TOP + TF_BOTTOM;
    if (height < 0) return;

    int col = TF_LEFT;
    int row = 0;

    if (iTabsPosition == TOP) row = TF_TOP;
    else row = TF_TOP - TF_BTN_HEIGHT;

    oobj.move(col + 1, row + 1);

    // oobj.move(0,0);
    oobj.resize(width - 3, height - 3);

    if (iTabsPosition == TOP) {

      dbLeft.move(r.width - 33 + TF_RIGHT, TF_TOP - 16);
      dbRight.move(r.width - 16 + TF_RIGHT, TF_TOP - 16);
      dbLeft.resize(16, 15);
      dbRight.resize(16, 15);
    } else {
      dbLeft.move(r.width - 33 + TF_RIGHT, r.height + TF_BOTTOM - TF_BTN_HEIGHT);
      dbRight.move(r.width - 16 + TF_RIGHT, r.height + TF_BOTTOM - TF_BTN_HEIGHT);
      dbLeft.resize(16, 15);
      dbRight.resize(16, 15);
    }
    repaint();
  }