JFrame problems "setLayout (new FlowLayout);"

Hello,

I am going through a tutorial on JFrame’s and I ran into a problem…
The tutorial was made in 2009 so… I’m thinking maybe something has changed sense then?
This code doesn’t give an error for the guy giving the tutorial, unless I am missing something.

the error is in “new FlowLayout”
It can’t make a new FlowLayout object… But I imported it… :stuck_out_tongue: huh

package boston.tutorial;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.FlowLayout;

public class tuna51 extends JFrame{
	
	private JLabel item1;
	
	public tuna51() {
		super ("The title bar");
		setLayout (new FlowLayout);
		
		item1 = new JLabel("This is a sentance.");
		item1.setToolTipText("This is going to show up on hover.");
		add(item1);
	}
	
}

thanks :slight_smile:

try with:

setLayout(new FlowLayout());

wow… I am a total noob :stuck_out_tongue: haha

thank you a ton!!