Posts

Showing posts with the label jframe

JFrame size is too small

Image
Clash Royale CLAN TAG #URR8PPP JFrame size is too small i have created a JFrame in netbeans. But when i run the program, the Jframe size is too small. here is my code. import javax.swing.JFrame; public class Window { private static void demo() { JFrame frame =new JFrame(); frame.setVisible(true); } public static void main(String args) { javax.swing.SwingUtilities.invokeLater(new Runnable(){ public void run() { demo(); } }); } } Swing JComponents by default accepting only PreferredSize, – mKorbel Oct 27 '12 at 12:35 "frame size is too small" Put components in it, then call pack() . The frame will become the smallest size it needs to be, in order to display the compo...