net.sf.microlog.server.btspp.gui.AboutDialog Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of microlog-server-bluetooth
Show all versions of microlog-server-bluetooth
A Bluetooth server for Microlog with a GUI.
package net.sf.microlog.server.btspp.gui;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;
public class AboutDialog extends JDialog {
private static final long serialVersionUID = -7774906639142895613L;
private final JPanel contentPanel = new JPanel();
/**
* Launch the application.
*/
public static void main(String[] args) {
try {
AboutDialog dialog = new AboutDialog();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog.
*/
public AboutDialog() {
setResizable(false);
setTitle("About");
setBounds(100, 100, 402, 263);
getContentPane().setLayout(new BorderLayout());
contentPanel.setLayout(new BorderLayout(0, 0));
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
{
JLabel lblThisIsA = new JLabel("Microlog Bluetooth Server GUI by Johan Karlsson");
lblThisIsA.setHorizontalAlignment(SwingConstants.CENTER);
contentPanel.add(lblThisIsA, BorderLayout.CENTER);
}
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
JButton okButton = new JButton("OK");
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
okButton.setActionCommand("OK");
buttonPane.add(okButton);
getRootPane().setDefaultButton(okButton);
}
}
}
}