🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Calling applis from an appli

#8639
From: icsd.jt
Date: Mon, 05 Mar 2001 07:12
230 lines
10933 bytes
C'est un message de format MIME en plusieurs parties.

------=_NextPart_000_0095_01C0A54C.03A0C7E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I think I have understand your explanations and
I highly thank you.  There remains to me a question:
To test I put 2 applications in the same directory
   (the two run each alone correctly):
1-application (Zones) with main()=20
  simple management of a table with jdbtable
2-the appealing menu (Mmenu) only with a button
  void jButton1_actionPerformed(ActionEvent e) {
    // call main() Zones=20
  }
Can you me specify how to call Zones in Mmenu.
I have try
 Zones.CadZ();  // CadZ is the main method of the appli Zones
 Zones.main() .....
 but F9 say always to me
     variable Zones is unknow in class Mmenu=20
         (with or without   import Zones; )
 however I see in the structur panel the packet Zones
 and the helps of JB4 EDI proposes well to me Zones.Cadz
The two applications have different package name : it's important ?=20
In advance large thank.
Regards, Jacques
"John McGrath [TeamB]" <ng-b@JPMcGrath.net> a =E9crit dans le message =
news: MPG.150b85684df4a28498a003@forums.borland.com...
> On Sat, 3 Mar 2001 16:30:25 +0100, icsd.jt@wanadoo.fr wrote:
>=20
> > I want just grouping this applications in one alone or make
> > an super main menu for reduce the chargement time.
> > It ' s possible ? and how .
>=20
> Sure, that is possible, and it sounds like it would be an ideal way to =

> run those "applications".  When you run them all in a single virtual=20
> machine, they will start faster and consume a lot less resources.
>=20
> I am assuming that you have control of the source of the applications. =
=20
> If so, then you will probably just have to make a few simple changes =
to=20
> the structure of the applications to make them co-exist in the same VM =

> with other code.  It is even possible that the applications are =
already=20
> well behaved, and no changes will be needed.
>=20
> The area that is most likely to be an issue is how the applications=20
> shut themselves down.  If one of the applications calls System.exit(), =

> it will shut down the virtual machine, so your menu and any other=20
> running applications will terminate as well.
>=20
> Exactly how to deal with this will depend on the structure of your=20
> applications.  Assuming that they are typical Java GUI programs, they=20
> have a main() method that instantiates a single frame and shows it.  =
In=20
> that case, you can just have your menu instantiate and show the frame=20
> when the user runs the application from the menu.
>=20
> The best way to deal with the exit() issue is to have the exit =
function=20
> for the application just dispose the frame.  Then from the main()=20
> method, add a WindowListener to the frame that detects the =
windowClosed=20
> event (not windowClosing), and does an exit when that occurs.
>=20
> Other areas to watch out for is how static variables are initialized=20
> and handled.  If an application assumes that it will be the only user=20
> of such variables, it may find that it is wrong.
>=20
> Another concern is the reentrancy of the applications.  When run from=20
> the main() method, they are always run once and then the VM is shut=20
> down after one execution.  But with this model, it will be possible to =

> run the application multiple times.  So keep an eye out for code that=20
> makes such assumptions.
>=20
> If you do this right, the applications should be able to run from the=20
> command line or from your menu without any noticeable difference in=20
> their behavior. =20
>=20
> Good luck, and left us know how it works out for you.
>=20
> --=20
> Regards,
>=20
> John McGrath [TeamB]
>=20
> ---------------------------------------------------
> Before sending me e-mail, please read:
>     http://www.JPMcGrath.net/newsgroups/e-mail.html

------=_NextPart_000_0095_01C0A54C.03A0C7E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4611.1300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>I think I have understand your =
explanations=20
and<BR>I highly thank you.&nbsp; There remains to me a question:<BR>To =
test I=20
put 2 applications in the same directory<BR>&nbsp;&nbsp; (the two run =
each alone=20
correctly):<BR>1-application (Zones) with main() <BR>&nbsp; simple =
management of=20
a table with jdbtable<BR>2-the appealing menu (Mmenu) only with a=20
button<BR>&nbsp; void jButton1_actionPerformed(ActionEvent e)=20
{<BR>&nbsp;&nbsp;&nbsp; // call main() Zones <BR>&nbsp; }<BR>Can you me =
specify=20
how to call Zones in Mmenu.<BR>I have try<BR>&nbsp;Zones.CadZ();&nbsp; =
// CadZ=20
is the main method of the appli Zones<BR>&nbsp;Zones.main() =
.....<BR>&nbsp;but=20
F9 say always to me<BR>&nbsp;&nbsp;&nbsp;&nbsp; variable Zones is unknow =
in=20
class Mmenu <BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (with or=20
without&nbsp;&nbsp; import Zones; )<BR>&nbsp;however I see in the =
structur panel=20
the packet Zones<BR>&nbsp;and the helps of JB4 EDI proposes well to me=20
Zones.Cadz</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The two applications have different =
package name=20
:&nbsp;it's&nbsp;important ?</FONT><FONT face=3DArial =
size=3D2>&nbsp;<BR>In advance=20
large thank.<BR>Regards, Jacques<BR></DIV></FONT>
<DIV><FONT face=3DArial size=3D2>"John McGrath [TeamB]" &lt;</FONT><A=20
href=3D"mailto:ng-b@JPMcGrath.net"><FONT face=3DArial=20
size=3D2>ng-b@JPMcGrath.net</FONT></A><FONT face=3DArial size=3D2>&gt; a =
=E9crit dans le=20
message news: </FONT><A=20
href=3D"mailto:MPG.150b85684df4a28498a003@forums.borland.com"><FONT =
face=3DArial=20
size=3D2>MPG.150b85684df4a28498a003@forums.borland.com</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; On Sat, 3 Mar =
2001 16:30:25=20
+0100, </FONT><A href=3D"mailto:icsd.jt@wanadoo.fr"><FONT face=3DArial=20
size=3D2>icsd.jt@wanadoo.fr</FONT></A><FONT face=3DArial size=3D2> =
wrote:<BR>&gt;=20
<BR>&gt; &gt; I want just grouping this applications in one alone or=20
make<BR>&gt; &gt; an super main menu for reduce the chargement =
time.<BR>&gt;=20
&gt; It ' s possible ? and how .<BR>&gt; <BR>&gt; Sure, that is =
possible, and it=20
sounds like it would be an ideal way to <BR>&gt; run those =
"applications".&nbsp;=20
When you run them all in a single virtual <BR>&gt; machine, they will =
start=20
faster and consume a lot less resources.<BR>&gt; <BR>&gt; I am assuming =
that you=20
have control of the source of the applications.&nbsp; <BR>&gt; If so, =
then you=20
will probably just have to make a few simple changes to <BR>&gt; the =
structure=20
of the applications to make them co-exist in the same VM <BR>&gt; with =
other=20
code.&nbsp; It is even possible that the applications are already =
<BR>&gt; well=20
behaved, and no changes will be needed.<BR>&gt; <BR>&gt; The area that =
is most=20
likely to be an issue is how the applications <BR>&gt; shut themselves=20
down.&nbsp; If one of the applications calls System.exit(), <BR>&gt; it =
will=20
shut down the virtual machine, so your menu and any other <BR>&gt; =
running=20
applications will terminate as well.<BR>&gt; <BR>&gt; Exactly how to =
deal with=20
this will depend on the structure of your <BR>&gt; applications.&nbsp; =
Assuming=20
that they are typical Java GUI programs, they <BR>&gt; have a main() =
method that=20
instantiates a single frame and shows it.&nbsp; In <BR>&gt; that case, =
you can=20
just have your menu instantiate and show the frame <BR>&gt; when the =
user runs=20
the application from the menu.<BR>&gt; <BR>&gt; The best way to deal =
with the=20
exit() issue is to have the exit function <BR>&gt; for the application =
just=20
dispose the frame.&nbsp; Then from the main() <BR>&gt; method, add a=20
WindowListener to the frame that detects the windowClosed <BR>&gt; event =
(not=20
windowClosing), and does an exit when that occurs.<BR>&gt; <BR>&gt; =
Other areas=20
to watch out for is how static variables are initialized <BR>&gt; and=20
handled.&nbsp; If an application assumes that it will be the only user =
<BR>&gt;=20
of such variables, it may find that it is wrong.<BR>&gt; <BR>&gt; =
Another=20
concern is the reentrancy of the applications.&nbsp; When run from =
<BR>&gt; the=20
main() method, they are always run once and then the VM is shut <BR>&gt; =
down=20
after one execution.&nbsp; But with this model, it will be possible to =
<BR>&gt;=20
run the application multiple times.&nbsp; So keep an eye out for code =
that=20
<BR>&gt; makes such assumptions.<BR>&gt; <BR>&gt; If you do this right, =
the=20
applications should be able to run from the <BR>&gt; command line or =
from your=20
menu without any noticeable difference in <BR>&gt; their behavior.&nbsp; =

<BR>&gt; <BR>&gt; Good luck, and left us know how it works out for =
you.<BR>&gt;=20
<BR>&gt; -- <BR>&gt; Regards,<BR>&gt; <BR>&gt; John McGrath =
[TeamB]<BR>&gt;=20
<BR>&gt; ---------------------------------------------------<BR>&gt; =
Before=20
sending me e-mail, please read:<BR>&gt; &nbsp;&nbsp;&nbsp; </FONT><A=20
href=3D"http://www.JPMcGrath.net/newsgroups/e-mail.html"><FONT =
face=3DArial=20
size=3D2>http://www.JPMcGrath.net/newsgroups/e-mail.html</FONT></A></BODY=
></HTML>

------=_NextPart_000_0095_01C0A54C.03A0C7E0--
Technical Details
Message-ID: <3aa33b30_1@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!news.stealth.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!193.252.62.85
References: <3aa0a077_1@dnews> <MPG.150a9aa7fc92fce5989ffc@forums.borland.com> <3aa10cea$1_2@dnews> <MPG.150b85684df4a28498a003@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f74b3,ec6af10449d9afc3
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-03-04 23:16:12 PST
Reply-To: <icsd.jt@wanadoo.fr>
From: <icsd.jt@wanadoo.fr>
Newsgroups: borland.public.jbuilder.java.language
References: <3aa0a077_1@dnews> <MPG.150a9aa7fc92fce5989ffc@forums.borland.com> <3aa10cea$1_2@dnews> <MPG.150b85684df4a28498a003@forums.borland.com>
Subject: Re: Calling applis from an appli
Date: Mon, 5 Mar 2001 08:12:26 +0100
Lines: 232
Organization: ICSD - JaC
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="----=_NextPart_000_0095_01C0A54C.03A0C7E0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 193.252.62.85
Message-ID: <3aa33b30_1@dnews>
X-Trace: 4 Mar 2001 23:07:28 -0800, 193.252.62.85
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!news.stealth.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!193.252.62.85