package de.fh_mainz.awis.bruchmann;
/*
Swing Hacks Tips and Tools for Killer GUIs
By Joshua Marinacci, Chris Adamson
First Edition June 2005
Series: Hacks
ISBN: 0-596-00907-0
Pages: 542
website: http://www.oreilly.com/catalog/swinghks/
*/
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.SystemColor;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.UIManager;
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
public class StatusbarExample {
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(new WindowsLookAndFeel());
} catch (Exception e) {
}
JFrame frame = new JFrame();
frame.setBounds(200, 200, 600, 200);
frame.setTitle("Status bar simulator");
Container contentPane = frame.getContentPane();
contentPane.setLayout(new BorderLayout());
/*MiddlePart middlePart = new MiddlePart();
contentPane.add(middlePart, BorderLayout.NORTH);
StatusBar statusBar = new StatusBar();
contentPane.add(statusBar, BorderLayout.SOUTH);*/
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
/*@SuppressWarnings("serial")
class MiddlePart extends JPanel {
@SuppressWarnings("deprecation")
public MiddlePart() {
//setLayout(new BorderLayout());
//setPreferredSize(new Dimension(10, 23));
JPanel middlePanel = new JPanel();
//Container cp = getContentPane();
//cp.setLayout(new GridLayout(25,25));
for (int i=0;i<2;i++) {
JButton button = new JButton(Integer.toString(i));
button.setName("test");
button.setBackground(Color.red);
middlePanel.add(button);
}
add(middlePanel, BorderLayout.NORTH);
//setBackground(SystemColor.control);
}
}*/
/*@SuppressWarnings("serial")
class Statusbar extends JPanel {
public Statusbar() {
setLayout(new BorderLayout());
setPreferredSize(new Dimension(10, 23));
JPanel rightPanel = new JPanel(new BorderLayout());
//rightPanel.add(new JLabel(new AngledLinesWindowsCornerIcon()), BorderLayout.SOUTH);
rightPanel.setOpaque(false);
JLabel label1 = new JLabel("Statusleiste", JLabel.CENTER);
//label1.setSize(10, 23);
//label1.setPreferredSize(new Dimension(10,23));
//label1.setText("Statusleiste");
label1.setHorizontalTextPosition(JLabel.CENTER);
rightPanel.add(label1);
//add(rightPanel, BorderLayout.EAST);
//add(rightPanel, BorderLayout.SOUTH);
setBackground(SystemColor.control);
//System.out.println(rightPanel.getBounds());
}
}*/