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

package com.elex_project.examples.container;

import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.Dictionary;
import java.util.Hashtable;

public class SplitpaneExample extends JSplitPane {
	public SplitpaneExample() {
		super();

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

		setOrientation(JSplitPane.HORIZONTAL_SPLIT);
		setDividerLocation(280);
		leftPanel.setMinimumSize(new Dimension(200,0));
		setLeftComponent(leftPanel);
		setRightComponent(rightPanel);

	}

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

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


	}
}
