Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-05-2008, 05:33 PM
Member
 
Join Date: May 2008
Posts: 22
amith is on a distinguished road
adding thread
i sincerely apologize for asking this question again and again but i control it i am stuck by this program for past 3 days this time i am sending the .gif file so that u can easily understand what my idea is
here is the code
Code:
import java.util.*; import java.awt.*; import javax.swing.*; class load extends JFrame { Image r; Image b; int y=329; int floor=329; int x=3; load() { super("some name"); r=new ImageIcon("red.png").getImage(); b=new ImageIcon("blue.png").getImage(); getContentPane().add(new display()); setVisible(true); setSize(175,400); setResizable(false); } class display extends JPanel //implements Runnable { //Thread t=new Thread(this); display() { repaint(); } public void paintComponent(Graphics q) { Graphics2D n=(Graphics2D)q; q.drawImage(r,x,y,this); } /* i just want to place the red image fixed at the bottom and start new blue image thread i,e try { y=0; while(y!=floor) { y++; q.drawImage(b,x,y,this); Thread.sleep(10); } } catch(Exception e) { } */ } } class f { public static void main(String args[]) { new load(); } }
Attached Images
File Type: jpg a.jpg (39.1 KB, 2 views)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding thread amith Java 2D 0 07-05-2008 05:31 PM
data from the main/GUI thread to another runnin thread... cornercuttin Threads and Synchronization 2 04-23-2008 11:30 PM
If JNI thread call the java object in another thread, it will crash. skaterxu Advanced Java 0 01-28-2008 08:02 AM
Creating a Thread (extending Java Thread Class) JavaForums Java Blogs 0 12-19-2007 10:31 AM
Adding a Restock Fee Nexcompac New To Java 2 07-31-2007 03:46 PM


All times are GMT +3. The time now is 02:20 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org