Innanzitutto grazie per la risposta. Il codice è questo:

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package librettoscolastico;

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

/**
*
* @author lucchini_18480
*/
public class Login_Class extends JFrame {

Login_Class() {
super("Home Page");
initC();
}

public void initC() {
Container c = getContentPane();
setSize(300, 100);
setLocationRelativeTo(null);
setResizable(false);
setVisible(true);
username.setColumns(SET_COLUMNS);
password.setColumns(SET_COLUMNS);
user = new JLabel("Usename: ");
pass = new JLabel("Password: ");
lbl.add(user);
field.add(username);
lbl.add(pass);
field.add(password);
btt.add(login);
btt.add(reg);
btt.add(exit);
c.add(lbl, BorderLayout.WEST);
c.add(field, BorderLayout.EAST);
c.add(btt, BorderLayout.SOUTH);
login.addActionListener(new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
Libretto();
}
});
reg.addActionListener(new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
Return();
}
});
exit.addActionListener(new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
Exit();
}
});
setDefaultCloseOperation(EXIT_ON_CLOSE);
}

private void Libretto() {
new LibrettoScolastico().setVisible(true);
this.dispose();
}

private void Return() {
new Registration_Class().setVisible(true);
this.dispose();
}

private void Exit() {
confirm = JOptionPane.showConfirmDialog(null, "Sei sicuro di voler uscire?", "ESCI", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if (confirm == 0) {
System.exit(0);
}
}

public static void main(String[] args) {
// TODO code application logic here
new Login_Class().getBounds();
}
int x, y;
JLabel user, pass;
JTextField username = new JTextField("", 10);
JPasswordField password = new JPasswordField("", 10);
JButton login = new JButton("Accedi");
JButton reg = new JButton("Registrati");
JButton exit = new JButton("Esci");
JPanel lbl = new JPanel(new GridLayout(0, 1));
JPanel field = new JPanel(new GridLayout(0, 1));
JPanel btt = new JPanel(new GridLayout(1, 0));
int confirm, SET_COLUMNS = 15;
}