"and even though the error disapears i get an error..
java.lang.ClassCastException
:flowLayout.FlowLayout
cannot be cast tojava.awt.LayoutManager
"
There is no standard Java class flowLayout.FlowLayout
. That's your class (or possibly some third party class that doesn't extends LayoutManager, which I highly doubt).
You need to import
import java.awt.FlowLayout;
And get rid of your
import flowLayout.FlowLayout; // if you have that.
- Lesson to be learned: Don't name your classes the same as existing Java classes.