Created
January 22, 2025 14:05
-
-
Save gwenn/c76bea325a566915093462a142a81621 to your computer and use it in GitHub Desktop.
Minimal Swing Frame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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