/** * Remove a status component. */ public void removeStatusComponent(Object id) { // todo: shift other components if(components.containsKey(id)) { components.remove(id); layoutComponents(); } }
/** * Add a status component. */ public void addStatusComponent(Object id, Component comp) { if(!components.containsKey(id)) { components.put(id, comp); layoutComponents(); } }
/** * Create a new status bar. */ public StatusBar() { this.components = new LinkedHashMap(); this.textl = new JLabel(" "); this.timer = new Timer(5000, new ActionListener() { public void actionPerformed(ActionEvent e) { textl.setText(" "); timer.stop(); } }); this.setBorder(new BevelBorder(BevelBorder.LOWERED)); this.setLayout(new GridBagLayout()); layoutComponents(); }