DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    1

    Problem with Images...

    Hi i am new to java... i want to make a display an image of a ball in png format.. the program will be animated i.e the ball will move.. the display will be in a window.. the program is a console app not an applet.. The ball is a separate class... the window will be created by a separate class(main class)... Can you please help me.. i am gettin the initial window but cannot display the ball..the initial winow is from a class using JFrame... thanks in advance

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    A very short design suggestion:
    Make a JPanel extension, override the paintComponent method and draw the ball there. Stuff this panel into the JFrame, implement a thread in the JPanel extension. In its run method you code a loop/sleep that increments the ball coordinates as appropriate and repaints the panel on each loop.
    eschew obfuscation

Similar Threads

  1. Replies: 2
    Last Post: 03-17-2002, 08:36 PM
  2. unable to load images from a webpage
    By palash kasodhan in forum Java
    Replies: 1
    Last Post: 11-13-2001, 10:49 AM
  3. Replies: 0
    Last Post: 10-29-2001, 01:55 PM
  4. problem with recordset from Sybase and Oracle
    By substring in forum VB Classic
    Replies: 2
    Last Post: 07-24-2001, 02:29 PM
  5. problem with data islands and images
    By Michael Shutt in forum XML
    Replies: 0
    Last Post: 06-26-2001, 11:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links