943,877 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1310
  • Java RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Aug 1st, 2008
0

Re: Something about Graphics

Yes, it's just providing an anonymous inner class implementation of JPanel on initialization. You have probably seen it before with action listeners, Comparators, Runnables that are being handed off to a thread, etc.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Aug 1st, 2008
0

Re: Something about Graphics

yes, but i haven't seen it used to override paintcomponent(), would it work with paint()? (i assume so)
Reputation Points: 73
Solved Threads: 22
Posting Pro in Training
sciwizeh is offline Offline
423 posts
since Jun 2008
Aug 2nd, 2008
0

Re: Something about Graphics

Sure, it's not limited to specific methods, though if you are wanting to override quite a few or manage complex state, it is usually better to just go ahead and declare a normal inner class (or top-level if it would be useful outside the context of the containing class).

Often anonymous inner classes are used for "function objects" that specify a single method implementation, like actionPerformed() for a button listener. Such usage can be considered similar to function pointers in C++.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Aug 4th, 2008
0

Re: Something about Graphics

wow! thanks dude! im gonna go rewrite my code now =)
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008
Aug 4th, 2008
0

Re: Something about Graphics

im gonna ask something off topic here, how can i add an option to play again? thanks!
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008
Aug 4th, 2008
1

Re: Something about Graphics

well you could write a method that clears everything and chooses a new word
Reputation Points: 73
Solved Threads: 22
Posting Pro in Training
sciwizeh is offline Offline
423 posts
since Jun 2008
Aug 5th, 2008
0

Re: Something about Graphics

thank you for helping me sciwizeh!
Reputation Points: 10
Solved Threads: 0
Light Poster
esy928 is offline Offline
42 posts
since Feb 2008
Aug 5th, 2008
-1

Re: Something about Graphics

The graphics are very entertainment to all and with hollywood tstudio movies presents 3d graphics.
<snip false signature>
Last edited by Ancient Dragon; Aug 5th, 2008 at 1:16 pm. Reason: snip false signature
Reputation Points: 8
Solved Threads: 0
Newbie Poster
kimslov is offline Offline
1 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: EXCEL CSV FILES Handling
Next Thread in Java Forum Timeline: problem with rmi





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC