This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accessing standalone swing program

 
nasha shaharan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
greetings all.

i have a program on my computer that i created using java swing. it is similar to a webpage, but it is standalone eg using JFrame, JButtons etc...the login page is connected to database to compare username and password entered. after login success, another frame pops out...etc

now..

i wanna access this particular program from another pc. but unfortunately this is not a web application, so i cannot access using browser by typing the ip address..

so i wanna know, is it possible to access the standalone program we call login.java, from a different computer? if it's possible, how?

thanks in advance!
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to use RMI to do that:
http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136424.html
http://download.oracle.com/javase/tutorial/rmi/index.html
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

What do you mean by "access"
If your application is on machine A, do you want to run it on machine B without installing it?
OR
Do you want to access the methods in your application from machine B?
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Nasha!

RMI can be used to call methods of a class, but it can't be used to show the server's user interface. You would need a completely new user interface on the client.

Nasha, can you tell us why you can't run a copy of this application on the other PC? Or why using remote desktop / VNC isn't an option to connect to the original PC and control its own desktop?
 
nasha shaharan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the welcome!

Maneesh:
What i mean by "access" is the first option. i want to run on machine B without installing.
Example: machine A acts as a server,and it contains a program, and machine B can view and access the program

Rob:
I want this to be like a web application. but instead i am using standalone program..with swing GUI.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to run on machine B without installing.

I am afraid thats not possible with a Swing application

Considering you have an application ready, one of the options you can explore is Java Web Start
http://download.oracle.com/javase/tutorial/deployment/webstart/

 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see five options:
1) install the client on the second PC anyway.
2) use web start as Maneesh suggested; you still need a JRE installed.
3a) use VNC to connect to the first PC. The first PC needs a VNC server installed, the second PC needs a VNC client installed.
3b) use remote desktop connection to connect to the first PC. This is available by default as a server for Windows XP / Vista / 7 (Professional, Enterprise, Ultimate editions only), as a client it's available on all recent Windows versions.
3c) use another remote connection mechanism (e.g. TeamViewer, Remote Anywhere, ...).
4) convert the Swing application into an applet, and put that on a web server. Again, the second PC needs a JRE installed.
5) convert the Swing application into a web application.
 
nasha shaharan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:I see five options:
1) install the client on the second PC anyway.
2) use web start as Maneesh suggested; you still need a JRE installed.
3a) use VNC to connect to the first PC. The first PC needs a VNC server installed, the second PC needs a VNC client installed.
3b) use remote desktop connection to connect to the first PC. This is available by default as a server for Windows XP / Vista / 7 (Professional, Enterprise, Ultimate editions only), as a client it's available on all recent Windows versions.
3c) use another remote connection mechanism (e.g. TeamViewer, Remote Anywhere, ...).
4) convert the Swing application into an applet, and put that on a web server. Again, the second PC needs a JRE installed.
5) convert the Swing application into a web application.


soo which option would you recomment most for a beginner like me? anyway thanks for all those options
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Options 1 and 3 are the easiest, as they don't require any coding. Option 2 is also quite easy, it only needs a bit of setup for web start, no coding. Option 4 is a bit more work as you will have to turn all JFrames into JApplets. Option 5 basically means rewriting almost your entire application.
 
nasha shaharan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay thank you so much Rob...your ideas really put this into perspective...i was so lost before this
now i will look into the options. thanks again!
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
Amit Kanojiya
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to develop an application which will run server and and access through Remote connection to multiple user, is normal application is accessible to multiple user at the same time or we have to make some effort . We are thinking to use technologies are 1: java swing and hibernate for persistence layer , as its single desktop application , so does we need to add server to give access to multiple user at the same time.

Thanks in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic