Can somebody help me with this Java AWT error?
//I am new to java and following a tutorial video. //I am creating a GridBagLayout but gives me a error // It Says "GridBagLayout cannot be converted to LayoutManager" //Code: package pkg12.gridbaglayout; import java.awt.*; //mport java.awt.event.*; class MyFrame extends Frame { Button b1,b2; public MyFrame() { super("GridBag Layout Demo"); GridBagLayout gb = new GridBagLayout(); GridBagConstraints gbc = new GridBagConstraints(); //says error at here, GridBagLayout cannot be converted to LayoutManager, //I use Netbeans and parameter "gb" got highlighted by red setLayout(gb); //shows error at this line b1 = new Button("One"); b2 = new Button("Two"); gbc.gridx = 1; gbc.gridy = 1; add(b1,gbc); gbc.gridx = 2; gbc.gridy = 2; add(b2,gbc); } } public class GridBagLayout { public static void main(String[] args) { MyFrame f = new MyFrame(); f.setSize(500, 500); f.setVisible(true); } } //Please help, I will appreciate