99 lines
3.0 KiB
Java
99 lines
3.0 KiB
Java
package org.hwo.pulscounter.ui;
|
|
|
|
import java.awt.EventQueue;
|
|
|
|
import javax.swing.JFrame;
|
|
import java.awt.GridBagLayout;
|
|
import javax.swing.JButton;
|
|
import java.awt.GridBagConstraints;
|
|
import java.awt.Insets;
|
|
import java.awt.event.ActionListener;
|
|
import java.awt.event.ActionEvent;
|
|
|
|
public class MainWindow {
|
|
|
|
private JFrame frame;
|
|
|
|
/**
|
|
* Launch the application.
|
|
*/
|
|
public static void main(String[] args) {
|
|
EventQueue.invokeLater(new Runnable() {
|
|
public void run() {
|
|
try {
|
|
MainWindow window = new MainWindow();
|
|
window.frame.setVisible(true);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Create the application.
|
|
*/
|
|
public MainWindow() {
|
|
initialize();
|
|
}
|
|
|
|
/**
|
|
* Initialize the contents of the frame.
|
|
*/
|
|
private void initialize() {
|
|
frame = new JFrame();
|
|
frame.setBounds(100, 100, 655, 444);
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
GridBagLayout gridBagLayout = new GridBagLayout();
|
|
gridBagLayout.columnWidths = new int[]{0, 0, 0};
|
|
gridBagLayout.rowHeights = new int[]{0, 0, 0};
|
|
gridBagLayout.columnWeights = new double[]{1.0, 1.0, Double.MIN_VALUE};
|
|
gridBagLayout.rowWeights = new double[]{1.0, 1.0, Double.MIN_VALUE};
|
|
frame.getContentPane().setLayout(gridBagLayout);
|
|
|
|
JButton btnNewButton = new JButton("Live Ansicht");
|
|
btnNewButton.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
|
LiveViewFrame lvf = new LiveViewFrame();
|
|
lvf.setVisible(true);
|
|
}
|
|
});
|
|
GridBagConstraints gbc_btnNewButton = new GridBagConstraints();
|
|
gbc_btnNewButton.fill = GridBagConstraints.BOTH;
|
|
gbc_btnNewButton.insets = new Insets(0, 0, 5, 5);
|
|
gbc_btnNewButton.gridx = 0;
|
|
gbc_btnNewButton.gridy = 0;
|
|
frame.getContentPane().add(btnNewButton, gbc_btnNewButton);
|
|
|
|
JButton btnAuswertung = new JButton("Auswertung");
|
|
GridBagConstraints gbc_btnAuswertung = new GridBagConstraints();
|
|
gbc_btnAuswertung.fill = GridBagConstraints.BOTH;
|
|
gbc_btnAuswertung.insets = new Insets(0, 0, 5, 0);
|
|
gbc_btnAuswertung.gridx = 1;
|
|
gbc_btnAuswertung.gridy = 0;
|
|
frame.getContentPane().add(btnAuswertung, gbc_btnAuswertung);
|
|
|
|
JButton btnZhlerKonfigurieren = new JButton("Zähler konfigurieren");
|
|
GridBagConstraints gbc_btnZhlerKonfigurieren = new GridBagConstraints();
|
|
gbc_btnZhlerKonfigurieren.fill = GridBagConstraints.BOTH;
|
|
gbc_btnZhlerKonfigurieren.insets = new Insets(0, 0, 0, 5);
|
|
gbc_btnZhlerKonfigurieren.gridx = 0;
|
|
gbc_btnZhlerKonfigurieren.gridy = 1;
|
|
frame.getContentPane().add(btnZhlerKonfigurieren, gbc_btnZhlerKonfigurieren);
|
|
|
|
JButton btnEinstellungen = new JButton("Einstellungen");
|
|
btnEinstellungen.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
|
AppSettingsFrame asf = new AppSettingsFrame();
|
|
asf.setVisible(true);
|
|
}
|
|
});
|
|
GridBagConstraints gbc_btnEinstellungen = new GridBagConstraints();
|
|
gbc_btnEinstellungen.fill = GridBagConstraints.BOTH;
|
|
gbc_btnEinstellungen.gridx = 1;
|
|
gbc_btnEinstellungen.gridy = 1;
|
|
frame.getContentPane().add(btnEinstellungen, gbc_btnEinstellungen);
|
|
}
|
|
|
|
}
|