[Bluej-discuss] Thread Question

Mark Dutchuk (MALA) dutchukm at MALA.BC.CA
Mon Nov 13 16:53:01 GMT 2006


Thanks Davin.  That worked, with one minor fix.  I had to do this ..

public EventOne(ThreadGroup group)
{
    super(group, (Runnable) null);
}

.. to avoid an "ambiguous" reference to the Thread constructor.

Your help was very much appreciated.  Thanks again!

dmd.


Message: 3
Date: Mon, 13 Nov 2006 14:13:22 +1100
From: Davin McCall <davmac at bluej.org>
Subject: Re: [Bluej-discuss] Thread Question
To: General discussion for users of BlueJ <bluej-discuss at bluej.org>
Message-ID: <4557E2D2.1060505 at bluej.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Mark,

To get the behaviour which (I think) you want, you should add a 
constructor to EventOne and EventTwo which takes a thread group as a 
parameter and which passes that parameter to the superclass constructor,

something like:

    public EventOne(ThreadGroup group)
    {
        super(group, null);
    }


... and then change the code which creates the thread to:

	EventOne e1 = new EventOne(threadGroup);
	e1.start();

- Davin


Mark Dutchuk (MALA) wrote:
> Hello folks.  I'm puzzled by a problem I am having with Threads and 
> ThreadGroups.  



More information about the bluej-discuss mailing list