CodePaste Logo
New Snippet New Recent Snippets Recent Snippets My Snippets My Snippets My Favorites Favorites Web Code Search Snippets Search
Sign inor Register
Language: java

thread sends its object second time

89 Views   
private void addBuddiesActionPerformed(java.awt.event.ActionEvent evt) { try { String addNewBuddy = JOptionPane.showInputDialog(this, "Enter the Username of the person who you want to add..."); mainClient.setBuddyRequest(true); mainClient.setBuddyRequestAccount(addNewBuddy); send.writeObject(mainClient); send.flush(); System.out.println("mainClient.setBuddyRequest : " + mainClient.isBuddyRequest() + " setBuddyRequestAccount : " + mainClient.getBuddyRequestAccount()); ClientObject tempClientObject; while(( tempClientObject = (ClientObject) receive.readObject()) != null){ if( !tempClientObject.isBuddyRequest() ){ JOptionPane.showMessageDialog(this, "Buddy Request Information", "Requested buddy doesnt exist!!!", JOptionPane.ERROR_MESSAGE); break; } else{ JOptionPane.showMessageDialog(this, "Buddy Request Information", "Requested buddy added into your buddy list succesfully", JOptionPane.INFORMATION_MESSAGE); labelSetText = tempClientObject.getNickName(); onlineStatus = tempClientObject.isIsOnline(); model.addElement(createPanel()); } } } catch (IOException ex) { Logger.getLogger(ClientThread.class.getName()).log(Level.SEVERE, null, ex); } catch ( ClassNotFoundException ex){ Logger.getLogger(ClientThread.class.getName()).log(Level.SEVERE, null, ex); } }
by quartaela
  March 27, 2013 @ 12:44pm
Add a comment


Report Abuse
brought to you by:
West Wind Techologies