error: Cannot find symbol
Hai , i got an error in my coding which is cannot find symbol. Please correct my coding .Here is my code and i also highlight the line which cause an error.
This is error which i get as your reference
cannot find symbol
symbol : constructor ButangWarna(java.lang.String)
location: class ButangWarna
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ButangWarna extends Frame implements ActionListener {
JButton Bmerah, Bhijau;
public static void main(String arg[])
{
ButangWarna f = new ButangWarna("Background Colour");/* this line cause me an error*/
f.addWindowListener(new WindowEventHandler());
f.setSize(400,200);
f.setVisible(true);
}
error: cannot find sysmbol
Hai, i got an error cannot find symbol in coding.Please correct my coding . Here i attach my coding and i also highlight the line cause an error.
This is error i got
cannot find symbol
symbol : method Super(java.lang.String)
location: class ButangWarna
Super(str);
^
public void BiodataPelajar(String str)
{
Super(str);
setLayout(new FlowLayout());
Bmerah = new JButton("RED");
Bhijau = new JButton("Green");
add(Bmerah);
add(Bhijau);
Bmerah.addActionListener(this);
Bhijau.addActionListener(this);
}
Re: error: Cannot find symbol
You don't have a constructor that takes a String parameter.
Re: error: Cannot find symbol
iswan, please don't start a new thread for the same or a closely related problem. I've merged your two threads here.
With regard to your second question:
1) A constructor does not have a return type. public void BiodataPelajar(String str) is a method, not a constructor.
2) Java is case sensitive, and all Java keywords are lower case.
db