I am really new to Java and just started learning. I took code from the internet but whenever I try to compile it and error shows up saying:
JavaTutorial.java:11: error: cannot find symbol
new BasicSwing();
^
symbol: class BasicSwing
location: class JavaTutorial
1 error
This is the code:
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JButton;
public class JavaTutorial extends JFrame{
JPanel p = new JPanel();
JButton b = new JButton("Hello");
public static void main(String[] args){
new BasicSwing();
}
public void BasicSwing(){
setTitle("Basic Swing app");
setSize(400,300);
setResizable(true);
p.add(b);
add(p);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
}
Can anyone tell me what am I doing wrong?