I think I shall have to transfer this
thread to Swing, since it is a GUI-related topic.
You can't display a panel on its own; it has to be added to a container, of which the most popular type is the JFrame.
You are also supposed to start a new thread; the details are in the API for any Swing class, where the link to "Swing threading policy" is.
You need to do three things to make a frame appear properly
Give it a sizeDecide what to do when it closes; I think the default is "hide." You can set a default for closing; EXIT closes the entire JVM. Or you can use a Listener, but that is too advanced for you.Set it visible. Do this last.That ought to work. Needless to say there are several different versions of setting up a Frame like that. You will have to check in the API for
JFrame; I am pretty certain I have spelt setDefaultClosingOperation wrongly.
And good luck with it.