コード例 #1
0
  /**
   * The constructor.
   *
   * @param parent The parent window.
   * @param idata The installation data.
   */
  public SudoPanel(InstallerFrame parent, InstallData idata) {
    super(parent, idata);

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

    add(
        new JLabel(
            /*parent.langpack.getString("SudoPanel.info")*/ "For installing administrator privileges are necessary",
            JLabel.TRAILING));

    add(Box.createRigidArea(new Dimension(0, 5)));

    add(
        new JLabel(
            /*parent.langpack.getString("SudoPanel.tip")*/ "Please note that passwords are case-sensitive",
            parent.icons.getImageIcon("tip"),
            JLabel.TRAILING));

    add(Box.createRigidArea(new Dimension(0, 5)));

    JPanel spacePanel = new JPanel();
    spacePanel.setAlignmentX(LEFT_ALIGNMENT);
    spacePanel.setAlignmentY(CENTER_ALIGNMENT);
    spacePanel.setBorder(BorderFactory.createEmptyBorder(80, 30, 0, 50));
    spacePanel.setLayout(new BorderLayout(5, 5));
    spacePanel.add(
        new JLabel(
            /*parent.langpack.getString("SudoPanel.specifyAdminPassword")*/ "Please specify your password:"),
        BorderLayout.NORTH);
    passwordField = new JPasswordField();
    passwordField.addActionListener(this);
    JPanel space2Panel = new JPanel();
    space2Panel.setLayout(new BorderLayout());
    space2Panel.add(passwordField, BorderLayout.NORTH);
    space2Panel.add(Box.createRigidArea(new Dimension(0, 5)), BorderLayout.CENTER);
    spacePanel.add(space2Panel, BorderLayout.CENTER);
    add(spacePanel);
  }
コード例 #2
0
  /**
   * The constructor.
   *
   * @param parent The parent.
   * @param idata The installation data.
   */
  public FinishPanel(InstallerFrame parent, InstallData idata) {
    super(parent, idata);

    vs = new VariableSubstitutor(idata.getVariableValueMap());

    // The 'super' layout
    GridBagLayout superLayout = new GridBagLayout();
    setLayout(superLayout);
    GridBagConstraints gbConstraints = new GridBagConstraints();
    gbConstraints.insets = new Insets(0, 0, 0, 0);
    gbConstraints.fill = GridBagConstraints.NONE;
    gbConstraints.anchor = GridBagConstraints.CENTER;

    // We initialize our 'real' layout
    centerPanel = new JPanel();
    layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
    centerPanel.setLayout(layout);
    superLayout.addLayoutComponent(centerPanel, gbConstraints);
    add(centerPanel);
  }