You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ViewChat.java 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package kommunikation.view;
  7. /**
  8. *
  9. * @author Alexander_Christoph
  10. */
  11. public class ViewChat extends javax.swing.JFrame
  12. {
  13. /**
  14. * @return the grafikViewChat
  15. */
  16. public kommunikation.view.GrafikView getGrafikViewChat()
  17. {
  18. return grafikViewChat;
  19. }
  20. /**
  21. * @return the btnConnect
  22. */
  23. public javax.swing.JButton getBtnConnect()
  24. {
  25. return btnConnect;
  26. }
  27. /**
  28. * @return the taChat
  29. */
  30. public javax.swing.JTextArea getTaChat()
  31. {
  32. return taChat;
  33. }
  34. /**
  35. * @return the tfIp
  36. */
  37. public javax.swing.JTextField getTfIp()
  38. {
  39. return tfIp;
  40. }
  41. /**
  42. * @return the tfMessage
  43. */
  44. public javax.swing.JTextField getTfMessage()
  45. {
  46. return tfMessage;
  47. }
  48. /**
  49. * @return the tfPort
  50. */
  51. public javax.swing.JTextField getTfPort()
  52. {
  53. return tfPort;
  54. }
  55. /**
  56. * Creates new form ViewServer
  57. */
  58. public ViewChat()
  59. {
  60. initComponents();
  61. }
  62. /**
  63. * This method is called from within the constructor to initialize the form.
  64. * WARNING: Do NOT modify this code. The content of this method is always
  65. * regenerated by the Form Editor.
  66. */
  67. @SuppressWarnings("unchecked")
  68. // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  69. private void initComponents()
  70. {
  71. tfMessage = new javax.swing.JTextField();
  72. pnlConnect = new javax.swing.JPanel();
  73. lblPort = new javax.swing.JLabel();
  74. tfPort = new javax.swing.JTextField();
  75. lblIp = new javax.swing.JLabel();
  76. tfIp = new javax.swing.JTextField();
  77. btnConnect = new javax.swing.JButton();
  78. pnlChat = new javax.swing.JPanel();
  79. jScrollPane2 = new javax.swing.JScrollPane();
  80. taChat = new javax.swing.JTextArea();
  81. grafikViewChat = new kommunikation.view.GrafikView();
  82. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  83. setTitle("Client");
  84. tfMessage.setText("Nachricht");
  85. tfMessage.setToolTipText("");
  86. getContentPane().add(tfMessage, java.awt.BorderLayout.PAGE_END);
  87. lblPort.setText("PORT");
  88. pnlConnect.add(lblPort);
  89. tfPort.setColumns(6);
  90. tfPort.setText("port");
  91. pnlConnect.add(tfPort);
  92. lblIp.setText("IP_ADRESSE");
  93. pnlConnect.add(lblIp);
  94. tfIp.setColumns(15);
  95. tfIp.setText("ip-Adresse");
  96. pnlConnect.add(tfIp);
  97. btnConnect.setText("Connect");
  98. pnlConnect.add(btnConnect);
  99. getContentPane().add(pnlConnect, java.awt.BorderLayout.PAGE_START);
  100. pnlChat.setLayout(new java.awt.GridLayout(0, 2));
  101. taChat.setColumns(20);
  102. taChat.setRows(5);
  103. jScrollPane2.setViewportView(taChat);
  104. pnlChat.add(jScrollPane2);
  105. pnlChat.add(grafikViewChat);
  106. getContentPane().add(pnlChat, java.awt.BorderLayout.CENTER);
  107. setSize(new java.awt.Dimension(805, 631));
  108. setLocationRelativeTo(null);
  109. }// </editor-fold>//GEN-END:initComponents
  110. /**
  111. * @param args the command line arguments
  112. */
  113. public static void main(String args[])
  114. {
  115. /* Set the Nimbus look and feel */
  116. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  117. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  118. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  119. */
  120. try
  121. {
  122. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
  123. {
  124. if ("Nimbus".equals(info.getName()))
  125. {
  126. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  127. break;
  128. }
  129. }
  130. }
  131. catch (ClassNotFoundException ex)
  132. {
  133. java.util.logging.Logger.getLogger(ViewChat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  134. }
  135. catch (InstantiationException ex)
  136. {
  137. java.util.logging.Logger.getLogger(ViewChat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  138. }
  139. catch (IllegalAccessException ex)
  140. {
  141. java.util.logging.Logger.getLogger(ViewChat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  142. }
  143. catch (javax.swing.UnsupportedLookAndFeelException ex)
  144. {
  145. java.util.logging.Logger.getLogger(ViewChat.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  146. }
  147. //</editor-fold>
  148. //</editor-fold>
  149. //</editor-fold>
  150. //</editor-fold>
  151. /* Create and display the form */
  152. java.awt.EventQueue.invokeLater(new Runnable()
  153. {
  154. public void run()
  155. {
  156. new ViewChat().setVisible(true);
  157. }
  158. });
  159. }
  160. // Variables declaration - do not modify//GEN-BEGIN:variables
  161. private javax.swing.JButton btnConnect;
  162. private kommunikation.view.GrafikView grafikViewChat;
  163. private javax.swing.JScrollPane jScrollPane2;
  164. private javax.swing.JLabel lblIp;
  165. private javax.swing.JLabel lblPort;
  166. private javax.swing.JPanel pnlChat;
  167. private javax.swing.JPanel pnlConnect;
  168. private javax.swing.JTextArea taChat;
  169. private javax.swing.JTextField tfIp;
  170. private javax.swing.JTextField tfMessage;
  171. private javax.swing.JTextField tfPort;
  172. // End of variables declaration//GEN-END:variables
  173. }