Ya se encuentra disponible la plataforma Git en producción. Se recomienda migrar sus proyectos ASAP. GitBETA será cerrado a partir del segundo semestre de 2020.

Para guías de cómo migrar sus proyectos, véase la documentación de Gitlab sobre Importar/Exportar proyectos

Commit bdb70189 authored by TheMikox16's avatar TheMikox16

Ejercicio 4 finalizado

parent 37709025
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosed" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosed"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="send_bt" min="-2" max="-2" attributes="0"/>
<Component id="label" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" alignment="0" pref="305" max="32767" attributes="0"/>
<Component id="txt" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace pref="21" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="17" max="-2" attributes="0"/>
<Component id="label" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="265" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="txt" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
<Component id="send_bt" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="11" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="mes_txf">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="label">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="SansSerif" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="Client"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="send_bt">
<Properties>
<Property name="text" type="java.lang.String" value="Enviar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="send_btActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txt">
</Component>
</SubComponents>
</Form>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package excercise4;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
/**
*
* @author Miguel Angel Egoavil Mathison Carne: B92695
*/
public class MessengerClient extends javax.swing.JDialog {
private boolean closed = false;
private Client client = new Client();
/**
* Creates new form Messenger
*/
public MessengerClient(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
setLocationRelativeTo(null);
mes_txf.setText("");
client.start();
}
public void refresh(String s) {
mes_txf.setText("");
mes_txf.setText(s);
}
public boolean isClosed() {
return closed;
}
public class Client extends Thread{
private DataOutputStream output;
private DataInputStream input;
private Socket client;
private final String HOST = "127.0.0.1";
private final int PORT = 1345;
public void runClient() {
try {
connectToServer();
getStream();
processConnection();
} catch (IOException ex) {
ex.printStackTrace();
} finally {
closeConnection();
}
}
private void connectToServer() throws IOException {
System.out.println("Intentando conectar\n");
client = new Socket(HOST, PORT);
System.out.println("Conectado a: " + client.getInetAddress().getHostName());
}
private void getStream() throws IOException {
output = new DataOutputStream(client.getOutputStream());
output.flush();
input = new DataInputStream(client.getInputStream());
}
private void processConnection() throws IOException {
String message = "";
while (client.isConnected()) {
message = input.readUTF();
refresh(message);
}
}
public void send(String s){
refresh(mes_txf.getText() + s);
try {
output.writeUTF(mes_txf.getText());
System.out.println("Enviado");
} catch (IOException ex) {
Logger.getLogger(MessengerServer.class.getName()).log(Level.SEVERE, null, ex);
}
}
private void closeConnection() {
System.out.println("\nCerrando Conexión");
try {
output.close();
input.close();
client.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
public void run(){
runClient();
}
}
/**
* 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() {
jScrollPane1 = new javax.swing.JScrollPane();
mes_txf = new javax.swing.JTextArea();
label = new javax.swing.JLabel();
send_bt = new javax.swing.JButton();
txt = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
mes_txf.setEditable(false);
mes_txf.setColumns(20);
mes_txf.setRows(5);
jScrollPane1.setViewportView(mes_txf);
label.setFont(new java.awt.Font("SansSerif", 1, 14)); // NOI18N
label.setText("Client");
send_bt.setText("Enviar");
send_bt.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
send_btActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(send_bt)
.addComponent(label, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 305, Short.MAX_VALUE)
.addComponent(txt, javax.swing.GroupLayout.Alignment.LEADING))
.addContainerGap(21, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(17, 17, 17)
.addComponent(label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(13, 13, 13)
.addComponent(send_bt)
.addContainerGap(11, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
// TODO add your handling code here:
this.closed = true;
}//GEN-LAST:event_formWindowClosed
private void send_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_send_btActionPerformed
// TODO add your handling code here:
this.client.send("Cliente: " + txt.getText() + "\n");
txt.setText("");
}//GEN-LAST:event_send_btActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MessengerClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MessengerClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MessengerClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MessengerClient.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the dialog */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
MessengerClient dialog = new MessengerClient(new javax.swing.JFrame(), true);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel label;
private javax.swing.JTextArea mes_txf;
private javax.swing.JButton send_bt;
private javax.swing.JTextField txt;
// End of variables declaration//GEN-END:variables
}
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosed" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosed"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="send_bt" min="-2" max="-2" attributes="0"/>
<Component id="label" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" alignment="0" pref="305" max="32767" attributes="0"/>
<Component id="txt" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace pref="21" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="17" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="label" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="265" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="43" max="-2" attributes="0"/>
</Group>
<Component id="txt" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="send_bt" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="11" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="mes_txf">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="label">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="SansSerif" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="Server"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="send_bt">
<Properties>
<Property name="text" type="java.lang.String" value="Enviar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="send_btActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txt">
</Component>
</SubComponents>
</Form>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package excercise4;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
/**
*
* @author Miguel Angel Egoavil Mathison Carne: B92695
*/
public class MessengerServer extends javax.swing.JDialog {
private boolean closed = false;
private Server server = new Server();
/**
* Creates new form Messenger
*/
public MessengerServer(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
setLocationRelativeTo(null);
mes_txf.setText("");
server.start();
}
public void refresh(String s) {
mes_txf.setText("");
mes_txf.setText(s);
}
public boolean isClosed() {
return closed;
}
public class Server extends Thread{
private ServerSocket server;
private Socket connection;
private final int PORT = 1345;
private DataOutputStream output;
private DataInputStream input;
public void runServer() {
try {
server = new ServerSocket(PORT);
waitForConnection();
getStreams();
processConnection();
} catch (IOException ex) {
ex.printStackTrace();
} finally {
closeConnection();
}
}
private void waitForConnection() throws IOException {
System.out.println("Server esperando por conexión (cliente)...\n");
connection = server.accept();
System.out.println("Conexión recibida de: " + connection.getInetAddress().getHostName());
}
private void getStreams() throws IOException {
output = new DataOutputStream(connection.getOutputStream());
output.flush();
input = new DataInputStream(connection.getInputStream());
}
private void processConnection() throws IOException {
String message = "";
while (connection.isConnected()) {
message = input.readUTF();
refresh(message);
}
}
public void send(String s){
refresh(mes_txf.getText() + s);
try {
output.writeUTF(mes_txf.getText());
System.out.println("Enviado");
} catch (IOException ex) {
Logger.getLogger(MessengerServer.class.getName()).log(Level.SEVERE, null, ex);
}
}
private void closeConnection() {
System.out.println("\nTerminando Conexión");
try {
output.close();
input.close();
connection.close();
server.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
public void run(){
runServer();
}
}
/**
* 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() {
jScrollPane1 = new javax.swing.JScrollPane();
mes_txf = new javax.swing.JTextArea();
label = new javax.swing.JLabel();
send_bt = new javax.swing.JButton();
txt = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
mes_txf.setEditable(false);
mes_txf.setColumns(20);
mes_txf.setRows(5);
jScrollPane1.setViewportView(mes_txf);
label.setFont(new java.awt.Font("SansSerif", 1, 14)); // NOI18N
label.setText("Server");
send_bt.setText("Enviar");
send_bt.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
send_btActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(send_bt)
.addComponent(label, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 305, Short.MAX_VALUE)
.addComponent(txt, javax.swing.GroupLayout.Alignment.LEADING))
.addContainerGap(21, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(17, 17, 17)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(43, 43, 43))
.addComponent(txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(send_bt)
.addContainerGap(11, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
// TODO add your handling code here:
this.closed = true;
}//GEN-LAST:event_formWindowClosed
private void send_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_send_btActionPerformed
// TODO add your handling code here:
server.send("Servidor: " + txt.getText() + "\n");
txt.setText("");
}//GEN-LAST:event_send_btActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MessengerServer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MessengerServer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MessengerServer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MessengerServer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the dialog */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
MessengerServer dialog = new MessengerServer(new javax.swing.JFrame(), true);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel label;
private javax.swing.JTextArea mes_txf;
private javax.swing.JButton send_bt;
private javax.swing.JTextField txt;
// End of variables declaration//GEN-END:variables
}