Example #1
0
  /** Construct a new "about…" dialog */
  public DialogAbout(MDIManager mdimgr) {

    buttonOk = new JButton(localize("button.OK"));
    buttonOk.addActionListener(this);

    JPanel buttonPanel = new JPanel(new FlowLayout(), false);
    buttonPanel.add(buttonOk);

    JPanel logoPanel = new JPanel(new FlowLayout(), false);
    logoPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
    logoPanel.add(PEToolKit.createJLabel("Frankenstein"));

    JPanel infoPanel = new JPanel(new GridLayout(9, 1, 5, 5), true);
    infoPanel.setBorder(new EmptyBorder(10, 60, 10, 10));
    infoPanel.add(
        new JLabel("jPicEdt " + Version.getVersion() + " Built " + Version.getBuildDate()));
    infoPanel.add(new JLabel(localize("about.APictureEditorFor")));
    final String[] addressLines = {
      "(c) Sylvain Reynal",
      "É.N.S.É.A. - Dept. of Physics",
      "6, avenue du Ponceau",
      "F-95014 CERGY Cedex",
      "Fax: +33 (0) 130 736 667",
      "*****@*****.**",
      "http://www.jpicedt.org"
    };
    for (String addressLine : addressLines) infoPanel.add(new JLabel(addressLine));

    JTabbedPane caveatPanel = new JTabbedPane();
    String[] tabKeys = {"license.lines", "license.thirdparty.lines"};
    for (String tabKey : tabKeys) {
      JEditorPane caveatTA = new JEditorPane();
      caveatTA.setContentType("text/html; charset=" + localize(tabKey + ".encoding"));
      caveatTA.setEditable(false);
      caveatTA.setPreferredSize(new Dimension(485, 300));
      JScrollPane scrollCaveat = new JScrollPane(caveatTA);
      caveatTA.setText(localize(tabKey));
      caveatPanel.addTab(localize(tabKey + ".tabname"), null, scrollCaveat, null);
    }

    caveatPanel.setBorder(BorderFactory.createEtchedBorder());

    JPanel upperPanel = new JPanel(new BorderLayout(), false);
    upperPanel.add(logoPanel, BorderLayout.WEST);
    upperPanel.add(infoPanel, BorderLayout.CENTER);
    upperPanel.add(caveatPanel, BorderLayout.SOUTH);
    upperPanel.setBorder(BorderFactory.createEtchedBorder());

    JPanel contentPane = new JPanel(new BorderLayout(5, 5));
    contentPane.add(upperPanel, BorderLayout.NORTH);
    contentPane.add(buttonPanel, BorderLayout.SOUTH);

    String title = localize("about.AboutPicEdt") + " " + Version.getVersion();
    boolean modal = true;
    frame = mdimgr.createDialog(title, modal, contentPane);
    frame.setResizable(true);
    frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    Dimension dlgSize = frame.getPreferredSize();
    frame.setSize(dlgSize);

    // this.pack();
    frame.setVisible(true);
  }
Example #2
0
 public void actionPerformed(ActionEvent e) {
   if (e.getSource() == buttonOk) {
     frame.dispose();
   }
 }