The following code returns me an error saying: "constructor call must be the first statment in a constructor."
I dont get it. The constructor in my code is the first statement. What am I doing wrong?
public class labelsAndIcons extends JFrame
{
public labelFrame()
{
super( "Testing JLabel" );
}
}
The constructors name must be the same as the class name, so change either change the class name to
labelFrameor the constructor name tolabelsAndIcons.Example (note that usually the first letter is a capital letter in java):