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

package com.elex_project.examples.container;

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

public class TabbedpaneExample extends JTabbedPane {
	public TabbedpaneExample() {
		super();

		final JPanel panel1 = new JPanel(new BorderLayout());
		panel1.add(new JLabel("A"), BorderLayout.CENTER);
		final JPanel panel2 = new JPanel(new BorderLayout());
		panel2.add(new JLabel("B"), BorderLayout.CENTER);

		addTab("Tab 1", panel1);
		addTab("Tab 2", panel2);

	}

	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 TabbedpaneExample());

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


	}
}
