Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
10-18-2013, 01:13 AM #1
- Join Date
- Oct 2013
- Thanked 0 Times in 0 Posts
some of JFrame's methods aren't working, might have imported wrong?
This site, http://docs.oracle.com/javase/tutori...nts/frame.html, has this sample code
//1. Create the frame. JFrame frame = new JFrame("FrameDemo"); //2. Optional: What happens when the frame closes? frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //3. Create components and put them in the frame. //...create emptyLabel... frame.getContentPane().add(emptyLabel, BorderLayout.CENTER); //4. Size the frame. frame.pack(); //5. Show it. frame.setVisible(true);
10-18-2013, 02:28 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
You have no main method, add your main and put all that in it.
The import is incorrect, you aren't using a awt package here, but there is no call to Frame anyway, and JFrame will be included with the swing.*.
Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');