Statics Methods (Miscellaneous)

buildURL Constructs a fully-qualified path from a base URL and a file path.
getVersionString Retrieves the version string in the form MM.NN.BBBB, where MM is the major version, NN is the minor version, and BBBB is the build number.

buildURL

Statics Class

Constructs a fully-qualified path from a base URL and a file path.

Syntax

public static URL buildURL( URL url, String pathname );

Parameters

url
Base URL.
pathname
File path.

Return Value

Returns a java.net.URL object.

Example

The following code fragment constructs one URL for the directory where images are stored and another for where sounds are stored:

{
// This is a piece of a larger program
// Construct the URLs
URL mediabase = buildURL(getImportBase(),
"../../../../../../Media/");
URL imgBase = buildURL(mediabase, "image/");
URL sndBase = buildURL(mediabase, "sound/");

//Create an image behavior by importing a bitmap
ImageBvr img = importImage(buildURL(imgBase, "img1.jpg"));

//The rest of the program

}

getVersionString

Statics Class

Retrieves the version string in the form MM.NN.BBBB, where MM is the major version, NN is the minor version, and BBBB is the build number.

Syntax

public static String getVersionString( );

Return Value

Returns the String object.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.