Results 1 to 7 of 7
  1. #1
    aybeeryu is offline Member
    Join Date
    Aug 2011
    Posts
    4
    Rep Power
    0

    Default applet not working only when opened in browsers

    hi,

    This is one of the most frustrating road block I've had in 8 years of programming. I created a netbeans UI(swing) based applet. What this applet does is finds small servers in the local network and displays them with an link to it. The applet works absolutely fine when i right click on it and select run file, but it breaks out in browser mode :(

    it does give me a warning though:
    warning: [options] bootstrap class path not set in conjunction with -source 1.6

    i hope that is not what is breaking it down


    Any help would be greatly appreciated:) been stuck on this for days
    Last edited by aybeeryu; 08-11-2011 at 10:29 PM.

  2. #2
    aybeeryu is offline Member
    Join Date
    Aug 2011
    Posts
    4
    Rep Power
    0

    Default

    also error on the web applet console:


    Detected from bootclasspath: C:\PROGRA~1\Java\jre7\lib\deploy.jar
    0
    localhost
    127.0.0.1

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    Are there any error messages in the browser's java console?

    What is the web applet console?

  4. #4
    aybeeryu is offline Member
    Join Date
    Aug 2011
    Posts
    4
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    Are there any error messages in the browser's java console?

    What is the web applet console?
    the html file has the section defined for the swing applet, ideally in that section you would have applet running but in my case all it says in the left hand corner is "Error, click for details"

    when you click it a pop up window appears, titled application error

    "String index out of range: 9"

    "There was an error while executing the application. Click"Details" for more info"

    then when you click details the following shows:


    Java Plug-in 10.0.0.147
    Using JRE version 1.7.0-b147 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Administrator
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    Detected from bootclasspath: C:\PROGRA~1\Java\jre7\lib\deploy.jar
    0
    localhost
    127.0.0.1

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    a pop up window appears, titled application error
    "String index out of range: 9"
    A different way to display the error message. Normally you see that kind of message on the java console.
    Look in the applet code for try{}catch() {} blocks. Make sure that ALL of them call the Exception class's printStackTrace method.
    I suspect there is one place where the popup message is displayed with JOptionPane.

    Have you evaluated your code wrto the error message? What kind of String indexing does it do? Can the index go past the end of the String?

  6. #6
    aybeeryu is offline Member
    Join Date
    Aug 2011
    Posts
    4
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    A different way to display the error message. Normally you see that kind of message on the java console.
    Look in the applet code for try{}catch() {} blocks. Make sure that ALL of them call the Exception class's printStackTrace method.
    I suspect there is one place where the popup message is displayed with JOptionPane.

    Have you evaluated your code wrto the error message? What kind of String indexing does it do? Can the index go past the end of the String?
    alright this seems to be a good direction to work on, I do have a lot of exception handling but i kinda reduced their interact with the console(because the applet was working perfectly on the netbeans interface) so i can never actually figure out what is going on behind the UI, anyways i will put in StackTrace everywhere possible and get back to you hopefully with a better description of the error. Meanwhile any other tips on printing out error messages on a swing applet would be helpful. Thanks and i will get back to you soon.

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    Just noticed you were using java 1.7
    I get the error message you reported in post#1 when I compile with 1.7 and use the -source option:


    Running: D:\Java\jdk1.7.0\bin\javac.exe -Xlint -g -deprecation -classpath D:\JavaDevelopment\;. -source 1.6 -target 1.6 Balloon.java

    warning: [options] bootstrap class path not set in conjunction with -source 1.6

Similar Threads

  1. applet working in applet viewer, not browser
    By plasticfood in forum Java Applets
    Replies: 4
    Last Post: 06-24-2011, 07:47 PM
  2. My Applet Not working
    By mftbrothers in forum Java Applets
    Replies: 3
    Last Post: 03-31-2011, 10:03 AM
  3. Replies: 8
    Last Post: 03-10-2011, 08:00 PM
  4. Applet Not Working Please Help....
    By ajjukumar in forum New To Java
    Replies: 2
    Last Post: 01-07-2011, 03:16 PM
  5. Applet not working
    By jyothi.priyanka in forum New To Java
    Replies: 5
    Last Post: 04-16-2009, 09:18 AM

Tags for this Thread

Posting Permissions

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