• Post Reply Bookmark Topic Watch Topic
  • New Topic

multi threads  RSS feed

 
johan cross
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,



i m writing a very simple snippet for multi threading experiment, my scheme is i use two threads, one for drawing red rectangles on the screen another for green rectangles, following is my snippet:



i use A and B to distinguish two different threads, but it is quite error prone, so my next scheme is one run() for one thread, i rewrite my snippet:



However i m fail, my program just show one component, frame.getContentPane().add() just can add one component, any idea, thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!