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.
6 package uk.ac.ntu.n0521366.wsyd.client;
8 import java.awt.event.ActionEvent;
9 import java.awt.event.ActionListener;
10 import java.io.IOException;
11 import java.net.InetSocketAddress;
12 import java.net.Socket;
13 import java.text.MessageFormat;
14 import java.util.ArrayList;
15 import java.util.SortedMap;
16 import javax.swing.JDialog;
17 import javax.swing.JFrame;
18 import javax.swing.JTextField;
19 import java.util.TreeSet;
20 import java.util.logging.Level;
21 import java.util.logging.Logger;
22 import javax.swing.JProgressBar;
23 import javax.swing.Timer;
24 import uk.ac.ntu.n0521366.wsyd.libs.WSYD_Member;
25 import uk.ac.ntu.n0521366.wsyd.libs.message.MessageLogin;
26 import uk.ac.ntu.n0521366.wsyd.libs.net.Network;
27 import uk.ac.ntu.n0521366.wsyd.libs.net.NetworkMessage;
28 import uk.ac.ntu.n0521366.wsyd.libs.net.NetworkMessageEvent;
29 import uk.ac.ntu.n0521366.wsyd.libs.net.NetworkMessageEventListener;
30 import uk.ac.ntu.n0521366.wsyd.libs.net.NetworkServerTCP;
31 import uk.ac.ntu.n0521366.wsyd.libs.net.NetworkServerUDP;
32 import uk.ac.ntu.n0521366.wsyd.libs.net.NetworkServerUDPMulticast;
33 import uk.ac.ntu.n0521366.wsyd.libs.net.NetworkStream;
34 import uk.ac.ntu.n0521366.wsyd.libs.net.NetworkStreamManager;
35 import uk.ac.ntu.n0521366.wsyd.libs.net.ServiceAddressMap;
36 import uk.ac.ntu.n0521366.wsyd.libs.net.WSYD_SocketAddress;
40 * @author Eddie Berrisford-Lynch
42 public class ClientGUI extends javax.swing.JFrame implements NetworkMessageEventListener {
44 private boolean loginSuccessful = false;
46 private boolean regiSuccessful = false;
48 private Login login = new Login(this, true);
53 * Readable/displayable name of this application
55 * Will be assigned userID when SocialServer connection established
57 private String _title = null;
60 * Network services to address map.
62 ServiceAddressMap _serviceToAddressMap;
65 * Handles display and sending of log messages.
67 @SuppressWarnings("NonConstantLogger")
68 private static Logger LOGGER;
71 * SortedMap wraps a TreeMap that has been made thread-safe by
72 * Collections.synchronizedSortedMap() in readMembers().
74 * Long key, the userID
75 * WSYD_Member member record
77 SortedMap<Long, WSYD_Member> _members;
80 * userIDs of members currently logged in
82 ArrayList<Long> _membersOnline;
86 WSYD_SocketAddress _multicastAdvertiserSA;
88 NetworkServerUDPMulticast _multicastService;
90 WSYD_SocketAddress _udpNotificationServiceSA;
92 NetworkServerUDP _udpNotificationService;
94 WSYD_SocketAddress _tcpChatServiceSA;
96 NetworkServerTCP _tcpChatService;
98 NetworkStreamManager _tcpStreamManager;
101 * Creates new form ClientGUI
105 _serviceToAddressMap = new ServiceAddressMap(_title, LOGGER);
106 _tcpStreamManager = new NetworkStreamManager();
110 * This method is called from within the constructor to initialize the form.
111 * WARNING: Do NOT modify this code. The content of this method is always
112 * regenerated by the Form Editor.
114 @SuppressWarnings("unchecked")
115 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
116 private void initComponents() {
118 gSplitPane1 = new javax.swing.JSplitPane();
119 gDetails = new javax.swing.JTabbedPane();
120 gPersonalProfile = new javax.swing.JPanel();
121 gPersonalName = new javax.swing.JLabel();
122 gPersonalStatus = new javax.swing.JTextField();
123 gScrollPane1 = new javax.swing.JScrollPane();
124 gPersonalNewsFeed = new javax.swing.JList();
125 gFriendProfile = new javax.swing.JPanel();
126 gLabelFriendName = new javax.swing.JLabel();
127 jScrollPane1 = new javax.swing.JScrollPane();
128 gTAreaFriendBio = new javax.swing.JTextArea();
129 jScrollPane2 = new javax.swing.JScrollPane();
130 gListFriendInterests = new javax.swing.JList();
131 gLabelFriendBirthplace = new javax.swing.JLabel();
132 gLabelFriendBirthplaceData = new javax.swing.JLabel();
133 gLabelFriendLocation = new javax.swing.JLabel();
134 gLabelFriendLocationData = new javax.swing.JLabel();
135 jScrollPane3 = new javax.swing.JScrollPane();
136 gTAreaFriendStatuses = new javax.swing.JTextArea();
137 gLabelFriendInterests = new javax.swing.JLabel();
138 gButtonAddFriendChat = new javax.swing.JButton();
139 gOnlineList = new javax.swing.JScrollPane();
140 jList1 = new javax.swing.JList();
141 gStatusPanel = new javax.swing.JPanel();
142 gLabelFriendsOnlineQty = new javax.swing.JLabel();
143 gLabelFriendRequestsQty = new javax.swing.JLabel();
144 gLabelOnlineQty = new javax.swing.JLabel();
146 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
147 setTitle("We Stealz Your Dataz");
148 addWindowListener(new java.awt.event.WindowAdapter() {
149 public void windowActivated(java.awt.event.WindowEvent evt) {
150 formWindowActivated(evt);
154 gSplitPane1.setDividerLocation(this.getWidth() - 200);
155 gSplitPane1.setResizeWeight(0.5);
156 gSplitPane1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
157 public void propertyChange(java.beans.PropertyChangeEvent evt) {
158 gSplitPane1PropertyChange(evt);
162 gPersonalName.setText("Your Name");
163 gPersonalName.setToolTipText("Click to edit your profile");
164 gPersonalName.setMinimumSize(new java.awt.Dimension(64, 15));
166 gPersonalStatus.setText("My current status");
167 gPersonalStatus.addActionListener(new java.awt.event.ActionListener() {
168 public void actionPerformed(java.awt.event.ActionEvent evt) {
169 gPersonalStatusActionPerformed(evt);
173 gPersonalNewsFeed.setModel(new javax.swing.AbstractListModel() {
174 String[] strings = { "Server uptime: 1 hour" };
175 public int getSize() { return strings.length; }
176 public Object getElementAt(int i) { return strings[i]; }
178 gPersonalNewsFeed.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
179 gPersonalNewsFeed.setToolTipText("WSYD News Feed");
180 gPersonalNewsFeed.setMinimumSize(new java.awt.Dimension(64, 17));
181 gPersonalNewsFeed.setNextFocusableComponent(gPersonalName);
182 gScrollPane1.setViewportView(gPersonalNewsFeed);
184 javax.swing.GroupLayout gPersonalProfileLayout = new javax.swing.GroupLayout(gPersonalProfile);
185 gPersonalProfile.setLayout(gPersonalProfileLayout);
186 gPersonalProfileLayout.setHorizontalGroup(
187 gPersonalProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
188 .addGroup(gPersonalProfileLayout.createSequentialGroup()
190 .addGroup(gPersonalProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
191 .addComponent(gScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE)
192 .addComponent(gPersonalName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
193 .addComponent(gPersonalStatus))
194 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
196 gPersonalProfileLayout.setVerticalGroup(
197 gPersonalProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
198 .addGroup(gPersonalProfileLayout.createSequentialGroup()
200 .addComponent(gPersonalName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
202 .addComponent(gPersonalStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
203 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
204 .addComponent(gScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)
205 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
208 gDetails.addTab("News and Status", gPersonalProfile);
210 gLabelFriendName.setText("Friend's Name");
212 gTAreaFriendBio.setEditable(false);
213 gTAreaFriendBio.setColumns(35);
214 gTAreaFriendBio.setLineWrap(true);
215 gTAreaFriendBio.setRows(12);
216 gTAreaFriendBio.setTabSize(4);
217 gTAreaFriendBio.setText("Friend's Bio");
218 gTAreaFriendBio.setMinimumSize(new java.awt.Dimension(100, 50));
219 gTAreaFriendBio.setPreferredSize(new java.awt.Dimension(350, 156));
220 jScrollPane1.setViewportView(gTAreaFriendBio);
222 gListFriendInterests.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
223 gListFriendInterests.setModel(new javax.swing.AbstractListModel() {
224 String[] strings = { "Interest1", "Interest2", "Interest3", "..." };
225 public int getSize() { return strings.length; }
226 public Object getElementAt(int i) { return strings[i]; }
228 gListFriendInterests.setMinimumSize(new java.awt.Dimension(85, 85));
229 gListFriendInterests.setPreferredSize(new java.awt.Dimension(100, 85));
230 jScrollPane2.setViewportView(gListFriendInterests);
232 gLabelFriendBirthplace.setText("Birthplace:");
234 gLabelFriendBirthplaceData.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
235 gLabelFriendBirthplaceData.setText("Their Birthplace");
237 gLabelFriendLocation.setText("Current City/Town:");
239 gLabelFriendLocationData.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
240 gLabelFriendLocationData.setText("Their City/Town");
242 gTAreaFriendStatuses.setEditable(false);
243 gTAreaFriendStatuses.setColumns(20);
244 gTAreaFriendStatuses.setRows(5);
245 gTAreaFriendStatuses.setText("Friend's Three statuses");
246 jScrollPane3.setViewportView(gTAreaFriendStatuses);
248 gLabelFriendInterests.setText("Interests:");
250 gButtonAddFriendChat.setText("Add");
252 javax.swing.GroupLayout gFriendProfileLayout = new javax.swing.GroupLayout(gFriendProfile);
253 gFriendProfile.setLayout(gFriendProfileLayout);
254 gFriendProfileLayout.setHorizontalGroup(
255 gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
256 .addGroup(gFriendProfileLayout.createSequentialGroup()
257 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
258 .addGroup(gFriendProfileLayout.createSequentialGroup()
260 .addComponent(gLabelFriendLocation))
261 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, gFriendProfileLayout.createSequentialGroup()
263 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
264 .addComponent(gLabelFriendInterests, javax.swing.GroupLayout.Alignment.TRAILING)
265 .addComponent(gLabelFriendName, javax.swing.GroupLayout.Alignment.TRAILING)
266 .addComponent(gLabelFriendBirthplace, javax.swing.GroupLayout.Alignment.TRAILING))))
268 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
269 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
270 .addComponent(gLabelFriendLocationData)
271 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
272 .addComponent(gButtonAddFriendChat)
273 .addComponent(gLabelFriendBirthplaceData)))
275 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
276 .addComponent(jScrollPane1)
277 .addComponent(jScrollPane3))
280 gFriendProfileLayout.setVerticalGroup(
281 gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
282 .addGroup(gFriendProfileLayout.createSequentialGroup()
284 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
285 .addGroup(gFriendProfileLayout.createSequentialGroup()
286 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
288 .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
289 .addGroup(gFriendProfileLayout.createSequentialGroup()
290 .addComponent(gLabelFriendName)
292 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
293 .addComponent(gLabelFriendBirthplaceData)
294 .addComponent(gLabelFriendBirthplace))
296 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
297 .addComponent(gLabelFriendLocation)
298 .addComponent(gLabelFriendLocationData))
299 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
300 .addGroup(gFriendProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
301 .addComponent(gLabelFriendInterests)
302 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
303 .addGroup(gFriendProfileLayout.createSequentialGroup()
304 .addComponent(gButtonAddFriendChat)
305 .addGap(0, 0, Short.MAX_VALUE)))
309 gDetails.addTab("Friend Profile", gFriendProfile);
311 gSplitPane1.setLeftComponent(gDetails);
313 jList1.setModel(new javax.swing.AbstractListModel() {
314 String[] strings = { "Eddie Berrisford-Lynch", "Tom Thumb", "Peter Pan", "Freddy Mercury", "Sam Smith" };
315 public int getSize() { return strings.length; }
316 public Object getElementAt(int i) { return strings[i]; }
318 jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
319 jList1.setMaximumSize(new java.awt.Dimension(200, 119));
320 jList1.setMinimumSize(new java.awt.Dimension(100, 119));
321 jList1.setVisibleRowCount(30);
322 gOnlineList.setViewportView(jList1);
324 gSplitPane1.setRightComponent(gOnlineList);
326 getContentPane().add(gSplitPane1, java.awt.BorderLayout.CENTER);
328 gLabelFriendsOnlineQty.setText("Friends: 000");
330 gLabelFriendRequestsQty.setText("Requests Pending: 000");
332 gLabelOnlineQty.setText("Online: 000");
334 javax.swing.GroupLayout gStatusPanelLayout = new javax.swing.GroupLayout(gStatusPanel);
335 gStatusPanel.setLayout(gStatusPanelLayout);
336 gStatusPanelLayout.setHorizontalGroup(
337 gStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
338 .addGroup(gStatusPanelLayout.createSequentialGroup()
339 .addComponent(gLabelOnlineQty)
341 .addComponent(gLabelFriendsOnlineQty)
343 .addComponent(gLabelFriendRequestsQty)
344 .addContainerGap(651, Short.MAX_VALUE))
346 gStatusPanelLayout.setVerticalGroup(
347 gStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
348 .addGroup(gStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
349 .addComponent(gLabelFriendsOnlineQty)
350 .addComponent(gLabelFriendRequestsQty)
351 .addComponent(gLabelOnlineQty))
354 getContentPane().add(gStatusPanel, java.awt.BorderLayout.SOUTH);
357 }// </editor-fold>//GEN-END:initComponents
359 private void gPersonalStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gPersonalStatusActionPerformed
360 // TODO add your handling code here:
361 }//GEN-LAST:event_gPersonalStatusActionPerformed
363 private void gSplitPane1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_gSplitPane1PropertyChange
364 // TODO add your handling code here:
365 }//GEN-LAST:event_gSplitPane1PropertyChange
367 private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
368 // TODO add your handling code here:
369 }//GEN-LAST:event_formWindowActivated
371 private ClientGUI initNeighbourListener() {
372 _multicastAdvertiserSA = new WSYD_SocketAddress(Network.MULTICAST_IP, Network.PORTS_MULTICAST_DISCOVERY, WSYD_SocketAddress.Protocol.UDP);
373 _multicastService = new NetworkServerUDPMulticast(_multicastAdvertiserSA, _title + "MC", _serviceToAddressMap, LOGGER);
374 _multicastService.getEventManager().addNetworkMessageEventListener(this, "Neighbour");
375 _multicastService.execute();
376 _serviceToAddressMap.put("all", new ServiceAddressMap.LastSeenHost(new InetSocketAddress(Network.MULTICAST_IP, Network.PORTS_MULTICAST_DISCOVERY), ServiceAddressMap.LastSeenHost.STATE.STATIC));
381 private void initListeners() {
383 _udpNotificationServiceSA = new WSYD_SocketAddress(Network.IPv4_WILDCARD, Network.PORTS_EPHEMERAL, WSYD_SocketAddress.Protocol.UDP);
384 _udpNotificationService = new NetworkServerUDP(_udpNotificationServiceSA, _title + "_Notifier", _serviceToAddressMap, LOGGER);
385 _udpNotificationService.getEventManager().addNetworkMessageEventListener(this, "Notification");
386 _udpNotificationService.execute();
388 _tcpChatServiceSA = new WSYD_SocketAddress(Network.IPv4_WILDCARD, Network.PORTS_EPHEMERAL, WSYD_SocketAddress.Protocol.TCP);
389 _tcpChatService = new NetworkServerTCP(_tcpChatServiceSA, _title + "_Chat", _serviceToAddressMap, _tcpStreamManager, LOGGER);
390 _tcpChatService.getEventManager().addNetworkMessageEventListener(this, "ChatRequest");
391 _tcpChatService.execute();
393 ActionListener servicesAnnounceActionListener = new ActionListener() {
395 * Perform regular house-keeping tasks.
399 public void actionPerformed(ActionEvent e) {
400 // clean up the known hosts map
401 ArrayList<String> servicesRemoved = _serviceToAddressMap.cleanServiceAddressMap(5000);
402 for (String service: servicesRemoved) {
403 // FIXME: does the process care if hosts have been removed? if not, remove this array iteration
413 _regularTasks = new Timer(1000, servicesAnnounceActionListener);
414 _regularTasks.setInitialDelay(100);
415 _regularTasks.start();
419 private void connectionDialog() {
420 JProgressBar progressBar = new JProgressBar(0,100);
421 progressBar.setValue(0);
422 progressBar.setIndeterminate(true);
423 progressBar.setString("Waiting for Server...");
424 progressBar.setStringPainted(true);
425 System.err.println("Progress Bar created");
427 while (!_serviceToAddressMap.containsService("ServerSocialMC")) {
431 socialSocket = new Socket(_serviceToAddressMap.getServiceAddress("ServerSocialMC").getAddress(), Network.PORTS_SERVER_SOCIAL);
432 NetworkStream newStream = new NetworkStream(socialSocket, _tcpStreamManager);
433 _tcpStreamManager.addStream(NetworkStreamManager.SERVERSOCIAL, newStream);
434 } catch (IOException ex) {
435 //Logger.getLogger(ClientGUI.class.getName()).log(Level.SEVERE, null, ex);
436 System.err.println("IOException in connectionDialog()");
438 //progressBar.setIndeterminate(false);
439 //progressBar.setValue(100);
443 private void loginDialog()
445 //WSYD_Login login = new Login(this, true);
446 login.setLocationRelativeTo(null);
447 login.setVisible(true);
450 this.setLocationRelativeTo(null);
451 this.setVisible(true);
455 public void loginAbort()
460 public boolean validateLogin(String uName, String pWord)
462 boolean result = false;
463 System.out.println(uName + pWord + "<");
465 if (uName.equals("admin") && pWord.equals("admin"))
467 System.out.println("True");
468 loginSuccessful = true;
472 // TODO: wrap a login message with credentials
473 NetworkMessage message = new NetworkMessage("Login", null, new MessageLogin(uName, pWord));
474 _tcpStreamManager._tcpStreams.get(NetworkStreamManager.SERVERSOCIAL).write(message);
475 // TODO: send login credentials to server for verification
481 public void regiProfileDialog()
483 EditProfile registration = new EditProfile(this, true);
484 registration.setLocationRelativeTo(null);
485 registration.setVisible(true);
489 this.setLocationRelativeTo(null);
490 this.setVisible(true);
494 public boolean confirmRegistration(String uName, String pWord, String bPlace, String cLocation, TreeSet interests, String bio)
496 System.out.println(uName);
497 System.out.println(pWord);
498 System.out.println(bPlace);
499 System.out.println(cLocation);
501 System.out.println(bio);
502 //TO DO: If server accepts registration return true
503 regiSuccessful = true;
510 * @param args the command line arguments
512 public static void main(String args[]) {
513 /* Set the Nimbus look and feel */
514 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
515 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
516 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
519 for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
520 if ("Nimbus".equals(info.getName())) {
521 javax.swing.UIManager.setLookAndFeel(info.getClassName());
525 } catch (ClassNotFoundException ex) {
526 java.util.logging.Logger.getLogger(ClientGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
527 } catch (InstantiationException ex) {
528 java.util.logging.Logger.getLogger(ClientGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
529 } catch (IllegalAccessException ex) {
530 java.util.logging.Logger.getLogger(ClientGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
531 } catch (javax.swing.UnsupportedLookAndFeelException ex) {
532 java.util.logging.Logger.getLogger(ClientGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
539 /* Create and display the form */
540 java.awt.EventQueue.invokeLater(new Runnable() {
542 new ClientGUI().initNeighbourListener().connectionDialog();
547 // Variables declaration - do not modify//GEN-BEGIN:variables
548 private javax.swing.JButton gButtonAddFriendChat;
549 private javax.swing.JTabbedPane gDetails;
550 private javax.swing.JPanel gFriendProfile;
551 private javax.swing.JLabel gLabelFriendBirthplace;
552 private javax.swing.JLabel gLabelFriendBirthplaceData;
553 private javax.swing.JLabel gLabelFriendInterests;
554 private javax.swing.JLabel gLabelFriendLocation;
555 private javax.swing.JLabel gLabelFriendLocationData;
556 private javax.swing.JLabel gLabelFriendName;
557 private javax.swing.JLabel gLabelFriendRequestsQty;
558 private javax.swing.JLabel gLabelFriendsOnlineQty;
559 private javax.swing.JLabel gLabelOnlineQty;
560 private javax.swing.JList gListFriendInterests;
561 private javax.swing.JScrollPane gOnlineList;
562 private javax.swing.JLabel gPersonalName;
563 private javax.swing.JList gPersonalNewsFeed;
564 private javax.swing.JPanel gPersonalProfile;
565 private javax.swing.JTextField gPersonalStatus;
566 private javax.swing.JScrollPane gScrollPane1;
567 private javax.swing.JSplitPane gSplitPane1;
568 private javax.swing.JPanel gStatusPanel;
569 private javax.swing.JTextArea gTAreaFriendBio;
570 private javax.swing.JTextArea gTAreaFriendStatuses;
571 private javax.swing.JList jList1;
572 private javax.swing.JScrollPane jScrollPane1;
573 private javax.swing.JScrollPane jScrollPane2;
574 private javax.swing.JScrollPane jScrollPane3;
575 // End of variables declaration//GEN-END:variables
578 public void NetworkMessageReceived(NetworkMessageEvent event) {
579 NetworkMessage nm = event.getNetworkMessage();
583 System.err.println(MessageFormat.format("Network Message received with intent {0} from sender {1}", nm.getIntent(), nm.getSender()));