aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes accessing standalone swing program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "accessing standalone swing program" Watch "accessing standalone swing program" New topic
Author

accessing standalone swing program

nasha shaharan
Greenhorn

Joined: Jun 01, 2011
Posts: 22
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

Joined: Oct 16, 2003
Posts: 1076
    
  10

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


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

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?

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

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?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
nasha shaharan
Greenhorn

Joined: Jun 01, 2011
Posts: 22
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

Joined: Jul 26, 2007
Posts: 10255
    
    8

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

Joined: Oct 27, 2005
Posts: 19670
    
  18

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

Joined: Jun 01, 2011
Posts: 22
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

Joined: Oct 27, 2005
Posts: 19670
    
  18

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

Joined: Jun 01, 2011
Posts: 22
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

Joined: Oct 27, 2005
Posts: 19670
    
  18

You're welcome
Amit Kanojiya
Greenhorn

Joined: Aug 26, 2012
Posts: 1
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: accessing standalone swing program