Answer: Contrary to what I said last time which was something like "I am sure that you can vary the thickness of lines because you can set parameters for most anything in Java," further investigation shows that the AWT's API for graphics is rather limited and, for example, it supports only one line width of one pixel wide. You can simulate thick lines by drawing multiple lines at one-pixel offsets or by drawing filled rectangles. It is also likely that others have worked on this problem so you might look for sources on the Web. A good place to start is Gamelan http://www.gamelan.com/.
ChangeableTL tl = (ChangeableTL)e.target;
which is part of the code for the
method int lightClicked( Event e )
in the
class ChangeableTL (line 68).
I was asking why the cast was necessary and
why polymorphism did not make the cast unnecessary. During this
discussion Steve asked something like the following:
Can getParent() be used here?
Answer: getParent() is the method
public Container getParent()
from the class java.awt.Component. It returns the parent container that contains the component. In our case it is the component itself that we want, not its parent.
There is also a method getParent() in the class java.io.File, but it is not relevant in this context.