Tags Posts tagged with "jframe"


0 1716
I have created two window frame in JAVA using awt and swing package. My Java code is like: import java.awt.*; import javax.swing.*; public class TopLevelWindow { private static void createWindow() { JFrame frame = new JFrame("Simple GUI"); //frame.setDefaultCloseOperation(JFrame.EXIT_ON_ CLOSE); JLabel textLabel = new JLabel("Hi Ans ",SwingConstants.CENTER); textLabel.setPreferredSize(new Dimension(300, 100)); frame.getContentPane().add(textLabel, BorderLayout.CENTER); //Display the window. Read more [...]