1 package org.ozoneDB.adminGui.main; 9 10 import java.awt.*; 11 import javax.swing.*; 12 13 import org.ozoneDB.adminGui.res.Settings; 14 15 18 public class StatusBar extends JPanel { 19 20 private JLabel textLabel = new JLabel(); 21 private static final Dimension DIMENSION = new Dimension(Settings.STATUS_WIDTH, Settings.STATUS_HEIGHT); 22 23 public StatusBar(String text) { 24 init(text); 25 } 26 27 public void setText(String text) { 28 textLabel.setText(text); 29 } 30 31 public void setFound(String messageKey, int value) { 32 textLabel.setText(value + " " + messageKey); 33 } 34 35 private void init(String text) { 36 37 setBackground(Settings.COLOR_COBALT); 38 textLabel.setForeground(Color.WHITE); 39 textLabel.setBackground(Color.GREEN); 40 setText(text); 41 setPreferredSize(DIMENSION); 42 setMaximumSize(DIMENSION); 43 setMinimumSize(DIMENSION); 44 setBorder(BorderFactory.createEmptyBorder()); 45 setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); 46 add(Box.createHorizontalGlue()); 47 add(textLabel); 48 add(Box.createHorizontalStrut(5)); 49 } 50 } | Popular Tags |