🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15243

Re: Loading a dialog from another file?

#15243
From: Paul Furbacher
Date: Fri, 25 Jun 1999 00:00
42 lines
1851 bytes
Eric Advincula wrote:

> Being new to java, I hope someone can help me.
> I have to files:
> frmMain.java contains the main frame
> dlgSplash.java contains a dialog, does nothing yet.
> I can load it like so:
> 
> dlgSplash m_Splash;
> m_Splash = new dlgSplash( this, false );
> 
> when both class code are in the same file.  But when I transferred the
> dialog to its own file called dlgSplash.java it gives me an error now.
> Coming from C++ I would use the header file to let the frmMain know about
> the dlgSplash dialog.  How do you do this in java.
> Is it import? and if so how do you use it?

import [packageName.]dlgSplash;

Since you are new to Java, you have to pay special attention
to "packages".  Perhaps the easiest way to figure out the 
name to put in the "import" statement is to open the 
"dlgSplash" file and look at its "package" statement.

Suppose it looks like this 

package myProjects;


Your import statement would read

import myProjects.dlgSplash; // or   

import myProjects.*;


Assuming your project's source path ( File | Project properties... )
is set correctly.  It probably will be if you have allowed JBuilder
to do all the creating of new classes within same project.


Paul Furbacher (TeamB)
Technical Details
Message-ID: <3774065E.B807F2E5@bilbo.bio.purdue.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7l0ol0$fuf7@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,9e6c56313e026a17
X-Google-Attributes: gidf74b3,public
From: Paul Furbacher <pf@bilbo.bio.purdue.edu>
Subject: Re: Loading a dialog from another file?
Date: 1999/06/25
Message-ID: <3774065E.B807F2E5@bilbo.bio.purdue.edu>
X-Deja-AN: 493941484
Content-Transfer-Encoding: 7bit
References: <7l0ol0$fuf7@forums.borland.com>
Content-Type: text/plain; charset=us-ascii
Organization: Reverse Alchemy, Inc.
Mime-Version: 1.0
Reply-To: pf@bilbo.bio.purdue.edu
Newsgroups: borland.public.jbuilder.java.language