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

📄 aboutdialog1.java

📁 UAV导航及控制,是老外编写的一个源代码开放程序
💻 JAVA
字号:
/* Generated by Together */

package net.sf.autopilot.downlink.groundstation;

import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import java.awt.Frame;
import java.awt.Rectangle;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.WindowEvent;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class AboutDialog1 extends JDialog {
        private String title = "About GCS";
        private String product = "telemetry client";
        private String version = "$Id: AboutDialog1.java,v 1.1 2002/07/14 04:31:52 dennisda Exp $";
        private String copyright = "GPL(ed) code";
        private String comments = " telemetry broadcast\nand reception\nsystem.";
        private JPanel contentPane = new JPanel();
        private JLabel prodLabel = new JLabel();
        private JLabel verLabel = new JLabel();
        private JLabel copLabel = new JLabel();
        private JTextArea commentField = new JTextArea();
        private JPanel btnPanel = new JPanel();
        private JButton okButton = new JButton();
        private JLabel image = new JLabel();
        private BorderLayout formLayout = new BorderLayout();
        private GridBagLayout contentPaneLayout = new GridBagLayout();
        private FlowLayout btnPaneLayout = new FlowLayout();

        /** Creates new About Dialog */
        public AboutDialog1(Frame parent, boolean modal) {
                super(parent, modal);
                initGUI();
                pack();
        }

        public AboutDialog1() {
                super();
                setModal(true);
                initGUI();
                pack();
        }

        /** This method is called from within the constructor to initialize the dialog. */
        private void initGUI() {
                addWindowListener(
                    new java.awt.event.WindowAdapter() {
                            public void windowClosing(WindowEvent evt) {
                                    closeDialog(evt);
                            }
                    });
                getContentPane().setLayout(formLayout);
                contentPane.setLayout(contentPaneLayout);
                contentPane.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
                prodLabel.setText(product);
                contentPane.add(prodLabel,
                    new GridBagConstraints(GridBagConstraints.RELATIVE, GridBagConstraints.RELATIVE,
                    GridBagConstraints.REMAINDER, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                    new Insets(5, 0, 0, 0), 0, 0));
                verLabel.setText(version);
                contentPane.add(verLabel,
                    new GridBagConstraints(GridBagConstraints.RELATIVE, GridBagConstraints.RELATIVE,
                    GridBagConstraints.REMAINDER, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                    new Insets(5, 0, 0, 0), 0, 0));
                copLabel.setText(copyright);
                contentPane.add(copLabel,
                    new GridBagConstraints(GridBagConstraints.RELATIVE, GridBagConstraints.RELATIVE,
                    GridBagConstraints.REMAINDER, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                    new Insets(5, 0, 0, 0), 0, 0));
                commentField.setBackground(getBackground());
                commentField.setForeground(copLabel.getForeground());
                commentField.setFont(copLabel.getFont());
                commentField.setText(comments);
                commentField.setEditable(false);
                contentPane.add(commentField,
                    new GridBagConstraints(GridBagConstraints.RELATIVE, GridBagConstraints.RELATIVE,
                    GridBagConstraints.REMAINDER, 3, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
                    new Insets(5, 0, 0, 0), 0, 0));
                image.setText("[Your image]");
                getContentPane().add(image, BorderLayout.WEST);
                getContentPane().add(contentPane, BorderLayout.CENTER);
                btnPanel.setLayout(btnPaneLayout);
                okButton.setText("OK");
                okButton.addActionListener(
                    new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                    setVisible(false);
                                    dispose();
                            }
                    });
                btnPanel.add(okButton);
                getContentPane().add(btnPanel, BorderLayout.SOUTH);
                setTitle(title);
                setResizable(false);
        }

        /** Closes the dialog */
        private void closeDialog(WindowEvent evt) {
                setVisible(false);
                dispose();
        }
}

⌨️ 快捷键说明

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