Guest User

Untitled

a guest
Jan 9th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. private void run_use_listener() {
  2.  
  3. SwingWorker<Void,Void> worker = new SwingWorker<Void, Void>() {
  4. @Override
  5. protected Void doInBackground() throws Exception {
  6. //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  7. //System.out.println("SHIZZZZZZZZZZZZZ");
  8. ServerSocket ss = new ServerSocket(3333);
  9. Socket sss = ss.accept();
  10. DataInputStream dis = new DataInputStream(sss.getInputStream());
  11.  
  12. int fb_stop = dis.readInt();
  13. if(fb_stop==1){
  14. //System.out.println("SHIZZZZZZZZZZZZZ");
  15. PC_1.setBackground(Color.RED);
  16. pc_stat1_lbl.setText("Used");
  17. vacant[1]=0;
  18. reserved[1]=0;
  19. used[1]=1;
  20. ss.close();
  21. }
  22.  
  23. return null;
  24. }
  25. };
  26. worker.execute();
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment