01: /*
02: * Gruntspud
03: *
04: * Copyright (C) 2002 Brett Smith.
05: *
06: * Written by: Brett Smith <t_magicthize@users.sourceforge.net>
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Library General Public License
10: * as published by the Free Software Foundation; either version 2 of
11: * the License, or (at your option) any later version.
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU Library General Public License for more details.
16: *
17: * You should have received a copy of the GNU Library General Public
18: * License along with this program; if not, write to the Free Software
19: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20: */
21:
22: package gruntspud.ui;
23:
24: import javax.swing.JLabel;
25: import javax.swing.JTextArea;
26:
27: /**
28: * DOCUMENT ME!
29: *
30: * @author $author$
31: */
32: public class JTextBox extends JTextArea {
33: /** Construct a new text box with no text
34: *
35: * @param none
36: */
37: public JTextBox() {
38: this ("");
39: }
40:
41: /** Construct a text box with some text
42: *
43: * @param String text
44: */
45: public JTextBox(String text) {
46: this (text, 0, 0);
47: }
48:
49: /** Construct a text box with some text
50: *
51: * @param String text
52: * @param int rows
53: * @param int columns
54: */
55: public JTextBox(String text, int rows, int columns) {
56: super (rows, columns);
57: setOpaque(false);
58: setWrapStyleWord(true);
59: setLineWrap(true);
60: setText(text);
61:
62: JLabel l = new JLabel();
63: setBackground(l.getBackground());
64: setForeground(l.getForeground());
65: setBorder(l.getBorder());
66: setFont(l.getFont());
67: setEditable(false);
68: }
69: }
|