Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.UIManager;
- import javax.swing.UnsupportedLookAndFeelException;
- public class IMManager extends JFrame {
- private JLabel info;
- private ConnectionThread connThr;
- public static void main(String[] args) {
- new IMManager();
- }
- public IMManager(){
- super("IM Manager");
- try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }
- catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {}
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.setSize(400,400);
- this.info=new JLabel("0");
- this.add(info);
- this.setVisible(true);
- this.connThr = new ConnectionThread(this);
- connThr.start();
- }
- public void update(Management manage){
- System.out.println(String.valueOf(manage.getClientsCount()));
- this.info.setText(String.valueOf(manage.getClientsCount()));
- this.info.repaint();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment