Here's a simple Java program that implements a calculator with a GUI using the Swing library:

```java
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class SimpleCalculator {
    private JFrame frame;
    private JTextField textField;
    private JButton[] numberButtons = new JButton[10];
    private JButton addButton, subButton, mulButton, divButton, decimalButton, equalButton, clearButton;
    private JPanel panel;

    private double num1 = 0, num2 = 0, result = 0;
    private char operator;

    public static void main(String[] args) {
        EventQueue.invokeLater(() -> {
            try {
                SimpleCalculator window = new SimpleCalculator();
                window.frame.setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }

    public SimpleCalculator() {
        createUI();
    }

    private void createUI() {
        frame = new JFrame("Simple Calculator");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(250, 400);

        Container container = frame.getContentPane();
        container.setLayout(new BorderLayout());

        textField = new JTextField();
        container.add(textField, BorderLayout.NORTH);

        panel = new JPanel();
        panel.setLayout(new GridLayout(4, 4));
        container.add(panel, BorderLayout.CENTER);

        for (int i = 0; i < 10; i++) {
            numberButtons[i] = new JButton(String.valueOf(i));
            numberButtons[i].addActionListener(new NumberButtonAction());
        }

        addButton = new JButton("+");
        subButton = new JButton("-");
        mulButton = new JButton("*");
        divButton = new JButton("/");
        decimalButton = new JButton(".");
        equalButton = new JButton("=");
        clearButton = new JButton("C");

        addButton.addActionListener(new OperationButtonAction());
        subButton.addActionListener(new OperationButtonAction());
        mulButton.addActionListener(new OperationButtonAction());
        divButton.addActionListener(new OperationButtonAction());
        decimalButton.addActionListener(new DecimalButtonAction());
        equalButton.addActionListener(new EqualButtonAction());
        clearButton.addActionListener(e -> textField.setText(""));

        panel.add(numberButtons[7]);
        panel.add(numberButtons[8]);
        panel.add(numberButtons[9]);
        panel.add(addButton);
        panel.add(numberButtons[4]);
        panel.add(numberButtons[5]);
        panel.add(numberButtons[6]);
        panel.add(subButton);
        panel.add(numberButtons[1]);
        panel.add(numberButtons[2]);
        panel.add(numberButtons[3]);
        panel.add(mulButton);
        panel.add(clearButton);
        panel.add(numberButtons[0]);
        panel.add(decimalButton);
        panel.add(divButton);
        panel.add(equalButton);
    }

    private class NumberButtonAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            String currentText = textField.getText();
            JButton source = (JButton) e.getSource();
            textField.setText(currentText + source.getText());
        }
    }

    private class OperationButtonAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            num1 = Double.parseDouble(textField.getText());
            operator = ((JButton) e.getSource()).getText().charAt(0);
            textField.setText("");
        }
    }

    private class DecimalButtonAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            if (!textField.getText().contains(".")) {
                textField.setText(textField.getText() + ".");
            }
        }
    }

    private class EqualButtonAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            num2 = Double.parseDouble(textField.getText());

            switch (operator) {
                case '+':
                    result = num1 + num2;
                    break;
                case '-':
                    result = num1 - num2;
                    break;
                case '*':
                    result = num1 * num2;
                    break;
                case '/':
                    if (num2 == 0) {
                        JOptionPane.showMessageDialog(frame, "Cannot divide by zero!");
                        return;
                    }
                    result = num1 / num2;
                    break;
            }

            textField.setText(String.valueOf(result));
        }
    }
}
```

This program creates a simple calculator with buttons for numbers 0-9, decimal point, and the four arithmetic operations. It also has an "equals" button to perform the calculation and a "clear" button to clear the input field. The calculator uses Swing components for the GUI and ActionListener interfaces for handling button clicks.
다음은 Swing 라이브러리를 사용하여 GUI가 있는 계산기를 구현하는 간단한 Java 프로그램입니다:

```java
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class SimpleCalculator {
    private JFrame frame;
    private JTextField textField;
    private JButton[] numberButtons = new JButton[10];
    private JButton addButton, subButton, mulButton, divButton, decimalButton, equalButton, clearButton;
    private JPanel panel;

    private double num1 = 0, num2 = 0, result = 0;
    private char operator;

    public static void main(String[] args) {
        EventQueue.invokeLater(() -> {
            try {
                SimpleCalculator window = new SimpleCalculator();
                window.frame.setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }

    public SimpleCalculator() {
        createUI();
    }

    private void createUI() {
        frame = new JFrame("Simple Calculator");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(250, 400);

        Container container = frame.getContentPane();
        container.setLayout(new BorderLayout());

        textField = new JTextField();
        container.add(textField, BorderLayout.NORTH);

        panel = new JPanel();
        panel.setLayout(new GridLayout(4, 4));
        container.add(panel, BorderLayout.CENTER);

        for (int i = 0; i < 10; i++) {
            numberButtons[i] = new JButton(String.valueOf(i));
            numberButtons[i].addActionListener(new NumberButtonAction());
        }

        addButton = new JButton("+");
        subButton = new JButton("-");
        mulButton = new JButton("*");
        divButton = new JButton("/");
        decimalButton = new JButton(".");
        equalButton = new JButton("=");
        clearButton = new JButton("C");

        addButton.addActionListener(new OperationButtonAction());
        subButton.addActionListener(new OperationButtonAction());
        mulButton.addActionListener(new OperationButtonAction());
        divButton.addActionListener(new OperationButtonAction());
        decimalButton.addActionListener(new DecimalButtonAction());
        equalButton.addActionListener(new EqualButtonAction());
        clearButton.addActionListener(e -> textField.setText(""));

        panel.add(numberButtons[7]);
        panel.add(numberButtons[8]);
        panel.add(numberButtons[9]);
        panel.add(addButton);
        panel.add(numberButtons[4]);
        panel.add(numberButtons[5]);
        panel.add(numberButtons[6]);
        panel.add(subButton);
        panel.add(numberButtons[1]);
        panel.add(numberButtons[2]);
        panel.add(numberButtons[3]);
        panel.add(mulButton);
        panel.add(clearButton);
        panel.add(numberButtons[0]);
        panel.add(decimalButton);
        panel.add(divButton);
        panel.add(equalButton);
    }

    private class NumberButtonAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            String currentText = textField.getText();
            JButton source = (JButton) e.getSource();
            textField.setText(currentText + source.getText());
        }
    }

    private class OperationButtonAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            num1 = Double.parseDouble(textField.getText());
            operator = ((JButton) e.getSource()).getText().charAt(0);
            textField.setText("");
        }
    }

    private class DecimalButtonAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            if (!textField.getText().contains(".")) {
                textField.setText(textField.getText() + ".");
            }
        }
    }

    private class EqualButtonAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            num2 = Double.parseDouble(textField.getText());

            switch (operator) {
                case '+':
                    result = num1 + num2;
                    break;
                case '-':
                    result = num1 - num2;
                    break;
                case '*':
                    result = num1 * num2;
                    break;
                case '/':
                    if (num2 == 0) {
                        JOptionPane.showMessageDialog(frame, "Cannot divide by zero!");
                        return;
                    }
                    result = num1 / num2;
                    break;
            }

            textField.setText(String.valueOf(result));
        }
    }
}
```

이 프로그램은 숫자 0-9, 소수점 및 네 가지 산술 연산을 위한 버튼이 있는 간단한 계산기를 만듭니다. 또한 계산을 수행하는 "같음" 버튼과 입력 필드를 지우는 "지우기" 버튼이 있습니다. 계산기는 버튼 클릭을 처리하기 위해 GUI 및 액션 리스너 인터페이스에 스윙 컴포넌트를 사용합니다.