http://java.net/jira/browse/MACOSX_PORT-166 submitted 2011/07/18 by ddurrence
Simple Frame or JFrame fails to draw unless one or more components are added and pack is called.
Compile and run one of the following simple test cases:
import javax.swing.JButton;
import javax.swing.JFrame;
public class SimpleJFrame
{
public static void main(String[] args)
{ JFrame frame = new JFrame("Boom!"); /* For the JFrame to show, it must have real content and pack must be called. Uncomment the following two lines to have the frame draw on screen. */ // frame.add(new JButton("Bogus Button"));// frame.pack(); frame.setVisible(true); }}
— OR —
import java.awt.Frame;
import java.awt.Button;
public class SimpleFrame
{
public static void main(String[] args)
{ Frame frame = new Frame("Boom!"); /* For the Frame to show, it must have real content and pack must be called. Uncomment the following two lines to have the frame draw on screen. */ // frame.add(new Button("Bogus Button"));// frame.pack(); frame.setVisible(true); }}