/*
 * Copyright (c) 2024. Elex. All Rights Reesrved.
 * https://www.elex-project.com/
 */

package com.elex_project.examples.components.toolbar;

import javax.swing.*;
import java.awt.*;

public class ToolBarExample extends JPanel {
	public ToolBarExample() {
		super(new BorderLayout());

		final JToolBar toolBar = new JToolBar("I'm a ToolBar");

		toolBar.add(new JButton("Button 1"));
		toolBar.add(new JButton("Button 2"));
		toolBar.addSeparator();
		toolBar.add(new JTextField("Hello"));

		toolBar.setRollover(true);
		toolBar.setFloatable(true);

		add(toolBar, BorderLayout.NORTH);
		add(new JPanel(), BorderLayout.CENTER);

	}

	public static void main(String... args) {

		final JFrame jFrame = new JFrame();
		jFrame.setTitle("Example");
		jFrame.setSize(800, 600);
		jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jFrame.setContentPane(new ToolBarExample());

		SwingUtilities.invokeLater(() -> {
			jFrame.setVisible(true);
		});


	}
}
