コード例 #1
0
  @Override
  public JComponent layoutDialogContent() {

    final JPanel cp = new JPanel(new MigLayout("ins 0,wrap 1", "[fill]", "[][]"));
    this.textField =
        new JTextPane() {
          private static final long serialVersionUID = 1L;

          @Override
          public boolean getScrollableTracksViewportWidth() {
            return !BinaryLogic.containsAll(ExceptionDialog.this.flagMask, Dialog.STYLE_LARGE);
          }
        };
    if (BinaryLogic.containsAll(this.flagMask, Dialog.STYLE_HTML)) {
      this.textField.setContentType("text/html");
      this.textField.addHyperlinkListener(
          new HyperlinkListener() {

            public void hyperlinkUpdate(final HyperlinkEvent e) {
              if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                CrossSystem.openURL(e.getURL());
              }
            }
          });
    } else {
      this.textField.setContentType("text");
      // this.textField.setMaximumSize(new Dimension(450, 600));
    }

    this.textField.setText(this.message);
    this.textField.setEditable(false);
    this.textField.setBackground(null);
    this.textField.setOpaque(false);
    this.textField.putClientProperty("Synthetica.opaque", Boolean.FALSE);
    this.textField.setCaretPosition(0);
    cp.add(new JLabel(AWUTheme.I().getIcon(Dialog.ICON_ERROR, 32)), "width 32!,split 2");
    if (BinaryLogic.containsAll(this.flagMask, Dialog.STYLE_LARGE)) {
      cp.add(new JScrollPane(this.textField), "pushx,growx");
    } else {
      cp.add(this.textField, "pushx,growx");
    }

    this.logField = new JTextArea();
    this.logField.setLineWrap(false);

    this.logField.setEditable(true);
    this.logField.setAutoscrolls(true);
    this.scrollPane = new JScrollPane(this.logField);
    this.scrollPane.setVisible(false);
    this.logField.setEditable(true);
    this.logField.setAutoscrolls(true);
    this.logField.setForeground(Color.RED);
    this.logLabel = new JLabel(_AWU.T.ExceptionDialog_layoutDialogContent_logLabel());
    this.logLabel.setVisible(false);
    cp.add(this.logLabel, "hidemode 3,gaptop 5");

    cp.add(this.scrollPane, "hidemode 3,height 100:300:n,width 200:600:n,pushx,growx,pushy,growy");

    return cp;
  }
コード例 #2
0
  @Override
  public JComponent layoutDialogContent() {
    final JPanel contentpane = new JPanel(new MigLayout("ins 0,wrap 2", "[fill,grow]"));
    messageArea = new JTextPane();
    messageArea.setBorder(null);
    messageArea.setBackground(null);
    messageArea.setOpaque(false);
    messageArea.setText(message);
    messageArea.setEditable(false);
    messageArea.putClientProperty("Synthetica.opaque", Boolean.FALSE);

    contentpane.add("span 2", messageArea);
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_OLDPASSWORD()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input1 = new JPasswordField();
      input1.addKeyListener(this);
      input1.addMouseListener(this);
      contentpane.add(new JScrollPane(input1), "height 20:60:n,pushy,growy,w 250");
    } else {
      input1 = new JPasswordField();
      input1.setBorder(BorderFactory.createEtchedBorder());
      input1.addKeyListener(this);
      input1.addMouseListener(this);
      contentpane.add(input1, "pushy,growy,w 250");
    }
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_NEWPASSWORD()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input2 = new JPasswordField();
      input2.addKeyListener(this);
      input2.addMouseListener(this);
      contentpane.add(new JScrollPane(input2), "height 20:60:n,pushy,growy,w 250");
    } else {
      input2 = new JPasswordField();
      input2.setBorder(BorderFactory.createEtchedBorder());
      input2.addKeyListener(this);
      input2.addMouseListener(this);
      contentpane.add(input2, "pushy,growy,w 250");
    }
    contentpane.add(new JLabel(_AWU.T.PASSWORDDIALOG_PASSWORDCHANGE_NEWPASSWORD_REPEAT()));
    if (BinaryLogic.containsAll(flagMask, Dialog.STYLE_LARGE)) {
      input3 = new JPasswordField();
      input3.addKeyListener(this);
      input3.addMouseListener(this);
      contentpane.add(new JScrollPane(input3), "height 20:60:n,pushy,growy,w 250");
    } else {
      input3 = new JPasswordField();
      input3.setBorder(BorderFactory.createEtchedBorder());
      input3.addKeyListener(this);
      input3.addMouseListener(this);
      contentpane.add(input3, "pushy,growy,w 250");
    }

    return contentpane;
  }