/** * Title: Multiserver
* Description:
* Copyright:
* Company:
* @author * @version 1.0 */ package MultiServer; import java.io.*; import java.net.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class AtividServer extends JFrame { JPanel contentPane; JLabel statusBar = new JLabel(); GridBagLayout gridBagLayout1 = new GridBagLayout(); JTextArea txtativ = new JTextArea(); JTextPane jTextPane1 = new JTextPane(); //Construct the frame public AtividServer() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(gridBagLayout1); this.setSize(new Dimension(400, 400)); this.setTitle("MultiServer Chat"); statusBar.setBorder(BorderFactory.createLineBorder(Color.black)); statusBar.setText(" xxxx "); txtativ.setLineWrap(true); txtativ.setBackground(SystemColor.info); txtativ.setBorder(BorderFactory.createLineBorder(Color.black)); jTextPane1.setBackground(Color.lightGray); jTextPane1.setBorder(null); jTextPane1.setText("Atividades do Servidor"); jTextPane1.setEditable(false); jTextPane1.setFont(new java.awt.Font("Serif", 1, 14)); // contentPane.add(statusBar, new GridBagConstraints(0, 4, 1, 2, 0.0, 0.0 // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 397, 7)); contentPane.add(txtativ, new GridBagConstraints(0, 2, 1, 2, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 236)); contentPane.add(jTextPane1, new GridBagConstraints(0, 0, 1, 2, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 138, 0)); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } }