Indentifier errors

I am use Sun Java Studio 8. Every I try to use a Container or Panel I get an error saying I need an <identifier>. I can not find anything in the documentation about needing a <indetifier> in a panel . This is an example of what gets the error

panel = new Panel(new FlowLayout(FlowLayout RIGHT));

I'm new to Java moving from C++ and would be grateful for any comments

[399 byte] By [Encino_Man] at [2007-11-26 10:54:33]
# 1
"FlowLayout RIGHT" should be "FlowLayout.RIGHT". RIGHT is a constant defined in the class " http://java.sun.com/j2se/1.5.0/docs/api/java/awt/FlowLayout.html#RIGHT".
KarthikR at 2007-7-7 3:07:28 > top of Java-index,Development Tools,Java Tools...
# 2
Thank you, I corrected that. I t now reads: panel = new Panel(new FlowLayout(FlowLayout.RIGHT)); but the error is the same
Encino_Man at 2007-7-7 3:07:28 > top of Java-index,Development Tools,Java Tools...
# 3

is the variable panel defined before it is used?

JPanel panel;

panel = new JPanel(new FlowLayout(FlowLayout.RIGHT))

...

Have you tried NetBeans and its GUI builder? The gui builder lets you visually create your forms and generates the required code.

http://www.netbeans.info/downloads/download.php?type=5.0

http://www.netbeans.org/kb/50/quickstart-gui.html

KarthikR at 2007-7-7 3:07:28 > top of Java-index,Development Tools,Java Tools...