Guest User

Untitled

a guest
Apr 24th, 2013
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. import javax.swing.JFrame;
  2. import javax.swing.JLabel;
  3. import javax.swing.UIManager;
  4. import javax.swing.UnsupportedLookAndFeelException;
  5.  
  6. public class IMManager extends JFrame {
  7.     private JLabel info;
  8.     private ConnectionThread connThr;
  9.    
  10.    
  11.     public static void main(String[] args) {
  12.        
  13.                 new IMManager();
  14.        
  15.        
  16.      
  17.     }
  18.    
  19.    
  20.     public IMManager(){
  21.         super("IM Manager");
  22.        
  23.         try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }
  24.         catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {}
  25.         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  26.        
  27.         this.setSize(400,400);
  28.        
  29.         this.info=new JLabel("0");
  30.         this.add(info);
  31.        
  32.        
  33.        
  34.         this.setVisible(true);
  35.        
  36.         this.connThr = new ConnectionThread(this);
  37.         connThr.start();
  38.     }
  39.    
  40.    
  41.     public void update(Management manage){
  42.        
  43.         System.out.println(String.valueOf(manage.getClientsCount()));
  44.         this.info.setText(String.valueOf(manage.getClientsCount()));
  45.         this.info.repaint();
  46.        
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment