/* * $Id: LocationBarDemo.java,v 1.4 2003/03/20 05:27:39 zfq Exp $ * * Copyright (C) 2001-2003 Extreme Component, Inc. All rights reserved. * Use is subject to license terms. */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import com.zfqjava.swing.JLocationBar; /** * JLocationBar Demo * * @author $Author: zfq $ * @version $Revision: 1.4 $ $Date: 2003/03/20 05:27:39 $ */ public class LocationBarDemo extends JPanel { private JLocationBar locationBar; public LocationBarDemo() { setLayout(new BorderLayout()); locationBar = new JLocationBar(); add(locationBar, BorderLayout.NORTH); } public static void main(String[] args) { JFrame f = new JFrame("JLocationBar Demo"); DemoPanel demoPanel = new DemoPanel(); demoPanel.addDemo(new LocationBarDemo()); f.getContentPane().add(demoPanel); f.setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE); f.pack(); centerOnScreen(f); f.show(); } public static void centerOnScreen(Window window) { Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); window.setLocation((d.width - window.getWidth())/2, (d.height - window.getHeight())/2); } }