package sip; import java.awt.EventQueue; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JTextField; public class SIPGui { private JFrame frame; private JTextField textField; /** * Launch the application. */ public static void main(String[] args) { /* * ShutdownHook für das Reagieren auf das Programmende * registrieren. */ // Thread mit Objekt von ShutdownTask erzeugen Thread shutdownThread = new Thread(new ShutdownTask()); // Thread registrieren bei der Runtime Runtime.getRuntime().addShutdownHook(shutdownThread); EventQueue.invokeLater(new Runnable() { public void run() { try { SIPGui window = new SIPGui(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public SIPGui() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 761, 499); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{0, 0}; gridBagLayout.rowHeights = new int[]{0, 0}; gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE}; gridBagLayout.rowWeights = new double[]{1.0, Double.MIN_VALUE}; frame.getContentPane().setLayout(gridBagLayout); JPanel panel = new JPanel(); GridBagConstraints gbc_panel = new GridBagConstraints(); gbc_panel.fill = GridBagConstraints.BOTH; gbc_panel.gridx = 0; gbc_panel.gridy = 0; frame.getContentPane().add(panel, gbc_panel); panel.setLayout(new GridLayout(0, 2, 0, 0)); JTextArea textArea = new JTextArea(); textArea.setEditable(false); panel.add(textArea); JPanel panel_1 = new JPanel(); panel.add(panel_1); GridBagLayout gbl_panel_1 = new GridBagLayout(); gbl_panel_1.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; gbl_panel_1.rowHeights = new int[]{0, 0, 0, 0, 0, 0}; gbl_panel_1.columnWeights = new double[]{1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; gbl_panel_1.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; panel_1.setLayout(gbl_panel_1); JLabel lblNewLabel = new JLabel("Participant"); GridBagConstraints gbc_lblNewLabel = new GridBagConstraints(); gbc_lblNewLabel.anchor = GridBagConstraints.WEST; gbc_lblNewLabel.gridwidth = 3; gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel.gridx = 4; gbc_lblNewLabel.gridy = 0; panel_1.add(lblNewLabel, gbc_lblNewLabel); textField = new JTextField(); GridBagConstraints gbc_textField = new GridBagConstraints(); gbc_textField.gridwidth = 11; gbc_textField.insets = new Insets(0, 0, 5, 5); gbc_textField.fill = GridBagConstraints.HORIZONTAL; gbc_textField.gridx = 4; gbc_textField.gridy = 1; panel_1.add(textField, gbc_textField); textField.setColumns(10); JButton btnQuit = new JButton("Quit"); btnQuit.setEnabled(false); btnQuit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { } }); JButton btnInvite = new JButton("Invite"); GridBagConstraints gbc_btnInvite = new GridBagConstraints(); gbc_btnInvite.anchor = GridBagConstraints.EAST; gbc_btnInvite.insets = new Insets(0, 0, 5, 5); gbc_btnInvite.gridwidth = 2; gbc_btnInvite.gridx = 11; gbc_btnInvite.gridy = 2; panel_1.add(btnInvite, gbc_btnInvite); GridBagConstraints gbc_btnQuit = new GridBagConstraints(); gbc_btnQuit.insets = new Insets(0, 0, 5, 5); gbc_btnQuit.anchor = GridBagConstraints.WEST; gbc_btnQuit.gridwidth = 2; gbc_btnQuit.gridx = 13; gbc_btnQuit.gridy = 2; panel_1.add(btnQuit, gbc_btnQuit); JLabel lblNewLabel_1 = new JLabel("Number uas sessions:"); GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints(); gbc_lblNewLabel_1.fill = GridBagConstraints.BOTH; gbc_lblNewLabel_1.gridwidth = 3; gbc_lblNewLabel_1.insets = new Insets(0, 0, 0, 5); gbc_lblNewLabel_1.gridx = 4; gbc_lblNewLabel_1.gridy = 4; panel_1.add(lblNewLabel_1, gbc_lblNewLabel_1); JLabel lblUASSessions = new JLabel("0"); GridBagConstraints gbc_lblUASSessions = new GridBagConstraints(); gbc_lblUASSessions.anchor = GridBagConstraints.WEST; gbc_lblUASSessions.gridwidth = 5; gbc_lblUASSessions.insets = new Insets(0, 0, 0, 5); gbc_lblUASSessions.gridx = 8; gbc_lblUASSessions.gridy = 4; panel_1.add(lblUASSessions, gbc_lblUASSessions); } }