Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to transfer program control?

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There:
I am almost at the end of local mode functioning. Once I finalize it and happy with it I want to move forward network mode. There I will think about how to handel lock/unlock and create remote objects. Right now I have problem regarding how to transfer control over form one small application to another.
Let me explain my dilema:
I have small Login page. On the Login page there will be two radio buttons(each for local and remote mode) and two JButtons as Login and Cancel. Once user clicks Local mode and Login button I would like to hide Login page and run FlightReservation application. I want to do it without writing a batch file. Is this possible? For example:

I want line 6 as java run command instead of System.out.println. I want to send java -classpath . suncertify.db.FlightReservation command on DOS window, so I can run FilghtReservation GUI. Any response in this matter highly appreciated. Thanks in advance for response. Wish you Happy New Year.
-Bal

 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bal
<code>//System.out.println("Run at local mode");
System.out.println("java -classpath . suncertify.db.FlightReservation"); //Line 6</code>

You can just call your 'local' class FlightReservation with new. e.g. new FlightReservation();
/Ren�
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is fine if it is local mode. I can call local class. But if it is network mode, I got to start server and client right! How can I pass 'start java -Djava.security.policy=server.policy MyServer' command on DOS prompt. Again when server is ready I want to pass 'java -Djava.security.policy=client.policy FlightReservation' on DOS window. I have same FlightReservation GUI class for server and client. Thanks for any response.
-Bal
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bal
OK...
If you are going to use remote mode, then you have - or should have - a server running...
If you for some reason have to pass e.g. -Djava.security.policy=client.policy to your client, then you can do it with <code>System.setProperty("java.security.policy", "client.policy")</code> in your remote client code.
And again you start your remote client with <code>new FlightReservation(....)</code>
/Ren�
[This message has been edited by Rene Larsen (edited December 28, 2001).]
[This message has been edited by Rene Larsen (edited December 28, 2001).]
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ren� for your prompt response. Let me do more home work and see what comes out. Either way I will let you know my result. OR may be ask more questions. Thanks again.
-Bal
    Bookmark Topic Watch Topic
  • New Topic