ChannelDemo Program

ChannelDemo Program

// Create Channel

DisplayChannel chan = new DisplayChannel(b1);

// Create Thread

A_= new DisplayThread(g1,new Producer(chan),100);

B_= new DisplayThread(g2,new Consumer(chan),100);

A_.start();

B_.start();

DisplayChannel is a subclass of Channel which displays the channel on a Canvas.

Similarly DisplayThread is a subclass of Thread which provides the rotate() operation.

Previous slide Next slide Back to the first slide View Graphic Version