Results 1 to 4 of 4
  1. #1
    iswan is offline Member
    Join Date
    Sep 2011
    Posts
    6
    Rep Power
    0

    Default 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);
    }

  2. #2
    iswan is offline Member
    Join Date
    Sep 2011
    Posts
    6
    Rep Power
    0

    Default 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);
    }

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: error: Cannot find symbol

    You don't have a constructor that takes a String parameter.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default 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

  1. Cannot Find Symbol error
    By mrgreenacid in forum New To Java
    Replies: 13
    Last Post: 05-16-2011, 08:28 AM
  2. Cannot find symbol Error
    By new_Java in forum New To Java
    Replies: 3
    Last Post: 02-18-2011, 12:23 AM
  3. error cannot find symbol
    By jcoon3 in forum New To Java
    Replies: 3
    Last Post: 09-27-2009, 11:56 PM
  4. Replies: 9
    Last Post: 10-18-2008, 09:26 PM
  5. Error: cannot find symbol
    By silvia in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •