|
|
@@ -0,0 +1,200 @@ |
|
|
|
/* |
|
|
|
* 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 netz.view; |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* @author hd |
|
|
|
*/ |
|
|
|
public class ChatView extends javax.swing.JFrame |
|
|
|
{ |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the btnSend |
|
|
|
*/ |
|
|
|
public javax.swing.JButton getBtnSend() |
|
|
|
{ |
|
|
|
return btnSend; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the btnSetClient |
|
|
|
*/ |
|
|
|
public javax.swing.JButton getBtnSetClient() |
|
|
|
{ |
|
|
|
return btnSetClient; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the btnSetServer |
|
|
|
*/ |
|
|
|
public javax.swing.JButton getBtnSetServer() |
|
|
|
{ |
|
|
|
return btnSetServer; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the lblStatusDialog |
|
|
|
*/ |
|
|
|
public javax.swing.JLabel getLblStatusDialog() |
|
|
|
{ |
|
|
|
return lblStatusDialog; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param lblStatusDialog the lblStatusDialog to set |
|
|
|
*/ |
|
|
|
public void setLblStatusDialog(javax.swing.JLabel lblStatusDialog) |
|
|
|
{ |
|
|
|
this.lblStatusDialog = lblStatusDialog; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the lblType |
|
|
|
*/ |
|
|
|
public javax.swing.JLabel getLblType() |
|
|
|
{ |
|
|
|
return lblType; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param lblType the lblType to set |
|
|
|
*/ |
|
|
|
public void setLblType(javax.swing.JLabel lblType) |
|
|
|
{ |
|
|
|
this.lblType = lblType; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the txtField |
|
|
|
*/ |
|
|
|
public javax.swing.JTextField getTxtField() |
|
|
|
{ |
|
|
|
return txtField; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param txtField the txtField to set |
|
|
|
*/ |
|
|
|
public void setTxtField(javax.swing.JTextField txtField) |
|
|
|
{ |
|
|
|
this.txtField = txtField; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 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() |
|
|
|
{ |
|
|
|
|
|
|
|
jPanel1 = new javax.swing.JPanel(); |
|
|
|
lblType = new javax.swing.JLabel(); |
|
|
|
btnSetClient = new javax.swing.JButton(); |
|
|
|
btnSetServer = new javax.swing.JButton(); |
|
|
|
txtField = new javax.swing.JTextField(); |
|
|
|
btnSend = new javax.swing.JButton(); |
|
|
|
lblStatusDialog = new javax.swing.JLabel(); |
|
|
|
|
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
|
|
|
setTitle("ChatTool"); |
|
|
|
|
|
|
|
jPanel1.setLayout(new java.awt.GridLayout()); |
|
|
|
|
|
|
|
lblType.setText("Client"); |
|
|
|
jPanel1.add(lblType); |
|
|
|
|
|
|
|
btnSetClient.setText("Client"); |
|
|
|
jPanel1.add(btnSetClient); |
|
|
|
|
|
|
|
btnSetServer.setText("Server"); |
|
|
|
jPanel1.add(btnSetServer); |
|
|
|
|
|
|
|
getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START); |
|
|
|
|
|
|
|
txtField.setText("jTextField1"); |
|
|
|
getContentPane().add(txtField, java.awt.BorderLayout.CENTER); |
|
|
|
|
|
|
|
btnSend.setText("Send"); |
|
|
|
getContentPane().add(btnSend, java.awt.BorderLayout.LINE_END); |
|
|
|
|
|
|
|
lblStatusDialog.setText("\"\""); |
|
|
|
getContentPane().add(lblStatusDialog, java.awt.BorderLayout.PAGE_END); |
|
|
|
|
|
|
|
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> |
|
|
|
//</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 btnSend; |
|
|
|
private javax.swing.JButton btnSetClient; |
|
|
|
private javax.swing.JButton btnSetServer; |
|
|
|
private javax.swing.JPanel jPanel1; |
|
|
|
private javax.swing.JLabel lblStatusDialog; |
|
|
|
private javax.swing.JLabel lblType; |
|
|
|
private javax.swing.JTextField txtField; |
|
|
|
// End of variables declaration//GEN-END:variables |
|
|
|
} |