コード例 #1
0
 protected void layoutWidgets() {
   final int totalHeight = 11 + 5 + 20 + 5 + 20;
   int top = height / 2 - totalHeight / 2;
   labelTitle.setWidth(200).setHeight(11).setX(width / 2 - 100).setY(top);
   top += 16;
   textText.setWidth(200).setHeight(20).setX(width / 2 - 100).setY(top);
   top += 25;
   buttonCancel.setWidth(95).setHeight(20).setX(width / 2 - 100).setY(top);
   buttonDone.setWidth(100).setHeight(20).setX(width / 2).setY(top);
 }
コード例 #2
0
  protected void createInstances() {
    labelTitle = new GenericLabel(title);
    textText = new GenericTextField();
    textText.setWidth(200);
    textText.setText(text);

    buttonCancel = new GenericButton("Cancel");
    buttonDone = new GenericButton("Done");

    getScreen().attachWidgets("Spoutcraft", labelTitle, textText, buttonCancel, buttonDone);
  }