⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aboutdialog.java

📁 JavaExplorer是一个独立于平台的浏览器
💻 JAVA
字号:
/**  * File and FTP Explorer  * Copyright 2002  * BOESCH Vincent  *  * This program is free software; you can redistribute it and/or  * modify it under the terms of the GNU General Public License  * as published by the Free Software Foundation; either version 2  * of the License, or (at your option) any later version.  *  * This program is distributed in the hope that it will be useful,  * but WITHOUT ANY WARRANTY; without even the implied warranty of  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  * GNU General Public License for more details.  *  * You should have received a copy of the GNU General Public License  * along with this program; if not, write to the Free Software  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  */package javaexplorer.gui.dialog;import java.awt.*;import java.awt.event.*;import java.util.*;import javaexplorer.Launcher;import javaexplorer.ressource.*;import javaexplorer.util.Log;import javax.swing.*;import javax.swing.table.*;/** *@author     BOESCH Vincent *@created    21 janvier 2002 *@version    3.3 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. * */public class AboutDialog extends JDialog implements ActionListener {    private Launcher _launcher = null;    BorderLayout borderLayout1 = new BorderLayout();    BorderLayout borderLayout2 = new BorderLayout();    GridLayout gridLayout1 = new GridLayout();    JButton jButton1 = new JButton();    JLabel jLabel1 = new JLabel();    JLabel jLabel2 = new JLabel();    JLabel jLabel3 = new JLabel();    JLabel jLabel4 = new JLabel();    JLabel jLabelImage = new JLabel();    JPanel jPanel1 = new JPanel();    JPanel jPanel2 = new JPanel();    JPanel jPanel3 = new JPanel();    JTabbedPane jTabbedPane1 = new JTabbedPane();    JTextArea jTextArea1 = new JTextArea();    JScrollPane jsp = null;    JTable jtb = new JTable();    /**     *  Constructor for the AboutDialog object     *     *@param  frame     Description of the     *      Parameter     *@param  launcher  Description of the     *      Parameter     */    public AboutDialog(JFrame frame, Launcher launcher) {        super(frame, true);        _launcher = launcher;        try {            jbInit();        } catch (Exception e) {            Log.addError(e);        }    }    /**     *  Description de la methode     *     *@param  e  Description of the Parameter     */    public void actionPerformed(ActionEvent e) {        for (int i = 0; i < 10; i++) {            //appels successif permettant de liberer le plus de m閙oire possible            System.gc();            System.runFinalization();        }        Runtime r = Runtime.getRuntime();        long tot = r.totalMemory();        long free = r.freeMemory();        jLabel2.setText("" + (float) (((double) tot) / (double) 1024) + " Ko");        double percent = (((double) (tot - free)) / (double) tot) * (double) 100;        jLabel4.setText("" + (float) percent + " %");    }    /**     *  Description of the Method     *     *@exception  Exception  Description of     *      Exception     */    private void jbInit() throws Exception {        setTitle(Launcher.APPNAME + " " + Launcher.VERSION + " " +            Launcher.YEAR);        jPanel1.setLayout(borderLayout1);        jTextArea1.setText("");        jPanel2.setLayout(borderLayout2);        jPanel3.setLayout(gridLayout1);        gridLayout1.setColumns(5);        jLabel1.setText("Memory :");        Runtime r = Runtime.getRuntime();        long tot = r.totalMemory();        long free = r.freeMemory();        jLabel2.setText("" + (float) (((double) tot) / (double) 1024) + " Ko");        jLabel2.setAlignmentX(JLabel.RIGHT_ALIGNMENT);        jLabel3.setText("Used :");        double percent = (((double) (tot - free)) / (double) tot) * (double) 100;        jLabel4.setText("" + (float) percent + " %");        jLabel4.setAlignmentX(JLabel.RIGHT_ALIGNMENT);        jButton1.setText(TextRessource.ABOUTSCREEN_FORCE_GC);        jButton1.addActionListener(this);        this.getContentPane().add(jTabbedPane1, BorderLayout.CENTER);        jTabbedPane1.add(jPanel1, "Copyright");        jLabelImage.setIcon(ImageRessource.iiJavaExplorer);        jTextArea1.setText(Launcher.APPNAME + " " + Launcher.VERSION + "\n" +            "Copyright " + Launcher.AUTHOR + " " + Launcher.YEAR + "\n\n" +            Launcher.DESCRIPTION + "\n\n" + "Released under " +            Launcher.LICENSE);        jTextArea1.setBorder(new javax.swing.border.LineBorder(Color.black));        jPanel1.add(jTextArea1, BorderLayout.CENTER);        jPanel1.add(jLabelImage, BorderLayout.WEST);        listProperties();        jsp = new JScrollPane(jtb);        jTabbedPane1.add(jPanel2, TextRessource.ABOUTSCREEN_JVM_PROPERTIES);        jPanel2.add(jsp, BorderLayout.CENTER);        jPanel2.add(jPanel3, BorderLayout.SOUTH);        jPanel3.add(jLabel1, null);        jPanel3.add(jLabel2, null);        jPanel3.add(jLabel3, null);        jPanel3.add(jLabel4, null);        jPanel3.add(jButton1, null);        setBounds(100, 100, 400, 300);        setVisible(true);    }    /**     *  Description of the Method     */    private void listProperties() {        String name = null;        String val = null;        int rowcount = 0;        Properties prop = System.getProperties();        String[] title = { "Propri閠

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -