/** Creates new form ServerView */ public ServerMngView(ServerMng model) { this.model = model; model.addObserver(this); initComponents(); getRootPane().setDefaultButton(hide); PlantloreHelp.addKeyHelp(PlantloreHelp.SERVER, this.getRootPane()); PlantloreHelp.addButtonHelp(PlantloreHelp.SERVER, this.help); // Show the progress bar only when necessary. progress.setVisible( false ); setLocationRelativeTo(null); // center of the screen }
/** * Reload the list of the connected clients and * show the dialog when the connection or the creation was successful. */ public void update(Observable source, final Object parameter) { if(parameter == ServerMng.UPDATE_LIST){ ConnectionInfo[] clients = model.getConnectedUsers(); if(clients != null) users.setListData(clients); else users.setListData(new String[] {""}); } else if( parameter == ServerMng.CONNECTED ) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { setVisible(true); } }); Dispatcher.initialize( progress ); } }