Results 1 to 1 of 1
Thread: JFrame (Hello World)
-
JFrame (Hello World)
Following is a sample Hello World JFrame code. Good for beginners.
Java Code:import javax.swing.JFrame; import javax.swing.JLabel; public final class HelloWorld extends JFrame { private HelloWorld() { setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); getContentPane().add(new JLabel("Hello, World!")); pack(); setLocationRelativeTo(null); } public static void main(String[] args) { new HelloWorld().setVisible(true); } }
Similar Threads
-
Hello World!
By joshua in forum IntroductionsReplies: 3Last Post: 02-03-2008, 01:41 PM -
Hello World!
By Hiro ZA in forum IntroductionsReplies: 2Last Post: 01-07-2008, 03:27 PM -
Hello World
By dave700800 in forum IntroductionsReplies: 1Last Post: 12-20-2007, 06:54 AM -
Help with JFrame
By Albert in forum AWT / SwingReplies: 2Last Post: 07-04-2007, 04:44 AM -
Hello World
By hiranya in forum IntroductionsReplies: 1Last Post: 06-27-2007, 05:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks