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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 chatprogramm.view;
  7. /**
  8. *
  9. * @author Gerhard
  10. */
  11. public class ChatView extends javax.swing.JFrame
  12. {
  13. /**
  14. * @return the btnClear
  15. */
  16. public javax.swing.JButton getBtnClear()
  17. {
  18. return btnClear;
  19. }
  20. /**
  21. * @return the btnSend
  22. */
  23. public javax.swing.JButton getBtnSend()
  24. {
  25. return btnSend;
  26. }
  27. /**
  28. * @return the taEmpfangen
  29. */
  30. public javax.swing.JTextArea getTaEmpfangen()
  31. {
  32. return taEmpfangen;
  33. }
  34. /**
  35. * @return the taSenden
  36. */
  37. public javax.swing.JTextArea getTaSenden()
  38. {
  39. return taSenden;
  40. }
  41. /**
  42. * Creates new form ChatView
  43. */
  44. public ChatView()
  45. {
  46. initComponents();
  47. }
  48. /**
  49. * This method is called from within the constructor to initialize the form.
  50. * WARNING: Do NOT modify this code. The content of this method is always
  51. * regenerated by the Form Editor.
  52. */
  53. @SuppressWarnings("unchecked")
  54. // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  55. private void initComponents()
  56. {
  57. chatControll = new javax.swing.JLayeredPane();
  58. btnSend = new javax.swing.JButton();
  59. btnClear = new javax.swing.JButton();
  60. btnServer = new javax.swing.JButton();
  61. jButton1 = new javax.swing.JButton();
  62. chatContent = new javax.swing.JLayeredPane();
  63. jScrollPane1 = new javax.swing.JScrollPane();
  64. taEmpfangen = new javax.swing.JTextArea();
  65. jScrollPane2 = new javax.swing.JScrollPane();
  66. taSenden = new javax.swing.JTextArea();
  67. jMenuBar1 = new javax.swing.JMenuBar();
  68. jMenu2 = new javax.swing.JMenu();
  69. jMenu3 = new javax.swing.JMenu();
  70. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  71. chatControll.setLayout(new java.awt.FlowLayout());
  72. btnSend.setText("send");
  73. chatControll.add(btnSend);
  74. btnClear.setText("clear");
  75. chatControll.add(btnClear);
  76. btnServer.setText("jButton1");
  77. chatControll.add(btnServer);
  78. jButton1.setText("jButton1");
  79. chatControll.add(jButton1);
  80. getContentPane().add(chatControll, java.awt.BorderLayout.PAGE_END);
  81. chatContent.setLayout(new javax.swing.BoxLayout(chatContent, javax.swing.BoxLayout.PAGE_AXIS));
  82. taEmpfangen.setColumns(20);
  83. taEmpfangen.setRows(5);
  84. jScrollPane1.setViewportView(taEmpfangen);
  85. chatContent.add(jScrollPane1);
  86. taSenden.setColumns(20);
  87. taSenden.setRows(5);
  88. jScrollPane2.setViewportView(taSenden);
  89. chatContent.add(jScrollPane2);
  90. getContentPane().add(chatContent, java.awt.BorderLayout.CENTER);
  91. jMenu2.setText("File");
  92. jMenuBar1.add(jMenu2);
  93. jMenu3.setText("Edit");
  94. jMenuBar1.add(jMenu3);
  95. setJMenuBar(jMenuBar1);
  96. pack();
  97. setLocationRelativeTo(null);
  98. }// </editor-fold>//GEN-END:initComponents
  99. /**
  100. * @param args the command line arguments
  101. */
  102. public static void main(String args[])
  103. {
  104. /* Set the Nimbus look and feel */
  105. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  106. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  107. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  108. */
  109. try
  110. {
  111. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
  112. {
  113. if ("Nimbus".equals(info.getName()))
  114. {
  115. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  116. break;
  117. }
  118. }
  119. }
  120. catch (ClassNotFoundException ex)
  121. {
  122. java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  123. }
  124. catch (InstantiationException ex)
  125. {
  126. java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  127. }
  128. catch (IllegalAccessException ex)
  129. {
  130. java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  131. }
  132. catch (javax.swing.UnsupportedLookAndFeelException ex)
  133. {
  134. java.util.logging.Logger.getLogger(ChatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  135. }
  136. //</editor-fold>
  137. /* Create and display the form */
  138. java.awt.EventQueue.invokeLater(new Runnable()
  139. {
  140. public void run()
  141. {
  142. new ChatView().setVisible(true);
  143. }
  144. });
  145. }
  146. // Variables declaration - do not modify//GEN-BEGIN:variables
  147. private javax.swing.JButton btnClear;
  148. private javax.swing.JButton btnSend;
  149. private javax.swing.JButton btnServer;
  150. private javax.swing.JLayeredPane chatContent;
  151. private javax.swing.JLayeredPane chatControll;
  152. private javax.swing.JButton jButton1;
  153. private javax.swing.JMenu jMenu2;
  154. private javax.swing.JMenu jMenu3;
  155. private javax.swing.JMenuBar jMenuBar1;
  156. private javax.swing.JScrollPane jScrollPane1;
  157. private javax.swing.JScrollPane jScrollPane2;
  158. private javax.swing.JTextArea taEmpfangen;
  159. private javax.swing.JTextArea taSenden;
  160. // End of variables declaration//GEN-END:variables
  161. }