> Hi Java Professionals,
>
[quoted text clipped - 5 lines]
> Thanks,
> Mahesh
You could add code to your Java program to run as an JApplet or
Application.

Signature
Thanks in Advance...
IchBin
__________________________________________________________________________
'The meeting of two personalities is like the contact of two chemical
substances:
if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist
Mahesh Reddy - 12 Feb 2005 03:56 GMT
Thanks for ur reply.
But,I already extend JFrame. So, I wouldn't be able to extend JApplet.
I could do the same application with JApplet too(for including it in HTML
document), but the window wouldn't look as good as doing with JFrame.
So, could u plz suggest any means of including a JFrame program in HTML
document.
Andrew Thompson - 12 Feb 2005 15:05 GMT
> So, could u plz suggest any means of including a JFrame program in HTML
> document.
[j]applet.[getContentPane.]add( jframe.getContentPane() );
That will include the content of the application UI in an applet.
There might be problems with menubars, as well as a lot of the
things applications do (things like System.exit(0), new File("blah") ).

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
IchBin - 12 Feb 2005 04:06 GMT
>> Hi Java Professionals,
>>
[quoted text clipped - 10 lines]
> You could add code to your Java program to run as an JApplet or
> Application.
As an applet it will be able to start because of the init()
and as a Application because of the main.
Extend you program Class with Applet:
Add a Applet init() method to be used as an applet or be called from
your main method to bill your GUI as an application.
In in the main method define your JFrame.
Frame frame = new Frame( );
applet.init();
frame.add(applet);
frame.validate();
frame.setVisible(true);
applet.start();
frame.addWindowListener (
new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
applet.stop();
applet.destroy();
System.exit(0);
}
} //
); //

Signature
Thanks in Advance...
IchBin
__________________________________________________________________________
'The meeting of two personalities is like the contact of two chemical
substances:
if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist