I am getting these errors when I try to convert my applet to a standalone application. This is the only line that gets errors, and I don't know why. The books I looked at said that you had to explicitly declare the FlowLayout in the frame, because the default is the border layout. I declared it just like in the sample program in the book, so I don't understand why I am getting all these errors. C:\java>javac NumerologyFrame.java NumerologyFrame.java:11: invalid method declaration; return type required setLayout(new FlowLayout()); ^ NumerologyFrame.java:11: illegal start of type setLayout(new FlowLayout()); ^ NumerologyFrame.java:11: <identifier> expected setLayout(new FlowLayout()); ^ 3 errors
Are you calling the method in the constructor of your class which is extending Frame? Sounds like you are putting this outside of the curley braces somewhere. The compiler thinks you are trying to declare a method.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt