Java Projects - Home
Home
Contact
Guestbook
Counter
Java Projects
This site solely for all students who wish to do some all new java projects.The technology discussed here are CORE JAVA, J2EE, J2ME (CDC & CLDC).Await For new topics.
import java.awt.Graphics; import javax.swing.JFrame; /* * Created on Jul 6, 2007 */ /** * @author Anand * @version 1.0 * Swing version of HelloWorld Example */ public class SwingHelloWorld extends JFrame { public SwingHelloWorld(){ // set the title by calling super or use setTitle(
) super("-----Helloworld-----"); // set the size of the frame setSize(int width,int height) setSize(200,200); // set resizable to false (frame/window cannot resize if it is set to false otherwise it can) setResizable(false); // sets the default close property of frame. i.e, when you click on the top-right corner button // the window/frame will exit and also terminates the java application. setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } /** * @version 1.0 * @param Graphics graphics * To Draw a string on the screen/frame */ public void paint(Graphics graphics){ graphics.drawString("Welcome to Helloworld Example !",10,100); } public static void main(String[] args) { // create an object of the same class. SwingHelloWorld UIObject = new SwingHelloWorld(); // set the visibility of the frame object to show it. UIObject.setVisible(true); } }
Today, there have been 1 visitors (2 hits) on this page!
This website was created for free with
Own-Free-Website.com
. Would you also like to have your own website?
Sign up for free