KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > adminGui > main > StatusBar


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: $
8
package org.ozoneDB.adminGui.main;
9
10 import java.awt.*;
11 import javax.swing.*;
12
13 import org.ozoneDB.adminGui.res.Settings;
14
15 /**
16  * @author Per Nyfelt
17  */

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 JavaDoc text) {
24         init(text);
25     }
26
27     public void setText(String JavaDoc text) {
28         textLabel.setText(text);
29     }
30
31     public void setFound(String JavaDoc messageKey, int value) {
32         textLabel.setText(value + " " + messageKey);
33     }
34
35     private void init(String JavaDoc 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