package de.javasoft.synthetica.democenter.examples.header;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.UIManager;

import org.jdesktop.swingx.JXHeader;

/**
 * A simple JXHeader application to demonstrate and explain  
 * basic functionality.
 */
@SuppressWarnings("serial")
public class SimpleHeader extends JFrame
{
  public SimpleHeader()
  {
    super("Simple Header");
    
    Icon icon = new ImageIcon(getClass().getResource("/de/javasoft/synthetica/democenter/examples/header/configure.png"));
//@highlight
    JXHeader header = new JXHeader();
    header.setTitle("My Header Title");
    header.setDescription("Description area for the header description. You can put all additional, relevant informations to the description panel.");
    header.setIcon(icon);
//@/highlight

//@highlight
    add(header, BorderLayout.NORTH);
//@/highlight    
    //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);      
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setSize(400, 300);
    setLocationRelativeTo(null);        //center
    setVisible(true);
  }

  /**
   * Static main method for application startup. 
   */
  public static void main(String[] args)
  {
    EventQueue.invokeLater(new Runnable()
    {
      public void run()
      {
        try
        {
          UIManager.setLookAndFeel("de.javasoft.plaf.synthetica.SyntheticaStandardLookAndFeel");
          new SimpleHeader();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
      }
    });
  }  
}
