Du alter pfuscher - Titel und zentriertes Öffnen über GUI Generator

This commit is contained in:
Gerhard Switalski 2019-01-05 14:57:35 +01:00
parent cec961f46a
commit 34e1e4d2ed
3 changed files with 123 additions and 116 deletions

View File

@ -26,7 +26,6 @@ public class Start {
ReceiveAdapterController rxAdapter = new ReceiveAdapterController(view); ReceiveAdapterController rxAdapter = new ReceiveAdapterController(view);
model.addObserver(rxAdapter); model.addObserver(rxAdapter);
view.setTitle("ICQ 0.1 xD");
view.setVisible(true); view.setVisible(true);
} }

View File

@ -7,10 +7,11 @@
</NonVisualComponents> </NonVisualComponents>
<Properties> <Properties>
<Property name="defaultCloseOperation" type="int" value="3"/> <Property name="defaultCloseOperation" type="int" value="3"/>
<Property name="title" type="java.lang.String" value="ICQ 0.1 xD"/>
</Properties> </Properties>
<SyntheticProperties> <SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/> <SyntheticProperty name="generateCenter" type="boolean" value="true"/>
</SyntheticProperties> </SyntheticProperties>
<AuxValues> <AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>

View File

@ -94,118 +94,125 @@ public class ChatView extends javax.swing.JFrame {
* regenerated by the Form Editor. * regenerated by the Form Editor.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents()
{
bgSelect = new javax.swing.ButtonGroup(); bgSelect = new javax.swing.ButtonGroup();
jScrollPane1 = new javax.swing.JScrollPane(); jScrollPane1 = new javax.swing.JScrollPane();
taCommunication = new javax.swing.JTextArea(); taCommunication = new javax.swing.JTextArea();
tfMessage = new javax.swing.JTextField(); tfMessage = new javax.swing.JTextField();
btSend = new javax.swing.JButton(); btSend = new javax.swing.JButton();
tfPort = new javax.swing.JTextField(); tfPort = new javax.swing.JTextField();
lbPort = new javax.swing.JLabel(); lbPort = new javax.swing.JLabel();
lbIP = new javax.swing.JLabel(); lbIP = new javax.swing.JLabel();
tfIP = new javax.swing.JTextField(); tfIP = new javax.swing.JTextField();
btConnect = new javax.swing.JButton(); btConnect = new javax.swing.JButton();
rbClient = new javax.swing.JRadioButton(); rbClient = new javax.swing.JRadioButton();
rbServer = new javax.swing.JRadioButton(); rbServer = new javax.swing.JRadioButton();
jSeparator2 = new javax.swing.JSeparator(); jSeparator2 = new javax.swing.JSeparator();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("ICQ 0.1 xD");
taCommunication.setColumns(20); taCommunication.setColumns(20);
taCommunication.setRows(5); taCommunication.setRows(5);
jScrollPane1.setViewportView(taCommunication); jScrollPane1.setViewportView(taCommunication);
btSend.setText("send"); btSend.setText("send");
tfPort.setText("45000"); tfPort.setText("45000");
tfPort.setToolTipText(""); tfPort.setToolTipText("");
lbPort.setText("Port:"); lbPort.setText("Port:");
lbPort.setToolTipText(""); lbPort.setToolTipText("");
lbIP.setText("IP:"); lbIP.setText("IP:");
tfIP.setText("127.0.0.1"); tfIP.setText("127.0.0.1");
btConnect.setText("connect"); btConnect.setText("connect");
btConnect.setToolTipText(""); btConnect.setToolTipText("");
bgSelect.add(rbClient); bgSelect.add(rbClient);
rbClient.setSelected(true); rbClient.setSelected(true);
rbClient.setText("Client"); rbClient.setText("Client");
rbClient.addActionListener(new java.awt.event.ActionListener() { rbClient.addActionListener(new java.awt.event.ActionListener()
public void actionPerformed(java.awt.event.ActionEvent evt) { {
rbClientActionPerformed(evt); public void actionPerformed(java.awt.event.ActionEvent evt)
} {
}); rbClientActionPerformed(evt);
}
});
bgSelect.add(rbServer); bgSelect.add(rbServer);
rbServer.setText("Server"); rbServer.setText("Server");
rbServer.addActionListener(new java.awt.event.ActionListener() { rbServer.addActionListener(new java.awt.event.ActionListener()
public void actionPerformed(java.awt.event.ActionEvent evt) { {
rbServerActionPerformed(evt); public void actionPerformed(java.awt.event.ActionEvent evt)
} {
}); rbServerActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout); getContentPane().setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(lbPort) .addComponent(lbPort)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfPort, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfPort, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbIP) .addComponent(lbIP)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tfIP, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfIP, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 247, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 247, Short.MAX_VALUE)
.addComponent(btConnect)) .addComponent(btConnect))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(rbClient, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rbClient, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(rbServer) .addComponent(rbServer)
.addGap(0, 0, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane1) .addComponent(jScrollPane1)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(tfMessage) .addComponent(tfMessage)
.addGap(18, 18, 18) .addGap(18, 18, 18)
.addComponent(btSend))) .addComponent(btSend)))
.addContainerGap()) .addContainerGap())
.addComponent(jSeparator2) .addComponent(jSeparator2)
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
.addGap(18, 18, 18) .addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(tfMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btSend)) .addComponent(btSend))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1) .addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(rbServer) .addComponent(rbServer)
.addComponent(rbClient)) .addComponent(rbClient))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lbPort) .addComponent(lbPort)
.addComponent(tfPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .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(tfIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lbIP) .addComponent(lbIP)
.addComponent(btConnect)) .addComponent(btConnect))
.addContainerGap()) .addContainerGap())
); );
pack(); pack();
}// </editor-fold>//GEN-END:initComponents setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void rbClientActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbClientActionPerformed private void rbClientActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbClientActionPerformed
// TODO add your handling code here: // TODO add your handling code here:
@ -250,19 +257,19 @@ public class ChatView extends javax.swing.JFrame {
}); });
} }
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup bgSelect; private javax.swing.ButtonGroup bgSelect;
private javax.swing.JButton btConnect; private javax.swing.JButton btConnect;
private javax.swing.JButton btSend; private javax.swing.JButton btSend;
private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSeparator jSeparator2; private javax.swing.JSeparator jSeparator2;
private javax.swing.JLabel lbIP; private javax.swing.JLabel lbIP;
private javax.swing.JLabel lbPort; private javax.swing.JLabel lbPort;
private javax.swing.JRadioButton rbClient; private javax.swing.JRadioButton rbClient;
private javax.swing.JRadioButton rbServer; private javax.swing.JRadioButton rbServer;
private javax.swing.JTextArea taCommunication; private javax.swing.JTextArea taCommunication;
private javax.swing.JTextField tfIP; private javax.swing.JTextField tfIP;
private javax.swing.JTextField tfMessage; private javax.swing.JTextField tfMessage;
private javax.swing.JTextField tfPort; private javax.swing.JTextField tfPort;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }