The first step is to make the main part of the program
implement the FileViewer
interface. See the
documentation for FileViewer
for more info.
This info is in the developer directory.
Next, your main class must contain these two static methods.
/*
/*
* Returns a description of this viewer. It is advisable to put
* the title and then the version.
*/
public static String getFileViewerDescrip()
* Returns an instance of a FileViewer object that can be used by
* Packafied.
*/
public static FileViewer getFileViewer()
Usually, if the class that contains the above static methods is the
same class that you have made implement the FileViewer
interface, your getFileViewer() method will look something like this:
public class MyApp extends Frame
{
public static void main(String[] args)
{
MyApp app = new MyApp();
app.setSize(100,100);
app.show();
}
public MyApp()
{
super("My Title");
//...Add components to the window...
}
public static String getFileViewerDescrip()
{
return("FileViewer App Demonstration 1.0");
}
/*
* Just like the main() method!
*/
public static FileViewer getFileViewer()
{
MyApp app = new MyApp();
app.setSize(100,100);
app.show();
return(app);
}
}