/*
* 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 max
*/
public class ChatView extends javax.swing.JFrame {
/**
* @return the rbClient
*/
public javax.swing.JRadioButton getRbClient() {
return rbClient;
}
/**
* @return the rbServer
*/
public javax.swing.JRadioButton getRbServer() {
return rbServer;
}
/**
* @return the btConnect
*/
public javax.swing.JButton getBtConnect() {
return btConnect;
}
/**
* @return the btSend
*/
public javax.swing.JButton getBtSend() {
return btSend;
}
/**
* @return the lbIP
*/
public javax.swing.JLabel getLbIP() {
return lbIP;
}
/**
* @return the lbPort
*/
public javax.swing.JLabel getLbPort() {
return lbPort;
}
/**
* @return the taCommunication
*/
public javax.swing.JTextArea getTaCommunication() {
return taCommunication;
}
/**
* @return the tfIP
*/
public javax.swing.JTextField getTfIP() {
return tfIP;
}
/**
* @return the tfMessage
*/
public javax.swing.JTextField getTfMessage() {
return tfMessage;
}
/**
* @return the tfPort
*/
public javax.swing.JTextField getTfPort() {
return tfPort;
}
/**
* 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")
// //GEN-BEGIN:initComponents
private void initComponents()
{
bgSelect = new javax.swing.ButtonGroup();
jScrollPane1 = new javax.swing.JScrollPane();
taCommunication = new javax.swing.JTextArea();
tfMessage = new javax.swing.JTextField();
btSend = new javax.swing.JButton();
tfPort = new javax.swing.JTextField();
lbPort = new javax.swing.JLabel();
lbIP = new javax.swing.JLabel();
tfIP = new javax.swing.JTextField();
btConnect = new javax.swing.JButton();
rbClient = new javax.swing.JRadioButton();
rbServer = new javax.swing.JRadioButton();
jSeparator2 = new javax.swing.JSeparator();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("ICQ 0.1 xD");
taCommunication.setColumns(20);
taCommunication.setRows(5);
jScrollPane1.setViewportView(taCommunication);
btSend.setText("send");
tfPort.setText("45000");
tfPort.setToolTipText("");
lbPort.setText("Port:");
lbPort.setToolTipText("");
lbIP.setText("IP:");
tfIP.setText("127.0.0.1");
btConnect.setText("connect");
btConnect.setToolTipText("");
bgSelect.add(rbClient);
rbClient.setSelected(true);
rbClient.setText("Client");
rbClient.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
rbClientActionPerformed(evt);
}
});
bgSelect.add(rbServer);
rbServer.setText("Server");
rbServer.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
rbServerActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(lbPort)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfPort, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbIP)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfIP, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 247, Short.MAX_VALUE)
.addComponent(btConnect))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(rbClient, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(rbServer)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane1)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(tfMessage)
.addGap(18, 18, 18)
.addComponent(btSend)))
.addContainerGap())
.addComponent(jSeparator2)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(tfMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btSend))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(rbServer)
.addComponent(rbClient))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lbPort)
.addComponent(tfPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tfIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbIP)
.addComponent(btConnect))
.addContainerGap())
);
pack();
setLocationRelativeTo(null);
}// //GEN-END:initComponents
private void rbClientActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbClientActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rbClientActionPerformed
private void rbServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbServerActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rbServerActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//
/* 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);
}
//
/* 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.ButtonGroup bgSelect;
private javax.swing.JButton btConnect;
private javax.swing.JButton btSend;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JLabel lbIP;
private javax.swing.JLabel lbPort;
private javax.swing.JRadioButton rbClient;
private javax.swing.JRadioButton rbServer;
private javax.swing.JTextArea taCommunication;
private javax.swing.JTextField tfIP;
private javax.swing.JTextField tfMessage;
private javax.swing.JTextField tfPort;
// End of variables declaration//GEN-END:variables
}