-
class outside of its source file
Hi,
I use a class called OKFrame in a file that does not contained it
and I have this error message:
src/jade/grassplot/OxGrid.java:55: class jade.grassplot.OKFrame
is defined in MapSetPick.java. Because it is used outside of its
source file, it should be defined in a file called "OKFrame.java".
OKFrame ok = new OKFrame();
^
I tried to import the file where my class is in the file where
I want to use it but it doesn't work, and I don't know why I
should defined my class alone in a file.
Thanks a lot
-
Re: class outside of its source file
From what I can see, you are not trying to USE the class OKFrame in this
file. You are trying to DEFINE it there. Why should you define your class
alone in its own file? Because that's the rule in Java. Create a file
called OKFrame.java, as the message says, and put the code for the class
OKFrame in it. The file MapSetPick.java should contain only the class
MapSetPick; it can create objects of class OKFrame if you like.
haagen <haagendemerak@hotmail.com> wrote in message
news:399d3ebe$1@news.devx.com...
>
> Hi,
>
> I use a class called OKFrame in a file that does not contained it
> and I have this error message:
>
>
> src/jade/grassplot/OxGrid.java:55: class jade.grassplot.OKFrame
> is defined in MapSetPick.java. Because it is used outside of its
> source file, it should be defined in a file called "OKFrame.java".
> OKFrame ok = new OKFrame();
> ^
>
>
> I tried to import the file where my class is in the file where
> I want to use it but it doesn't work, and I don't know why I
> should defined my class alone in a file.
>
> Thanks a lot
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks