0% found this document useful (0 votes)
23 views1 page

SwingDemo Java

Uploaded by

sajood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

SwingDemo Java

Uploaded by

sajood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

/ A simple Swing application.

import [Link].*;
class SwingDemo
{
SwingDemo()
{
// Create a new JFrame container.
JFrame jfrm = new JFrame("A Simple Swing Application");
// Give the frame an initial size.
[Link](275, 100);
// Terminate the program when the user closes the application.
[Link](JFrame.EXIT_ON_CLOSE);
// Create a text-based label.
JLabel jlab = new JLabel(" Swing means powerful GUIs.");
// Add the label to the content pane.
[Link](jlab);
// Display the frame.
[Link](true);
}

public static void main(String args[])


{
// Create the frame on the event dispatching thread.
[Link](new Runnable()
{
public void run() {
new SwingDemo();
}
});
}
}

You might also like