|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* 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 chatprogramm.view; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* |
|
|
|
|
|
* @author Gerhard |
|
|
|
|
|
*/ |
|
|
|
|
|
public class ChatView extends javax.swing.JFrame |
|
|
|
|
|
{ |
|
|
|
|
|
/** |
|
|
|
|
|
* @return the btnClear |
|
|
|
|
|
*/ |
|
|
|
|
|
public javax.swing.JButton getBtnClear() |
|
|
|
|
|
{ |
|
|
|
|
|
return btnClear; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @return the btnSend |
|
|
|
|
|
*/ |
|
|
|
|
|
public javax.swing.JButton getBtnSend() |
|
|
|
|
|
{ |
|
|
|
|
|
return btnSend; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @return the jDialogServerClient |
|
|
|
|
|
*/ |
|
|
|
|
|
public javax.swing.JDialog getjDialogServerClient() |
|
|
|
|
|
{ |
|
|
|
|
|
return jDialogServerClient; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @return the taEmpfangen |
|
|
|
|
|
*/ |
|
|
|
|
|
public javax.swing.JTextArea getTaEmpfangen() |
|
|
|
|
|
{ |
|
|
|
|
|
return taEmpfangen; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @return the taSenden |
|
|
|
|
|
*/ |
|
|
|
|
|
public javax.swing.JTextArea getTaSenden() |
|
|
|
|
|
{ |
|
|
|
|
|
return taSenden; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Creates new form ChatView |
|
|
|
|
|
*/ |
|
|
|
|
|
public ChatView() |
|
|
|
|
|
{ |
|
|
|
|
|
initComponents(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 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() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
jDialogServerClient = new javax.swing.JDialog(); |
|
|
|
|
|
chatControll = new javax.swing.JLayeredPane(); |
|
|
|
|
|
btnSend = new javax.swing.JButton(); |
|
|
|
|
|
btnClear = new javax.swing.JButton(); |
|
|
|
|
|
chatContent = new javax.swing.JLayeredPane(); |
|
|
|
|
|
jScrollPane1 = new javax.swing.JScrollPane(); |
|
|
|
|
|
taEmpfangen = new javax.swing.JTextArea(); |
|
|
|
|
|
jScrollPane2 = new javax.swing.JScrollPane(); |
|
|
|
|
|
taSenden = new javax.swing.JTextArea(); |
|
|
|
|
|
jMenuBar1 = new javax.swing.JMenuBar(); |
|
|
|
|
|
jMenu2 = new javax.swing.JMenu(); |
|
|
|
|
|
jMenu3 = new javax.swing.JMenu(); |
|
|
|
|
|
|
|
|
|
|
|
javax.swing.GroupLayout jDialogServerClientLayout = new javax.swing.GroupLayout(jDialogServerClient.getContentPane()); |
|
|
|
|
|
jDialogServerClient.getContentPane().setLayout(jDialogServerClientLayout); |
|
|
|
|
|
jDialogServerClientLayout.setHorizontalGroup( |
|
|
|
|
|
jDialogServerClientLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
|
|
|
|
.addGap(0, 400, Short.MAX_VALUE) |
|
|
|
|
|
); |
|
|
|
|
|
jDialogServerClientLayout.setVerticalGroup( |
|
|
|
|
|
jDialogServerClientLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
|
|
|
|
.addGap(0, 300, Short.MAX_VALUE) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
|
|
|
|
|
|
|
|
|
|
|
chatControll.setLayout(new java.awt.FlowLayout()); |
|
|
|
|
|
|
|
|
|
|
|
btnSend.setText("send"); |
|
|
|
|
|
chatControll.add(btnSend); |
|
|
|
|
|
|
|
|
|
|
|
btnClear.setText("clear"); |
|
|
|
|
|
chatControll.add(btnClear); |
|
|
|
|
|
|
|
|
|
|
|
getContentPane().add(chatControll, java.awt.BorderLayout.PAGE_END); |
|
|
|
|
|
|
|
|
|
|
|
chatContent.setLayout(new javax.swing.BoxLayout(chatContent, javax.swing.BoxLayout.PAGE_AXIS)); |
|
|
|
|
|
|
|
|
|
|
|
taEmpfangen.setColumns(20); |
|
|
|
|
|
taEmpfangen.setRows(5); |
|
|
|
|
|
jScrollPane1.setViewportView(taEmpfangen); |
|
|
|
|
|
|
|
|
|
|
|
chatContent.add(jScrollPane1); |
|
|
|
|
|
|
|
|
|
|
|
taSenden.setColumns(20); |
|
|
|
|
|
taSenden.setRows(5); |
|
|
|
|
|
jScrollPane2.setViewportView(taSenden); |
|
|
|
|
|
|
|
|
|
|
|
chatContent.add(jScrollPane2); |
|
|
|
|
|
|
|
|
|
|
|
getContentPane().add(chatContent, java.awt.BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
jMenu2.setText("File"); |
|
|
|
|
|
jMenuBar1.add(jMenu2); |
|
|
|
|
|
|
|
|
|
|
|
jMenu3.setText("Edit"); |
|
|
|
|
|
jMenuBar1.add(jMenu3); |
|
|
|
|
|
|
|
|
|
|
|
setJMenuBar(jMenuBar1); |
|
|
|
|
|
|
|
|
|
|
|
pack(); |
|
|
|
|
|
}// </editor-fold>//GEN-END:initComponents |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @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(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); |
|
|
|
|
|
} |
|
|
|
|
|
catch (InstantiationException ex) |
|
|
|
|
|
{ |
|
|
|
|
|
java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); |
|
|
|
|
|
} |
|
|
|
|
|
catch (IllegalAccessException ex) |
|
|
|
|
|
{ |
|
|
|
|
|
java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); |
|
|
|
|
|
} |
|
|
|
|
|
catch (javax.swing.UnsupportedLookAndFeelException ex) |
|
|
|
|
|
{ |
|
|
|
|
|
java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); |
|
|
|
|
|
} |
|
|
|
|
|
//</editor-fold> |
|
|
|
|
|
|
|
|
|
|
|
/* Create and display the form */ |
|
|
|
|
|
java.awt.EventQueue.invokeLater(new Runnable() |
|
|
|
|
|
{ |
|
|
|
|
|
public void run() |
|
|
|
|
|
{ |
|
|
|
|
|
new ChatView().setVisible(true); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables |
|
|
|
|
|
private javax.swing.JButton btnClear; |
|
|
|
|
|
private javax.swing.JButton btnSend; |
|
|
|
|
|
private javax.swing.JLayeredPane chatContent; |
|
|
|
|
|
private javax.swing.JLayeredPane chatControll; |
|
|
|
|
|
private javax.swing.JDialog jDialogServerClient; |
|
|
|
|
|
private javax.swing.JMenu jMenu2; |
|
|
|
|
|
private javax.swing.JMenu jMenu3; |
|
|
|
|
|
private javax.swing.JMenuBar jMenuBar1; |
|
|
|
|
|
private javax.swing.JScrollPane jScrollPane1; |
|
|
|
|
|
private javax.swing.JScrollPane jScrollPane2; |
|
|
|
|
|
private javax.swing.JTextArea taEmpfangen; |
|
|
|
|
|
private javax.swing.JTextArea taSenden; |
|
|
|
|
|
// End of variables declaration//GEN-END:variables |
|
|
|
|
|
} |