I have created an application for a subway program. I want it to popup to preview how the jlables, jbutton, textarea, jlist and all of the component on it, the codes that I have used it work but the problems are that none of the jbuttons, jlist, textareas, jlables, jcombobox is not showing. for some reason, the gui popping up blank with nothing showing, can somebody take a look at my codes and tell me why it is not showing anything and what i have to do to get it to show.
here is the codes.
import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.lang.reflect.InvocationTargetException; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextArea; import javax.swing.SwingUtilities; public class Subway_Menu extends javax.swing.JPanel { public static void main(String[] args) throws InterruptedException, InvocationTargetException { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { JButton newbutton = new JButton(); JFrame newframe = new JFrame(); newframe.setTitle("Subway"); newframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); newframe.setVisible(true); newframe.setSize(999, 999); newframe.setResizable(false); ImageIcon newimage = new ImageIcon("SubWay(1).jpg"); newframe.setIconImage(newimage.getImage());