Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2003

Tip: Looking for answers? Try searching our database.

Drawing from a class to a particular JFrame

Thread view: 
Javier Usandivaras - 02 Dec 2003 04:30 GMT
Hello everyone!

first of all I'd like to say that this is my very first post ever on a
forum and I might be asking the question on the wrong one :( if so
please forgive me. But otherwise I'd like to take this opportunity to
absorb a little bit of your knowledge :).
I am trying to program a little arcanoid game, and though I've only
written 7 lines of code I'm already stuck :(.
I have a class for the main program which consists of a JFrame where
the background is drawn. I also have a ball class, in general I though
of it as having a moveBall method that accepts two ints (a x and a y)
and draws the fillOval into the main window.
Unfortunetly I couldn't come up with an idea of how to make this
particular ball class to draw on the main class (different class).
Any ideas on how I could approach this would be greatly accepted
Harald Hein - 02 Dec 2003 05:35 GMT
> I have a class for the main program which consists of a JFrame
> where the background is drawn. I also have a ball class, in
> general I though of it as having a moveBall method that accepts
> two ints (a x and a y) and draws the fillOval into the main
> window.

This is an FAQ. You don't do that. You do not paint from the outsite to  
a window. Read the FAQ (if you can find it). Also read the GUI tutorial
on Sun's web site.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.