📄 ventanaservidor.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. *//* * ventanaServidor.java * * Created on 26/03/2009, 10:56:52 PM */package vista;import controlador.servidor;import java.io.IOException;import java.util.Vector;import java.util.logging.Level;import java.util.logging.Logger;/** * * @author Camilo Andres */public class ventanaServidor extends javax.swing.JFrame { private servidor server; /** Creates new form ventanaServidor */ public ventanaServidor() { initComponents(); setVisible(true); try { //crea el servidor y le envia esta ventana server = new servidor(this); } catch (IOException ex) { Logger.getLogger(ventanaServidor.class.getName()).log(Level.SEVERE, null, ex); } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane2 = new javax.swing.JScrollPane(); TAEventos = new javax.swing.JTextArea(); jScrollPane1 = new javax.swing.JScrollPane(); TAConectados = new javax.swing.JTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); jScrollPane2.setBorder(javax.swing.BorderFactory.createTitledBorder("Eventos")); TAEventos.setColumns(20); TAEventos.setRows(5); jScrollPane2.setViewportView(TAEventos); jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("Conectados")); TAConectados.setColumns(20); TAConectados.setRows(5); jScrollPane1.setViewportView(TAConectados); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextArea TAConectados; private javax.swing.JTextArea TAEventos; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; // End of variables declaration//GEN-END:variables /** * metodo para mostrar la lista de contactos. * @param lista */ public void agregarConectado(String datos) { TAConectados.append(datos+"\n"); } /** * metodo para mostrar los eventos del servidor * en el TextArea. */ public void agregarEvento(String descripcion) { TAEventos.append(descripcion+"\n"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -