Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JSplitPane;

public class Main {
    public static void main(String[] a) {
        JFrame horizontalFrame = new JFrame();
        horizontalFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JComponent leftButton = new JButton("Left");
        JComponent rightButton = new JButton("Right");
        JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        splitPane.setLeftComponent(leftButton);
        splitPane.setRightComponent(rightButton);

        horizontalFrame.add(splitPane, BorderLayout.CENTER);
        horizontalFrame.setSize(150, 150);
        horizontalFrame.setVisible(true);

    }
}