예제 #1
0
  private void createGUI(DialogOwner owner) {

    switch (owner) {
      case HIDDEN_DIALOG:
        parentDialog = new Dialog((Frame) null);
        dialog = new TestDialog(parentDialog);
        break;
      case NULL_DIALOG:
        dialog = new TestDialog((Dialog) null);
        break;
      case HIDDEN_FRAME:
        parentFrame = new Frame();
        dialog = new TestDialog(parentFrame);
        break;
      case NULL_FRAME:
        dialog = new TestDialog((Frame) null);
        break;
    }

    assertFalse(dialog == null, "error: null dialog");

    dialog.setLocation(50, 50);
    if (setModal) {
      dialog.setModal(true);
    } else if (modalityType != null) {
      dialog.setModalityType(modalityType);
    }

    dialog.setVisible(true);
  }
예제 #2
0
  private void showParent() {

    parent = new TestDialog((Frame) null);
    parent.setTitle("Parent");
    parent.setLocation(50, 50);
    parent.setVisible(true);
  }
예제 #3
0
  private void showChild() {

    dialog = new TestDialog(parent);
    if (setModal) {
      dialog.setModal(true);
    } else if (modalityType != null) {
      dialog.setModalityType(modalityType);
    }

    dialog.setLocation(250, 50);
    dialog.setVisible(true);
  }