75 lines
1.9 KiB
Plaintext
75 lines
1.9 KiB
Plaintext
package morse;
|
|
|
|
import java.awt.BorderLayout;
|
|
import java.awt.FlowLayout;
|
|
|
|
import javax.swing.JButton;
|
|
import javax.swing.JDialog;
|
|
import javax.swing.JPanel;
|
|
import javax.swing.border.EmptyBorder;
|
|
import java.awt.event.ActionListener;
|
|
import java.awt.event.ActionEvent;
|
|
import javax.swing.JLabel;
|
|
import javax.swing.border.TitledBorder;
|
|
|
|
public class About extends JDialog {
|
|
|
|
/**
|
|
*
|
|
*/
|
|
private static final long serialVersionUID = 1L;
|
|
private final JPanel contentPanel = new JPanel();
|
|
|
|
/**
|
|
* Launch the application.
|
|
*/
|
|
public static void main(String[] args) {
|
|
try {
|
|
About dialog = new About();
|
|
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
|
dialog.setVisible(true);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Create the dialog.
|
|
*/
|
|
public About() {
|
|
setUndecorated(true);
|
|
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
|
setBounds(100, 100, 450, 300);
|
|
getContentPane().setLayout(new BorderLayout());
|
|
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
getContentPane().add(contentPanel, BorderLayout.CENTER);
|
|
contentPanel.setLayout(null);
|
|
|
|
JPanel panel = new JPanel();
|
|
panel.setBorder(new TitledBorder(null, "About", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
|
panel.setBounds(5, 17, 436, 37);
|
|
contentPanel.add(panel);
|
|
panel.setLayout(null);
|
|
|
|
JLabel lblDeveloper = new JLabel("Marcel Kapfer");
|
|
lblDeveloper.setBounds(5, 17, 426, 15);
|
|
panel.add(lblDeveloper);
|
|
{
|
|
JPanel buttonPane = new JPanel();
|
|
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
|
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
|
{
|
|
JButton cancelButton = new JButton("Close");
|
|
cancelButton.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
|
setVisible(false);
|
|
dispose();
|
|
}
|
|
});
|
|
cancelButton.setActionCommand("Cancel");
|
|
buttonPane.add(cancelButton);
|
|
}
|
|
}
|
|
}
|
|
}
|