There are 3 classes, PanelEntryWindow is called in FrameEntryWindow, in turn FrameEntryWindow is called in Entry Window, and EntryWindow in Main. The problem is the following - when you start the program, the panel with buttons, text fields and labels is not displayed.
Main
import View.EntryWindow; public class Main { public static void main(String[] args) { EntryWindow.startEntryWindow(); } } EntryWindow
package View; import javax.swing.*; public class EntryWindow extends JFrame { public static void startEntryWindow(){ FrameEntryWindow.FrameEntryWindow(); } } FrameEntryWindow
package View; import javax.swing.*; public class FrameEntryWindow extends JFrame { protected static JFrame jFrame = new FrameEntryWindow(); static JFrame FrameEntryWindow(){ jFrame = new JFrame("My Data Base"); jFrame.setSize(250, 350); jFrame.setLocationRelativeTo(null); jFrame.setResizable(false); jFrame.setVisible(true); jFrame.add(new PanelEntryWindow()); jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); return jFrame; } } PanelEntryWindow
package View; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class PanelEntryWindow extends JPanel { private JLabel labelLogin = new JLabel("Login"); public JTextField inputLogin = new JTextField(); private JLabel labelPassword = new JLabel("Password"); public JTextField inputPassword = new JTextField(); public static JButton logInButton = new JButton("Login"); public static JButton newUserButton = new JButton("Create new user"); public PanelEntryWindow(){ labelLogin.setBounds(50, 50, 100, 50); add(labelLogin); inputLogin.setBounds(50, 110, 150, 50); add(inputLogin); labelPassword.setBounds(50, 130, 100, 50); add(labelLogin); inputPassword.setBounds(50, 190, 150, 50); add(inputPassword); logInButton.setBounds(100, 230, 80, 50); add(logInButton); newUserButton.setBounds(50, 290, 200, 50); add(newUserButton); } } The structure is as follows:
