Results 1 to 15 of 15

Thread: opening a java class file from vb

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    help needed.......urgent.......

    Hi,
    I need to run a java class file from VB. I tried using the ShellExecute API, but that returns 31( an error that "there is no program associated with the specified type of file.")

    How do I run the file? any ideas????

    Thanks.

  2. #2
    Hyperactive Member Juan Carlos Rey's Avatar
    Join Date
    Aug 1999
    Location
    Mendoza, Argentina
    Posts
    301
    Open it inside a WebBrowser?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    No, I didn't open it from a web browser. I placed a command button on a form and in the click event of the command button I called the ShellExecute API.

  4. #4
    Hyperactive Member Juan Carlos Rey's Avatar
    Join Date
    Aug 1999
    Location
    Mendoza, Argentina
    Posts
    301
    Excuse my bad English, I meant:
    "Why don't you try to open it inside a Web Browser?"

  5. #5
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    Try using "jview classname" or "wjview classname" as the executable to run.
    "People who think they know everything are a great annoyance to those of us who do."

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    Oh ok, Juan Carlos Rey...will try to.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    noone,

    Im unable to open the java class file from VB using jview or wjview. Does jview work from VB or only from VJ++???
    Any more ideas??

    Thanks a lot.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    any more ideas???

    any more ideas on openaing a java class file from VB????? im bordering on desperation!!!!!!!! help needed........

  9. #9
    Member
    Join Date
    Jan 1999
    Location
    Vancouver, BC, Canada
    Posts
    32
    What Juan Carlos was suggesting, is that you use the WebBrowser Control to open a web page which contains the Java Applet.

    First you need to create the web page itself, with the Applet embedded into it. Then you need to store that web page either locally on the computer, or on a home page somewhere.

    Finally, you need to create your VB form and drop the WebBrowser control onto it (Note you MUST have Internet Explorer 4.0 or higher to see the WB Control in your components list). All you do, is specify the URL to which you want to navigate...which in your case is the web page you just created.

  10. #10
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    Jview and WJview are MS' Java Interpretters. They should run any compiled Java Application. Is the class file your trying to run an applet or Java application?
    "People who think they know everything are a great annoyance to those of us who do."

  11. #11
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Hi Rammy,

    If you want to RUN the class file (if its a class therefore its an applet of one kind or another), so use the Internet control in your VB application by Clicking on PROJECT on the menubar and COMPONENTS and find the Internet WEB BROWSER control and in the DOCUMENTSOURCE (i'm not sure if that is the correct property name- but i'm sure you get the drift)set the anme of the Java class file you wish to open, and if that doesn't work then do as Brent Akster and Carlos Juan says and create a HTML file with the java class in there and use that as the source docuument for the web browser control.

    DocZaf
    {;->


  12. #12
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    Zaf,
    Not all Java class files are applets. A java program can be written as an application. If it is an applet then you will have to create an HTML file to run it. If you are writing for a new version of Windows it almost certainly has jview.exe or wjview.exe on it.
    "People who think they know everything are a great annoyance to those of us who do."

  13. #13
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Hmmmmmmmm

    Okay Noone, thank you for educating me...
    I'm glad i'm just a humble guy, as i dont have far to fall, and learn more everyday
    Cheers
    DocZaf
    {;->

  14. #14
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    Hey Zaf,
    Sorry if I came off sounding a bit condescending, didnt mean it. Just get a little touchy when it comes to Java (love Java, gotta use VB for school). Anyways Rammy, have you got your program to run the class file?
    "People who think they know everything are a great annoyance to those of us who do."

  15. #15
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Hey Noone NP
    :-)

    Thats okay, i never took it like that,
    and am sorry if i gave the wrong impression.

    And rammy , sure all the time, i'll be checking, to learn as well as to help out if possible

    DocZaf
    {;->


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width