Hi,
This is my first Java program. When I try to compile it, I got errors. It should be very simple.
This is how I compile it:
javac testGUI.java
I got this error:
testgui.java 9: cannot find symbol
symbol: class GUI
public clas testGUI extends GUI {
^
... (and some other similar ones)
Here are my files:
This is my first Java program. When I try to compile it, I got errors. It should be very simple.
This is how I compile it:
javac testGUI.java
I got this error:
testgui.java 9: cannot find symbol
symbol: class GUI
public clas testGUI extends GUI {
^
... (and some other similar ones)
Here are my files:
Code:
// File: testGUI.java
package gui;
import java.awt.*;
public class testGUI extends GUI {
public void init() {
NoInput = true;
super.init();
}
public void paintToDoubleBuffer(Graphics g) {
System.out.println("entered testGUI::paintToDoubleBuffer\n");
paintGridCell(g, 20, 20, 110, 0.5f, 0.0f, 1.0f);
}
public void doRunButton() {
P("OVERRIDDEN doRunButton()\n");
}
}
Code:
// File: GUI.java
package gui;
import java.awt.*;
import java.applet.Applet;
public class GUI extends Applet {
// Flags to disable standard GUI components:
public boolean NoInput = false;
public boolean NoOutput = false;
public boolean NoGraphics = false;
public boolean NoRunButton = false;
public boolean NoResetButton = false;
public int BigText = 0;
public String RunLabel = new String("Run");
public String ResetLabel = new String("Reset");
public String InitialInput = "";
Graphics background; // used for double buffering
Image im;
int width = 640;
int height = 480;
protected Panel panel;
TextField inputText;
TextArea outputText;
GUICanvas canvas;
Color colors[];
int NumColors = 16;
public String getAppletInfo() {
return "GUI classes by Mark Watson";
}
// some other functions skipped here, e.g., paint()
}
class GUICanvas extends Canvas {
Graphics background; // used for double buffering
Image im;
public GUI parent;
public void init() {
//System.out.println("entering GUICanvas::init\n");
try {
Dimension d = size();
im = createImage(d.width, d.height);
background = im.getGraphics();
} catch (Exception ex) {
background = null;
}
}
// skip some functions here too
}