Re: question about directory structure and forms
JT wrote:
TrafficLight.java:576: cannot access LightPanel
bad class file: ./LightPanel.java
file does not contain class LightPanel
Please remove or make sure it appears in the correct subdirectory of the
classpath.
private static void setIteration6(final LightPanel southPanel, final
LightPanel westPanel, final TrafficLight tl, final LightPanel eastPanel,
final LightPanel northPanel) {
Here's old live 576 and it's surrounding code:
private static void setIteration6(final LightPanel southPanel,
final LightPanel westPanel, final TrafficLight tl, final LightPanel
eastPanel, final LightPanel northPanel) {
setIteration6Panels(southPanel, eastPanel, northPanel, westPanel);
setIteration6Colors(tl);
}
Simply put, you never define LightPanel anywhere. I think you need to
understand Java compilation units better. Package scope, public scope,
file scope, inner classes, private scope, protected scope. You're using
the default package here and I don't think you can for a complicated
program like this. Also, learn how to deploy an app and use the CLASSPATH.
Make new, simple program that does nothing but declare a simple class
called TrafficLightTest that uses another class called LightPanelTest.
Get that working. Don't make any AWT components, just use a println to
make sure each class is working. Deploy them manually, and make sure it
works. Use a package the whole time. Once that works then come back
and refactor this big ol' nasty hunk of code called TrafficLight.java
you've created.