Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/integralsource/monsoon/jfc/StatusPanel.java


1   /*
2    *  Copyright (c) 2001 John Keyes
3    *
4    *  This program is free software; you can redistribute it and/or
5    *  modify it under the terms of the GNU General Public License
6    *  as published by the Free Software Foundation; either version 2
7    *  of the License, or (at your option) any later version.
8    *
9    *  This program is distributed in the hope that it will be useful,
10   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   *  GNU General Public License for more details.
13   *
14   *  You should have received a copy of the GNU General Public License
15   *  along with this program; if not, write to:
16   *  Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
17   *  Boston, MA  02111-1307, USA. 
18   *
19   *  $Id: StatusPanel.java,v 1.4 2001/06/16 14:11:29 jbjk Exp $
20   */
21  package org.integralsource.monsoon.jfc;
22  
23  /**
24   * Status Panel for the application
25   */
26  public class StatusPanel extends javax.swing.JPanel {
27  
28      private javax.swing.JLabel _date = new javax.swing.JLabel();
29  
30      public StatusPanel() {
31    __init();
32      }
33  
34      private void __init() {
35    java.awt.GridBagLayout $layout = new java.awt.GridBagLayout();
36    java.awt.GridBagConstraints $constraints = new java.awt.GridBagConstraints();
37    setLayout($layout);
38  
39    _date.setText(__getDateAsString());
40    _date.setFont(__getDateLabelFont());
41    _date.setForeground(java.awt.Color.darkGray);
42    $constraints.anchor = $constraints.SOUTHEAST;
43    $constraints.weightx = 1.0;
44    $constraints.fill = $constraints.NONE;
45    $constraints.ipady = 5;
46    $layout.setConstraints(_date,$constraints);
47    add(_date);
48  
49    setBorder(new javax.swing.border.EtchedBorder());
50      }
51  
52      private String __getDateAsString() {
53    java.text.SimpleDateFormat $formatter 
54        = new java.text.SimpleDateFormat ("MMMM dd, yyyy ");
55    return $formatter.format(new java.util.Date());
56      }
57  
58      private java.awt.Font __getDateLabelFont() {
59    return new java.awt.Font("Helvetica",java.awt.Font.PLAIN,10);
60      }
61  }