|
|
@@ -25,115 +25,102 @@ public class ChatView extends javax.swing.JFrame |
|
|
|
* regenerated by the Form Editor. |
|
|
|
*/ |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|
|
|
private void initComponents() |
|
|
|
{ |
|
|
|
|
|
|
|
dialogChooseMode = new javax.swing.JDialog(); |
|
|
|
lblMode = new javax.swing.JLabel(); |
|
|
|
BtnServer = new javax.swing.JRadioButton(); |
|
|
|
BtnClient = new javax.swing.JRadioButton(); |
|
|
|
jPanel1 = new javax.swing.JPanel(); |
|
|
|
BtnConnect = new javax.swing.JButton(); |
|
|
|
BtnGrpMode = new javax.swing.ButtonGroup(); |
|
|
|
tfNachricht = new javax.swing.JTextField(); |
|
|
|
jScrollPane2 = new javax.swing.JScrollPane(); |
|
|
|
txtChat = new javax.swing.JTextArea(); |
|
|
|
|
|
|
|
dialogChooseMode.setMinimumSize(new java.awt.Dimension(278, 208)); |
|
|
|
dialogChooseMode.getContentPane().setLayout(new java.awt.GridLayout(0, 1)); |
|
|
|
|
|
|
|
lblMode.setText(" Choose your mode:"); |
|
|
|
dialogChooseMode.getContentPane().add(lblMode); |
|
|
|
|
|
|
|
BtnGrpMode.add(BtnServer); |
|
|
|
BtnServer.setText("Server"); |
|
|
|
BtnServer.addActionListener(new java.awt.event.ActionListener() |
|
|
|
{ |
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) |
|
|
|
{ |
|
|
|
BtnServerActionPerformed(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
dialogChooseMode.getContentPane().add(BtnServer); |
|
|
|
|
|
|
|
BtnGrpMode.add(BtnClient); |
|
|
|
BtnClient.setText("Client"); |
|
|
|
BtnClient.addActionListener(new java.awt.event.ActionListener() |
|
|
|
{ |
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) |
|
|
|
{ |
|
|
|
BtnClientActionPerformed(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
dialogChooseMode.getContentPane().add(BtnClient); |
|
|
|
|
|
|
|
BtnConnect.setText("Connect"); |
|
|
|
BtnConnect.addActionListener(new java.awt.event.ActionListener() |
|
|
|
{ |
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) |
|
|
|
{ |
|
|
|
BtnConnectActionPerformed(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); |
|
|
|
jPanel1.setLayout(jPanel1Layout); |
|
|
|
jPanel1Layout.setHorizontalGroup( |
|
|
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
|
|
.addGroup(jPanel1Layout.createSequentialGroup() |
|
|
|
.addContainerGap(65, Short.MAX_VALUE) |
|
|
|
.addComponent(BtnConnect) |
|
|
|
.addContainerGap(76, Short.MAX_VALUE)) |
|
|
|
); |
|
|
|
jPanel1Layout.setVerticalGroup( |
|
|
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
|
|
.addGroup(jPanel1Layout.createSequentialGroup() |
|
|
|
.addContainerGap() |
|
|
|
.addComponent(BtnConnect) |
|
|
|
.addContainerGap(57, Short.MAX_VALUE)) |
|
|
|
); |
|
|
|
|
|
|
|
dialogChooseMode.getContentPane().add(jPanel1); |
|
|
|
|
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
|
|
|
setMinimumSize(new java.awt.Dimension(568, 548)); |
|
|
|
addWindowListener(new java.awt.event.WindowAdapter() |
|
|
|
{ |
|
|
|
public void windowOpened(java.awt.event.WindowEvent evt) |
|
|
|
{ |
|
|
|
formWindowOpened(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
tfNachricht.setToolTipText(""); |
|
|
|
tfNachricht.addMouseListener(new java.awt.event.MouseAdapter() |
|
|
|
{ |
|
|
|
public void mouseClicked(java.awt.event.MouseEvent evt) |
|
|
|
{ |
|
|
|
tfNachrichtMouseClicked(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
tfNachricht.addActionListener(new java.awt.event.ActionListener() |
|
|
|
{ |
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) |
|
|
|
{ |
|
|
|
tfNachrichtActionPerformed(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
getContentPane().add(tfNachricht, java.awt.BorderLayout.PAGE_END); |
|
|
|
|
|
|
|
jScrollPane2.setPreferredSize(new java.awt.Dimension(238, 150)); |
|
|
|
|
|
|
|
txtChat.setColumns(20); |
|
|
|
txtChat.setRows(5); |
|
|
|
txtChat.setText("Chat:"); |
|
|
|
jScrollPane2.setViewportView(txtChat); |
|
|
|
|
|
|
|
getContentPane().add(jScrollPane2, java.awt.BorderLayout.CENTER); |
|
|
|
|
|
|
|
pack(); |
|
|
|
}// </editor-fold>//GEN-END:initComponents |
|
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|
|
|
private void initComponents() { |
|
|
|
|
|
|
|
dialogChooseMode = new javax.swing.JDialog(); |
|
|
|
lblMode = new javax.swing.JLabel(); |
|
|
|
BtnServer = new javax.swing.JRadioButton(); |
|
|
|
BtnClient = new javax.swing.JRadioButton(); |
|
|
|
jPanel1 = new javax.swing.JPanel(); |
|
|
|
BtnConnect = new javax.swing.JButton(); |
|
|
|
BtnGrpMode = new javax.swing.ButtonGroup(); |
|
|
|
tfNachricht = new javax.swing.JTextField(); |
|
|
|
jScrollPane2 = new javax.swing.JScrollPane(); |
|
|
|
txtChat = new javax.swing.JTextArea(); |
|
|
|
|
|
|
|
dialogChooseMode.setMinimumSize(new java.awt.Dimension(278, 208)); |
|
|
|
dialogChooseMode.getContentPane().setLayout(new java.awt.GridLayout(0, 1)); |
|
|
|
|
|
|
|
lblMode.setText(" Choose your mode:"); |
|
|
|
dialogChooseMode.getContentPane().add(lblMode); |
|
|
|
|
|
|
|
BtnGrpMode.add(BtnServer); |
|
|
|
BtnServer.setText("Server"); |
|
|
|
BtnServer.addActionListener(new java.awt.event.ActionListener() { |
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
|
|
BtnServerActionPerformed(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
dialogChooseMode.getContentPane().add(BtnServer); |
|
|
|
|
|
|
|
BtnGrpMode.add(BtnClient); |
|
|
|
BtnClient.setText("Client"); |
|
|
|
BtnClient.addActionListener(new java.awt.event.ActionListener() { |
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
|
|
BtnClientActionPerformed(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
dialogChooseMode.getContentPane().add(BtnClient); |
|
|
|
|
|
|
|
BtnConnect.setText("Connect"); |
|
|
|
BtnConnect.addActionListener(new java.awt.event.ActionListener() { |
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
|
|
BtnConnectActionPerformed(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); |
|
|
|
jPanel1.setLayout(jPanel1Layout); |
|
|
|
jPanel1Layout.setHorizontalGroup( |
|
|
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
|
|
.addGroup(jPanel1Layout.createSequentialGroup() |
|
|
|
.addContainerGap(65, Short.MAX_VALUE) |
|
|
|
.addComponent(BtnConnect) |
|
|
|
.addContainerGap(76, Short.MAX_VALUE)) |
|
|
|
); |
|
|
|
jPanel1Layout.setVerticalGroup( |
|
|
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
|
|
.addGroup(jPanel1Layout.createSequentialGroup() |
|
|
|
.addContainerGap() |
|
|
|
.addComponent(BtnConnect) |
|
|
|
.addContainerGap(57, Short.MAX_VALUE)) |
|
|
|
); |
|
|
|
|
|
|
|
dialogChooseMode.getContentPane().add(jPanel1); |
|
|
|
|
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
|
|
|
setMinimumSize(new java.awt.Dimension(568, 548)); |
|
|
|
addWindowListener(new java.awt.event.WindowAdapter() { |
|
|
|
public void windowOpened(java.awt.event.WindowEvent evt) { |
|
|
|
formWindowOpened(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
tfNachricht.setToolTipText(""); |
|
|
|
tfNachricht.addMouseListener(new java.awt.event.MouseAdapter() { |
|
|
|
public void mouseClicked(java.awt.event.MouseEvent evt) { |
|
|
|
tfNachrichtMouseClicked(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
tfNachricht.addActionListener(new java.awt.event.ActionListener() { |
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
|
|
tfNachrichtActionPerformed(evt); |
|
|
|
} |
|
|
|
}); |
|
|
|
getContentPane().add(tfNachricht, java.awt.BorderLayout.PAGE_END); |
|
|
|
|
|
|
|
jScrollPane2.setPreferredSize(new java.awt.Dimension(238, 150)); |
|
|
|
|
|
|
|
txtChat.setColumns(20); |
|
|
|
txtChat.setRows(5); |
|
|
|
txtChat.setText("Chat:"); |
|
|
|
jScrollPane2.setViewportView(txtChat); |
|
|
|
|
|
|
|
getContentPane().add(jScrollPane2, java.awt.BorderLayout.CENTER); |
|
|
|
|
|
|
|
pack(); |
|
|
|
}// </editor-fold>//GEN-END:initComponents |
|
|
|
|
|
|
|
private void BtnClientActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_BtnClientActionPerformed |
|
|
|
{//GEN-HEADEREND:event_BtnClientActionPerformed |
|
|
@@ -214,18 +201,18 @@ public class ChatView extends javax.swing.JFrame |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables |
|
|
|
private javax.swing.JRadioButton BtnClient; |
|
|
|
private javax.swing.JButton BtnConnect; |
|
|
|
private javax.swing.ButtonGroup BtnGrpMode; |
|
|
|
private javax.swing.JRadioButton BtnServer; |
|
|
|
private javax.swing.JDialog dialogChooseMode; |
|
|
|
private javax.swing.JPanel jPanel1; |
|
|
|
private javax.swing.JScrollPane jScrollPane2; |
|
|
|
private javax.swing.JLabel lblMode; |
|
|
|
private javax.swing.JTextField tfNachricht; |
|
|
|
private javax.swing.JTextArea txtChat; |
|
|
|
// End of variables declaration//GEN-END:variables |
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables |
|
|
|
private javax.swing.JRadioButton BtnClient; |
|
|
|
private javax.swing.JButton BtnConnect; |
|
|
|
private javax.swing.ButtonGroup BtnGrpMode; |
|
|
|
private javax.swing.JRadioButton BtnServer; |
|
|
|
private javax.swing.JDialog dialogChooseMode; |
|
|
|
private javax.swing.JPanel jPanel1; |
|
|
|
private javax.swing.JScrollPane jScrollPane2; |
|
|
|
private javax.swing.JLabel lblMode; |
|
|
|
private javax.swing.JTextField tfNachricht; |
|
|
|
private javax.swing.JTextArea txtChat; |
|
|
|
// End of variables declaration//GEN-END:variables |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the BtnClient |