Java tutorial
import java.awt.Color; import java.awt.Container; import java.awt.Dimension; import javax.swing.JFrame; public class Main { public static void main(String[] args) { JFrame f = new JFrame("Fixed size content"); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); Container c = f.getContentPane(); c.setBackground(Color.YELLOW); Dimension d = new Dimension(400, 40); c.setPreferredSize(d); f.pack(); f.setResizable(false); f.setVisible(true); } }