java - How can I keep a JFrame to specific width and height? -
i made 840 400 frame , added text field. default, java app shrinked size of text field. want fixed respective size.
i tried setresizable(false)
, setextendedstate()
, setbounds()
no avail.
try
setpreferredsize(new dimension(840,400));
if named frame can do
name.setpreferredsize(new dimension(840,400));