Results 1 to 4 of 4
Thread: error: Cannot find symbol
- 09-30-2011, 10:54 AM #1
Member
- Join Date
- Sep 2011
- Posts
- 6
- Rep Power
- 0
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);
}
- 09-30-2011, 11:01 AM #2
Member
- Join Date
- Sep 2011
- Posts
- 6
- Rep Power
- 0
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);
}
- 09-30-2011, 11:23 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: error: Cannot find symbol
You don't have a constructor that takes a String parameter.
- 09-30-2011, 04:02 PM #4
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
Similar Threads
-
Cannot Find Symbol error
By mrgreenacid in forum New To JavaReplies: 13Last Post: 05-16-2011, 07:28 AM -
Cannot find symbol Error
By new_Java in forum New To JavaReplies: 3Last Post: 02-17-2011, 11:23 PM -
error cannot find symbol
By jcoon3 in forum New To JavaReplies: 3Last Post: 09-27-2009, 10:56 PM -
cannot find symbol symbol :constructor Error. Please help! =(
By KalEl in forum New To JavaReplies: 9Last Post: 10-18-2008, 08:26 PM -
Error: cannot find symbol
By silvia in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks