Exemplo n.º 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);
  }
Exemplo n.º 2
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);
  }
  private void createGUI() {

    parent = new CustomFrame();
    parent.setTitle("Parent");
    parent.setLocation(50, 50);

    dialog = new CustomDialog(parent);
    dialog.setTitle("Dialog");
    dialog.setModalityType((Dialog.ModalityType) null);
    dialog.setLocation(250, 50);

    frame = new TestFrame();
    frame.setTitle("Frame");
    frame.setLocation(50, 250);

    window = new TestWindow(frame);
    window.setLocation(250, 250);

    parent.setVisible(true);
  }