Problem with Images...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problem with Images...

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

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center