DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jul 2006

    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
    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

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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.