I am new to Java and want to start with making simple user input fields without MySQL.
Until now I got two problems that I can't solve.
First of all, how to get inputs from JCheckBox and JRadioButton?
And I get these user inputs in console, but how to get it to show just below the registration form in panel?
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Login implements ActionListener {
private static JTextField nameText;
private static JTextField emailText;
private static JPasswordField passwordText;
private static JPasswordField confirmPasswordText;
public void loginForm() {
JPanel panel = new JPanel();
JFrame frame = new JFrame();
frame.setSize(600, 400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(panel);
frame.setTitle("Registration Form");
panel.setLayout(null);
JLabel headingLabel = new JLabel("REGISTRATION FORM");
headingLabel.setBounds(285, 25, 160, 25);
panel.add(headingLabel);
JLabel nameLabel = new JLabel("Name");
nameLabel.setBounds(150, 70, 80, 25);
panel.add(nameLabel);
nameText = new JTextField(20);
nameText.setBounds(270, 70, 165, 25);
panel.add(nameText);
JRadioButton maleButton = new JRadioButton("Male");
maleButton.setBounds(270, 100, 60, 25);
panel.add(maleButton);
JRadioButton femaleButton = new JRadioButton("Female");
femaleButton.setBounds(370, 100, 100, 25);
panel.add(femaleButton);
JLabel emailLabel = new JLabel("E-mail");
emailLabel.setBounds(150, 130, 80, 25);
panel.add(emailLabel);
emailText = new JTextField(20);
emailText.setBounds(270, 130, 165, 25);
panel.add(emailText);
JLabel passwordLabel = new JLabel("Password");
passwordLabel.setBounds(150, 160, 80, 25);
panel.add(passwordLabel);
passwordText = new JPasswordField();
passwordText.setBounds(270, 160, 165, 25);
panel.add(passwordText);
JLabel confirmPasswordLabel = new JLabel("Confirm password");
confirmPasswordLabel.setBounds(150, 190, 120, 25);
panel.add(confirmPasswordLabel);
confirmPasswordText = new JPasswordField();
confirmPasswordText.setBounds(270, 190, 165, 25);
panel.add(confirmPasswordText);
JCheckBox c1 = new JCheckBox("I agree to websites rules!");
c1.setBounds(260, 220, 200, 25);
panel.add(c1);
JButton button = new JButton("Submit");
button.setBounds(300, 260, 100, 25);
button.addActionListener(new Login());
panel.add(button);
JLabel success = new JLabel();
success.setBounds(260, 290, 300, 25);
panel.add(success);
frame.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
String name = nameText.getText();
// String male = maleButton.getText();
// String female = femaleButton.getText();
String email = emailText.getText();
String password = passwordText.getText();
String confirmPassword = confirmPasswordText.getText();
// String c1 = String.valueOf(JCheckBox.getDefaultLocale());
System.out.println(name + ", " + email + ", " + password + ", " + confirmPassword);
}
}

Below code is a rewrite of your GUI application.
JRadioButtons in aButtonGroupto ensure that only one can be selected. Refer to How to Use Buttons, Check Boxes, and Radio ButtonsgetTextis deprecated forJPasswordField. Refer to How to Use Password Fields.JTextAreain aJScrollPanebut there are other options. Refer to Using Text Components and How to Use Scroll Panes.ActionListenerinterface can be implemented via a method reference.