KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > adminGui > widget > QuickLabel


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: QuickLabel.java,v 1.1 2003/03/24 08:36:56 per_nyfelt Exp $
8
package org.ozoneDB.adminGui.widget;
9
10 import javax.swing.*;
11 import java.awt.*;
12
13 /**
14  * A JLabel with some extra constructors making usage more easier
15  */

16 public class QuickLabel extends JLabel {
17
18     public QuickLabel() {
19         super();
20     }
21
22     public QuickLabel(String JavaDoc text) {
23         super();
24         this.setText(text);
25     }
26
27     public QuickLabel(String JavaDoc text, Color foreground) {
28         super();
29         this.setText(text);
30         setForeground(foreground);
31     }
32
33     public QuickLabel(String JavaDoc text, int fontStyle, float fontSize) {
34         super();
35         this.setText(text, fontStyle, fontSize);
36     }
37
38     public void setText(String JavaDoc text, int fontStyle, float fontSize) {
39
40         setFont(getFont().deriveFont(fontStyle, fontSize));
41         this.setText(text);
42     }
43 }
44
Popular Tags