Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;

public class Main {

    public static void main(String[] args) {
        JPanel ui = new JPanel(new BorderLayout(20, 20));

        ui.setBorder(new LineBorder(Color.RED, 1));

        JTextField fileName = new JTextField();
        ui.add(fileName, BorderLayout.NORTH);

        JPanel buttonPanel = new JPanel(new GridLayout(1, 0, 10, 30));
        ui.add(buttonPanel, BorderLayout.CENTER);

        JButton creater = new JButton("Create File");
        buttonPanel.add(creater);
        JButton deleter = new JButton("Delete File");
        buttonPanel.add(deleter);

        JOptionPane.showMessageDialog(null, ui);

    }
}