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… 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