
-----------------------------------
Lucman909
Mon Jul 05, 2010 5:18 pm

Java Code Help!
-----------------------------------
Hey, kso ive read a lot and for a long time in Java, and i thought i would try to make a simple window. Here is my code.
import java.awt.*;
import javax.swing.*;
import JFrame; 

public class Window{
	private static void creatWindow(){
	// The Top Of The Window
	JFrame frame = new JFrame("simpleWindow");
	frame.setDefaultCloseoperation(Frame.EXIT_ON_CLOSE);
	
	//The Dimentions And What The Box Will Do
	JLable textLable = new Jlable("Put Anything You Wish Here", SwingConstants.CENTER);
	textLable.setPreferredsize(new Dimension(200,100));
	frame.getContentPane().add(textLabel, BorderLayout.CENTER); 
	
	// Displays The Window
	frame.pack();
	frame.setvisible(true);
	
	}
	public static void main(String[] args) {
		creatWindow();
	}

	
}


It looks okay to me, but when i try to compile it doesn't ! If you know any Java and think you can help. PLEASE DO SO!
Thanks :)

-----------------------------------
TheGuardian001
Mon Jul 05, 2010 5:42 pm

Re: Java Code Help!
-----------------------------------
Well, let's see...

Label(el, not le) is spelt incorrectly, and once again, Java is case sensitive. Your second Jlabel should have a capital L. (You also spelt "textLabel" many different ways, check your spelling on each one).

[code]
textLabel.setPreferredsize(new Dimension(200,100));

...

frame.setvisible(true);
[/code]
cASe SeNsiTIvE (setPreferredSize, setVisible)

-----------------------------------
Lucman909
Mon Jul 05, 2010 6:11 pm

RE:Java Code Help!
-----------------------------------
Thanks So Much! 
that really helped! :)
