Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: Determine If Applet was lunched directly form localhost

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Determine If Applet was lunched directly form localhost

    At first i would like to apologize for my english.
    I know tha every time when somebody is lunching an applet from a website it is dowloaded to klient pc and lunched on JVM. But can i determine if my applet was lunched directly from clients pc? I am talking about situation when client has downloaded my jar file (directly form the webpage) and he is lunching jar file directly from his pc (without my website).

    I hope i describe my problem clear enought to be understandable.

    Thank you very much for your time.


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Determine If Applet was lunched directly form localhost

    Your application could attempt to access the internet when launched from the jar. No guarantees the user will be connected, but you could choose to close the application or retry the connection again later etc. If and when the user allows the application to connect, you could then find out the downloaded jar was executed. If the user starts the application with web start, well it should be fairly easy to tell when that happens.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,129
    Thanks
    52
    Thanked 2,286 Times in 2,257 Posts

    Default Re: Determine If Applet was lunched directly form localhost

    What do the getCodeBase() and getDocumentBase() methods return?
    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,129
    Thanks
    52
    Thanked 2,286 Times in 2,257 Posts

    Default Re: Determine If Applet was lunched directly form localhost

    How are you doing on this project?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Determine If Applet was lunched directly form localhost

    Quote Originally Posted by Norm View Post
    How are you doing on this project?
    Sorry, lately i have a lot on my mind and i forget to answear.
    This has solved my problem
    Thank you very much for your help.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,129
    Thanks
    52
    Thanked 2,286 Times in 2,257 Posts

    Default Re: Determine If Applet was lunched directly form localhost

    Can you describe how you solved your problem?
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Determine If Applet was lunched directly form localhost

    Quote Originally Posted by Norm View Post
    Can you describe how you solved your problem?
    It was quite easy.
    First I have used getCodeBase() method in my applet and then i have passed it to the php script located on server.
    In that script i had compare passed codebase with the codebase on my server.

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,129
    Thanks
    52
    Thanked 2,286 Times in 2,257 Posts

    Default Re: Determine If Applet was lunched directly form localhost

    Thanks.
    If you don't understand my answer, don't ignore it, ask a question.

  9. The Following User Says Thank You to Norm For This Useful Post:

    ncreaved (April 27th, 2013)

Similar Threads

  1. How to Determine if a String is a Word or Number?
    By megnog in forum Java Theory & Questions
    Replies: 18
    Last Post: April 19th, 2012, 04:31 PM
  2. Mail Sender Application from Localhost
    By srinivasgoudn in forum Web Frameworks
    Replies: 11
    Last Post: January 12th, 2012, 12:44 AM
  3. JNLP webstart application in localhost
    By Jhovarie in forum Threads
    Replies: 2
    Last Post: February 14th, 2011, 05:53 PM
  4. [SOLVED] Help; algorithm to determine 'range'
    By b_jones10634 in forum Algorithms & Recursion
    Replies: 13
    Last Post: August 24th, 2010, 04:57 PM
  5. Java Swing :Back Button from one form to another form
    By srinivasan_253642 in forum AWT / Java Swing
    Replies: 1
    Last Post: December 26th, 2009, 08:51 AM