View Javadoc

1   /*
2      Copyright 2002-2006 Martin van den Bemt
3   
4      Licensed under the Apache License, Version 2.0 (the "License");
5      you may not use this file except in compliance with the License.
6      You may obtain a copy of the License at
7   
8          http://www.apache.org/licenses/LICENSE-2.0
9   
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15  */
16  package org.xulux.guilayer.swing.extensions;
17  
18  import javax.swing.JTextArea;
19  import javax.swing.LookAndFeel;
20  
21  /**
22   * @author <a href="mailto:martin@mvdb.net">Martin van den Bemt</a>
23   * @version $Id: MultipleLineHeader.java,v 1.1 2005/12/18 12:58:18 mvdb Exp $
24   */
25  public class MultipleLineHeader extends JTextArea {
26    
27    /**
28     * The constructor for the multiple line header.
29     * @param title the tile of the header.
30     */
31    public MultipleLineHeader(String title) {
32      super(title);
33    }
34    
35    public void updateUI() {
36      super.updateUI();
37      setLineWrap(false);
38      setWrapStyleWord(false);
39      setHighlighter(null);
40      setEditable(false);
41      // insert the gui specifics..
42      LookAndFeel.installColorsAndFont(this, "TableHeader.background", "TableHeader.foreground", "TableHeader.font");
43      LookAndFeel.installBorder(this, "TableHeader.cellBorder");
44      setAlignmentX(JTextArea.CENTER_ALIGNMENT);
45      setAlignmentY(JTextArea.CENTER_ALIGNMENT);
46    }
47  
48  }