aspose file tools
The moose likes Beginning Java and the fly likes setLayout errors when converting to standalone Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "setLayout errors when converting to standalone" Watch "setLayout errors when converting to standalone" New topic
Author

setLayout errors when converting to standalone

Jade Davidson
Ranch Hand

Joined: Oct 12, 2001
Posts: 64
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
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9033
    
  10
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setLayout errors when converting to standalone
 
Similar Threads
FlowLayout manager wont work
Instance Variable errors for MouseMotionAdapt
applets
Building a simple interface
doubts from allover..... help me out