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

    // We initialize our layout
    layout = new GridBagLayout();
    gbConstraints = new GridBagConstraints();
    setLayout(layout);

    // We add the components

    infoLabel =
        LabelFactory.create(
            parent.langpack.getString("InfoPanel.info"),
            parent.icons.getImageIcon("edit"),
            JLabel.TRAILING);
    parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0);
    gbConstraints.insets = new Insets(5, 5, 5, 5);
    gbConstraints.fill = GridBagConstraints.BOTH;
    gbConstraints.anchor = GridBagConstraints.SOUTHWEST;
    layout.addLayoutComponent(infoLabel, gbConstraints);
    add(infoLabel);

    textArea = new JTextArea();
    textArea.setEditable(false);
    JScrollPane scroller = new JScrollPane(textArea);
    parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 0.9);
    gbConstraints.anchor = GridBagConstraints.CENTER;
    layout.addLayoutComponent(scroller, gbConstraints);
    add(scroller);
  }
コード例 #2
0
  /**
   * The constructor.
   *
   * @param parent The parent.
   * @param idata The installation data.
   */
  public HTMLInfoPanel(InstallerFrame parent, InstallData idata) {
    super(parent, idata);

    // We initialize our layout
    layout = new GridBagLayout();
    gbConstraints = new GridBagConstraints();
    setLayout(layout);

    // We add the components

    infoLabel =
        new JLabel(
            parent.langpack.getString("InfoPanel.info"),
            parent.icons.getImageIcon("edit"),
            JLabel.TRAILING);
    parent.buildConstraints(gbConstraints, 0, 0, 1, 1, 1.0, 0.0);
    gbConstraints.insets = new Insets(5, 5, 5, 5);
    gbConstraints.fill = GridBagConstraints.NONE;
    gbConstraints.anchor = GridBagConstraints.SOUTHWEST;
    layout.addLayoutComponent(infoLabel, gbConstraints);
    add(infoLabel);

    try {
      textArea = new JEditorPane();
      textArea.setEditable(false);
      textArea.addHyperlinkListener(this);
      JScrollPane scroller = new JScrollPane(textArea);
      textArea.setPage(loadInfo());
      parent.buildConstraints(gbConstraints, 0, 1, 1, 1, 1.0, 1.0);
      gbConstraints.anchor = GridBagConstraints.CENTER;
      gbConstraints.fill = GridBagConstraints.BOTH;
      layout.addLayoutComponent(scroller, gbConstraints);
      add(scroller);
    } catch (Exception err) {
      err.printStackTrace();
    }
  }
コード例 #3
0
  /**
   * The constructor.
   *
   * @param idata The installation data.
   * @param parent Description of the Parameter
   */
  public HTMLLicencePanel(InstallerFrame parent, InstallData idata) {
    super(parent, idata);

    // We initialize our layout
    layout = new GridBagLayout();
    gbConstraints = new GridBagConstraints();
    setLayout(layout);

    // We load the licence
    loadLicence();

    // We put our components

    infoLabel =
        LabelFactory.create(
            parent.langpack.getString("LicencePanel.info"),
            parent.icons.getImageIcon("history"),
            JLabel.TRAILING);
    parent.buildConstraints(gbConstraints, 0, 0, 2, 1, 1.0, 0.0);
    gbConstraints.insets = new Insets(5, 5, 5, 5);
    gbConstraints.fill = GridBagConstraints.NONE;
    gbConstraints.anchor = GridBagConstraints.WEST;
    layout.addLayoutComponent(infoLabel, gbConstraints);
    add(infoLabel);

    try {
      textArea = new JEditorPane();
      textArea.setEditable(false);
      textArea.addHyperlinkListener(this);
      JScrollPane scroller = new JScrollPane(textArea);
      textArea.setPage(loadLicence());
      parent.buildConstraints(gbConstraints, 0, 1, 2, 1, 1.0, 1.0);
      gbConstraints.anchor = GridBagConstraints.CENTER;
      gbConstraints.fill = GridBagConstraints.BOTH;
      layout.addLayoutComponent(scroller, gbConstraints);
      add(scroller);
    } catch (Exception err) {
      err.printStackTrace();
    }

    ButtonGroup group = new ButtonGroup();

    yesRadio = new JRadioButton(parent.langpack.getString("LicencePanel.agree"), false);
    group.add(yesRadio);
    parent.buildConstraints(gbConstraints, 0, 2, 1, 1, 1.0, 0.0);
    gbConstraints.anchor = GridBagConstraints.WEST;
    gbConstraints.fill = GridBagConstraints.NONE;
    layout.addLayoutComponent(yesRadio, gbConstraints);
    add(yesRadio);
    yesRadio.addActionListener(this);

    noRadio = new JRadioButton(parent.langpack.getString("LicencePanel.notagree"), true);
    group.add(noRadio);
    parent.buildConstraints(gbConstraints, 0, 3, 1, 1, 1.0, 0.0);
    gbConstraints.anchor = GridBagConstraints.WEST;
    gbConstraints.fill = GridBagConstraints.NONE;
    gbConstraints.insets = new Insets(0, 5, 5, 5);
    layout.addLayoutComponent(noRadio, gbConstraints);
    add(noRadio);
    noRadio.addActionListener(this);
    setInitialFocus(textArea);
  }