Results 1 to 2 of 2
  1. #1
    alacn's Avatar
    alacn is offline Senior Member
    Join Date
    Jun 2010
    Location
    UK. near London
    Posts
    118
    Rep Power
    0

    Default Overriding question

    Ok i understand overriding as basically a subclass using the same method name as its super class, just so everything looks more organised etc.

    But what about the built in method paintComponents(Graphics g) ?

    it seems that when i override this built in method, im still getting the funnctionality of this method plus whatever it is i want to do, ie paint something.

    I thought when you override a super's method, u basically just using the same name and ur own code, and no code from the super.

    could someone clarify this for me please
    Teaching myself java so that i can eventually join the industry! Started in June 2010

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default

    Can you post the code so that we can see how did you override the paintComponents(Graphics g) method.

Similar Threads

  1. overriding toString method
    By matin1234 in forum New To Java
    Replies: 3
    Last Post: 06-01-2010, 04:35 AM
  2. Overriding
    By renuka_renukut in forum Advanced Java
    Replies: 3
    Last Post: 05-21-2010, 08:45 AM
  3. Overriding Methods
    By AndrewM16921 in forum New To Java
    Replies: 2
    Last Post: 09-23-2009, 06:26 AM
  4. [SOLVED] Method Overriding
    By MithunDhar in forum New To Java
    Replies: 3
    Last Post: 04-06-2009, 08:02 AM
  5. is overriding static method possible
    By raghu in forum Advanced Java
    Replies: 1
    Last Post: 01-22-2008, 12:38 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
  •