Java JFrame .setSize(x, y) not working?
Create a custom component, extending from JPanel, override its getPreferredSize method to return the size of the window you would like. Either add this to your frame or set it as the frame’s content pane. Call pack on the frame Updated with example On my PC, the Frame size = java.awt.Dimension[width=216,height=238] import java.awt.BorderLayout; import java.awt.Dimension; … Read more