Skip to content

Instantly share code, notes, and snippets.

@gwenn
Created January 22, 2025 14:05
Show Gist options
  • Save gwenn/c76bea325a566915093462a142a81621 to your computer and use it in GitHub Desktop.
Save gwenn/c76bea325a566915093462a142a81621 to your computer and use it in GitHub Desktop.
Minimal Swing Frame
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class MinSampleFrame {
public static void main(String[] args) {
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.getContentPane().add(...);
SwingUtilities.invokeLater(() -> {
frame.pack();
frame.setVisible(true);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment