Results 1 to 3 of 3
  1. #1
    bluej is offline Member
    Join Date
    Jan 2012
    Posts
    4
    Rep Power
    0

    Default Class is not compiling!

    Hello, I am having to write a program and to describe it simply I basically have to choose between a list of shapes to display (initial shape is a point, shapes are described in subclasses), then choose from a JComboBox its color and control its size using a slider.

    I attached the code.

    The class is not compiling though and I know the reasons why because java is telling me (there may be more):
    -The class is not abstract and does not override abstract method stateChanged in ChangeListener (I need the interface ChangeListener for my slider!)
    -Method setColor(java.awt.Color) has not been declared (not sure how/what I should declare)

    But I don't know how to fix them...I would really appreciate if you can help me out with that!

    These are probably rather silly questions, I am a beginner to java and I have to write a program that is beyond my level now

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,337
    Blog Entries
    7
    Rep Power
    20

    Default Re: Class is not compiling!

    Quote Originally Posted by bluej View Post
    -The class is not abstract and does not override abstract method stateChanged in ChangeListener (I need the interface ChangeListener for my slider!)
    -Method setColor(java.awt.Color) has not been declared (not sure how/what I should declare)
    - implement the stateChanged( ... ) method in your class because it promised to be a ChangeListener (declared by the interface).
    - define a method setColor( ... )

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    bluej is offline Member
    Join Date
    Jan 2012
    Posts
    4
    Rep Power
    0

    Default Re: Class is not compiling!

    Hello, Sorry for not replying earlier.
    Thanks for that!
    I was going to ask you to elaborate but I figured it out, I kind of knew what i needed it to do but it is the codes I was finding confusing!

Similar Threads

  1. Replies: 2
    Last Post: 10-24-2011, 01:39 PM
  2. compiling .java into .class
    By khp in forum Advanced Java
    Replies: 4
    Last Post: 06-29-2009, 02:52 PM
  3. not compiling a copy of class -
    By itaipee in forum Eclipse
    Replies: 0
    Last Post: 01-07-2009, 09:47 AM
  4. Compiling a single class
    By ROSOBORONEXPORTCORP in forum New To Java
    Replies: 2
    Last Post: 01-28-2008, 12:27 PM
  5. Compiling a class in a package from cmd
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 10:27 AM

Tags for this Thread

Posting Permissions

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