[3001] in java-interest
can't compile on windows 95
daemon@ATHENA.MIT.EDU (java-user@aligarh.Eng.Sun.COM)
Thu Oct 26 02:11:17 1995
From: java-user@aligarh.Eng.Sun.COM
To: java-interest@java.Eng.Sun.COM
Date: Wed, 25 Oct 1995 17:03:07 -0800 (PDT)
Hi there,
I am trying to compile the following java code on windows95.
I keep getting the following error message.
C:\trial>javac -verbose mytest.java
[parsed mytest.java in 1126ms]
[checking class MyTest]
[loaded c:\java\hotjava\classes\java\lang\Object.class in 123ms]
[loaded c:\java\hotjava\classes\java\lang\String.class in 233ms]
[loaded c:\java\hotjava\classes\java\lang\System.class in 156ms]
[loaded c:\java\hotjava\classes\java\io\PrintStream.class in 82ms]
[loaded c:\java\hotjava\classes\java\io\FilterOutputStream.class in 55ms]
[loaded c:\java\hotjava\classes\java\io\OutputStream.class in 30ms]
[checking class MenuForm]
mytest.java:7: Class Frame not found in new.
MenuForm Menu = new MenuForm();
^
mytest.java:11: Super class Frame of class MenuForm not found.
class MenuForm extends Frame {
^
2 errors
I tried to set the CLASSPATH c:\java\hotjava\classes but of no help.
Please suggest what I am doing wrong.
Thanks,
S.
// File : MyTest.class
mport java.util.*;
import java.awt.*;
class MyTest {
public static void main (String args[]) {
System.out.println("Hello World!");
MenuForm Menu = new MenuForm();
}
}
class MenuForm extends Frame {
// Attributes
// Constants
int formWidth = 240;
int formHeight = 300;
// Variables
MenuBar mbar; // menubar, just for testing
// Methods
public MenuForm() {
// set the title of the form by calling the parent's constructor
super("Menu Form");
initializeMenus();
setMenuBar(mbar);
resize(formWidth,formHeight);
show();
} //MenuForm
public boolean action(Event evt, Object arg) {
// Handling the menu-items
if ("Quit".equals(arg)) {
this.dispose();
}
else if ("Open".equals(arg)) {
System.out.println("Opening something...");
}
else if ("Save".equals(arg)) {
System.out.println("Saving something...");
}
else if ("Save As...".equals(arg)) {
System.out.println("Saving something as ...");
}
else if ("About".equals(arg)) {
System.out.println("Ok, ok, that's not "+
"present yet...");
}
else
return false;
return true;
} // action
private void initializeMenus() {
mbar = new MenuBar();
Menu fileMn = new Menu("File");
fileMn.add(new MenuItem("New"));
fileMn.add(new MenuItem("Open..."));
fileMn.add(new MenuItem("Save"));
fileMn.add(new MenuItem("Save As..."));
fileMn.addSeparator();
fileMn.add(new MenuItem("Quit"));
mbar.add(fileMn);
Menu helpMn = new Menu("Help");
helpMn.add(new MenuItem("About"));
mbar.add(helpMn);
// Sets the help menu on the right side in the menu-bar
mbar.setHelpMenu(helpMn);
} // initializeMenus
} // MenuForm
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com