/*
 * JXHeaderDemo.java
 *
 * Created on November 20, 2006, 3:09 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.jdesktop.swingx;

import java.awt.Dimension;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.SwingConstants;
import javax.swing.UIManager;

/**
 *
 * @author richardallenbair
 */
public class JXStatusBarDemo {
    private JPanel panel;
    
    public JXStatusBarDemo() {
        panel = new JPanel();
        panel.setLayout(new VerticalLayout(3));
        
        //create the status bar
        JXStatusBar bar = new JXStatusBar();
        
        //create and add the message label
        JLabel messageLabel = new JLabel("Ready");
        bar.add(messageLabel, JXStatusBar.Constraint.ResizeBehavior.FILL);
        
        //create and add the mouse position indicator
        final javax.swing.JLabel mousePositionLabel = new javax.swing.JLabel("230, 320");
        mousePositionLabel.setHorizontalAlignment(SwingConstants.CENTER);
        mousePositionLabel.setPreferredSize(new Dimension(80, mousePositionLabel.getPreferredSize().height));
        bar.add(mousePositionLabel);
        
        //create and add the caps lock indicator
        final JLabel capslockLabel = new JLabel("Authenticated");
        capslockLabel.setHorizontalAlignment(SwingConstants.CENTER);
        bar.add(capslockLabel);
        
        //create and add the shift indicator
        final JLabel shiftLabel = new JLabel("Power User");
        shiftLabel.setPreferredSize(capslockLabel.getPreferredSize());
        shiftLabel.setHorizontalAlignment(SwingConstants.CENTER);
        bar.add(shiftLabel);
        
        //create and add the progress bar
        JProgressBar progress = new JProgressBar();
        bar.add(progress);
        progress.setIndeterminate(true);
        
        panel.add(bar);
        
        //Add a second bar
        bar = new JXStatusBar();
        JComboBox combo1 = new JComboBox(new String[]{"AA", "BB", "CC"});
        
        bar.add(new JLabel("Fill portion"), JXStatusBar.Constraint.ResizeBehavior.FILL);
        bar.add(combo1);
        bar.add(new JLabel("jabcdefghijklm"));
        bar.add(new JLabel("gnopqrstuvwxyz"));
        
        panel.add(bar);
    }
    
    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        frame.setSize(400, 400);
        frame.add(new JXStatusBarDemo().panel);
        frame.setVisible(true);
    }
    
}

@@ -3,412 +3,941 @@
 %0A * 
-JXHeaderDemo.java%0A *%0A * Created on November 20, 2006, 3:09 PM%0A *%0A * To
+$Id$%0A *%0A * Copyright 2006 Sun Microsystems, Inc., 4150 Network Circle,%0A * Santa Clara, California 95054, U.S.A. All rights reserved.%0A *%0A * This library is free software; you
  c
-h
 an
-ge this template, choose Tools %7C Template Manager%0A * and open the template in the editor.%0A */%0A%0Apackage org.jdesktop.swingx;%0A%0Aimport java.awt.Dimension;%0Aimport javax.swing.JComboBox;%0Aimport javax.swing.JFrame;%0Aimport javax.swing.JLabel;%0Aimport javax.swing.JPanel;%0Aimport javax.swing.JProgressBar;%0Aimport javax.swing.SwingConstants
+ redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation; either%0A * version 2.1 of the License, or (at your option) any later version.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A * You should have received a copy of the GNU Lesser General Public%0A * License along with this library; if not, write to the Free Software%0A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA%0A */%0A%0Apackage org.jdesktop.swingx;%0A%0Aimport java.awt.Dimension
 ;%0Aim
@@ -953,25 +953,17 @@
 x.swing.
-UIManager
+*
 ;%0A%0A/**%0A 
@@ -980,19 +980,8 @@
 or r
-ichardallen
 bair
@@ -1018,40 +1018,24 @@
 emo 
-%7B%0A    private JPanel panel;%0A    
+extends JPanel %7B
 %0A   
@@ -1074,44 +1074,8 @@
     
-panel = new JPanel();%0A        panel.
 setL
@@ -2427,38 +2427,32 @@
        %0A        
-panel.
 add(bar);%0A      
@@ -2826,14 +2826,8 @@
     
-panel.
 add(
@@ -2900,176 +2900,83 @@
     
-try %7B%0A            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D
+SwingUtilities.invokeLater(new Runnable() %7B%0A            public void run() %7B
 %0A   
@@ -2972,33 +2972,32 @@
 run() %7B%0A        
-%0A
         JFrame f
@@ -3013,24 +3013,32 @@
 w JFrame();%0A
+        
         fram
@@ -3087,32 +3087,40 @@
 CLOSE);%0A        
+        
 frame.setLocatio
@@ -3134,24 +3134,32 @@
 veTo(null);%0A
+        
         fram
@@ -3183,24 +3183,32 @@
 0);%0A        
+        
 frame.add(ne
@@ -3230,25 +3230,23 @@
 mo()
-.panel);%0A
+);%0A    
         
 fram
@@ -3233,32 +3233,36 @@
 ));%0A            
+    
 frame.setVisible
@@ -3265,24 +3265,50 @@
 ible(true);%0A
+            %7D%0A        %7D);%0A
     %7D%0A    %0A%7D

Update demo for JXStatusBar