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.

ChatView.java 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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 view;
  7. /**
  8. *
  9. * @author Apollo
  10. */
  11. public class ChatView extends javax.swing.JFrame
  12. {
  13. /**
  14. * @return the btnverbinden
  15. */
  16. public javax.swing.JButton getBtnverbinden()
  17. {
  18. return btnverbinden;
  19. }
  20. /**
  21. * @return the txteigeneIP
  22. */
  23. public javax.swing.JTextField getTxteigeneIP()
  24. {
  25. return txteigeneIP;
  26. }
  27. /**
  28. * @return the txtzielIP
  29. */
  30. public javax.swing.JTextField getTxtzielIP()
  31. {
  32. return txtzielIP;
  33. }
  34. /**
  35. * @param chatanzeige the chatanzeige to set
  36. */
  37. public void setChatanzeige(javax.swing.JTextArea chatanzeige)
  38. {
  39. this.chatanzeige = chatanzeige;
  40. }
  41. /**
  42. * @return the chatanzeige
  43. */
  44. public javax.swing.JTextArea getChatanzeige()
  45. {
  46. return chatanzeige;
  47. }
  48. /**
  49. * @return the inputField
  50. */
  51. public javax.swing.JTextField getInputField()
  52. {
  53. return inputField;
  54. }
  55. /**
  56. * Creates new form clientview
  57. */
  58. public ChatView()
  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. jPanel1 = new javax.swing.JPanel();
  72. jScrollPane3 = new javax.swing.JScrollPane();
  73. chatanzeige = new javax.swing.JTextArea();
  74. inputField = new javax.swing.JTextField();
  75. jPanel2 = new javax.swing.JPanel();
  76. txteigeneIP = new javax.swing.JTextField();
  77. txtzielIP = new javax.swing.JTextField();
  78. btnverbinden = new javax.swing.JButton();
  79. jMenuBar1 = new javax.swing.JMenuBar();
  80. jMenu1 = new javax.swing.JMenu();
  81. jMenu2 = new javax.swing.JMenu();
  82. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  83. jPanel1.setLayout(new java.awt.BorderLayout());
  84. chatanzeige.setEditable(false);
  85. chatanzeige.setColumns(20);
  86. chatanzeige.setRows(5);
  87. jScrollPane3.setViewportView(chatanzeige);
  88. jPanel1.add(jScrollPane3, java.awt.BorderLayout.CENTER);
  89. jPanel1.add(inputField, java.awt.BorderLayout.PAGE_END);
  90. jPanel2.setMinimumSize(new java.awt.Dimension(0, 0));
  91. txteigeneIP.setEditable(false);
  92. txteigeneIP.setMinimumSize(new java.awt.Dimension(200, 26));
  93. jPanel2.add(txteigeneIP);
  94. txtzielIP.setText("192.168.0.1");
  95. jPanel2.add(txtzielIP);
  96. btnverbinden.setText("Verbinden");
  97. jPanel2.add(btnverbinden);
  98. jPanel1.add(jPanel2, java.awt.BorderLayout.PAGE_START);
  99. getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
  100. jMenu1.setText("File");
  101. jMenuBar1.add(jMenu1);
  102. jMenu2.setText("Edit");
  103. jMenuBar1.add(jMenu2);
  104. setJMenuBar(jMenuBar1);
  105. pack();
  106. }// </editor-fold>//GEN-END:initComponents
  107. /**
  108. * @param args the command line arguments
  109. */
  110. public static void main(String args[])
  111. {
  112. /* Set the Nimbus look and feel */
  113. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  114. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  115. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  116. */
  117. try
  118. {
  119. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
  120. {
  121. if ("Nimbus".equals(info.getName()))
  122. {
  123. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  124. break;
  125. }
  126. }
  127. }
  128. catch (ClassNotFoundException ex)
  129. {
  130. java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  131. }
  132. catch (InstantiationException ex)
  133. {
  134. java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  135. }
  136. catch (IllegalAccessException ex)
  137. {
  138. java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  139. }
  140. catch (javax.swing.UnsupportedLookAndFeelException ex)
  141. {
  142. java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  143. }
  144. //</editor-fold>
  145. //</editor-fold>
  146. //</editor-fold>
  147. //</editor-fold>
  148. /* Create and display the form */
  149. java.awt.EventQueue.invokeLater(new Runnable()
  150. {
  151. public void run()
  152. {
  153. new ChatView().setVisible(true);
  154. }
  155. });
  156. }
  157. // Variables declaration - do not modify//GEN-BEGIN:variables
  158. private javax.swing.JButton btnverbinden;
  159. private javax.swing.JTextArea chatanzeige;
  160. private javax.swing.JTextField inputField;
  161. private javax.swing.JMenu jMenu1;
  162. private javax.swing.JMenu jMenu2;
  163. private javax.swing.JMenuBar jMenuBar1;
  164. private javax.swing.JPanel jPanel1;
  165. private javax.swing.JPanel jPanel2;
  166. private javax.swing.JScrollPane jScrollPane3;
  167. private javax.swing.JTextField txteigeneIP;
  168. private javax.swing.JTextField txtzielIP;
  169. // End of variables declaration//GEN-END:variables
  170. }