DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006

    applet problems on webpage????

    Hi, I know what I'm doing for the most part with java, but when I tried to load my applet onto the webpage I've been working on for this lady (click on artwork), it doesn't load (even though it looks perfect if I run with the appletviewer). It is supposed to be a picture viewer that takes random paintings and does a nice dissolve effect in between. I think that the problem is that I need to load information for each pic from a txt file. You know for title, size,etc.. Please help!

    [EDIT] I did read something about java securities and txt files. Do I need to make the txt file into a URL and get the document base then read it in?? Well I guess I'll try it
    Last edited by osirisboy212; 08-01-2006 at 04:44 PM.

  2. #2
    Join Date
    Aug 2006
    here's the segment of code that I think is causing the issues in the browser. The actual processing of the txt file is correct so don't worry about that. I'll submit more of my code if its necessary

    in = new Scanner(new FileReader(FILE_NAME));
    String thisLine = in.nextLine();
    Scanner im = new Scanner(thisLine);
    im.useDelimiter("- |, |; |\r\n");
    if(thisLine.equals("") || thisLine.substring(0,2).equals("??") );
    String artistName = im.next();
    Artist newArtist = new Artist(artistName);
    String loc;
    String title;
    String size;
    String medium;
    loc = im.next();
    title = im.next();
    size = im.next();
    medium = im.next();
    Painting newPainting = new Painting(artistName, loc, title, size, medium);

  3. #3
    Join Date
    Aug 2006
    ok well never mind I figured it out myself. If however I want to have my applet run on older browserswith older versions of the java jre, do I need to compile the files with an older version of java as well or is there some short cut to do it with current java 1.5

  4. #4
    Join Date
    Jan 2006
    It sounds like some of your code is only supported by Java version 1.5, hence your problems when running your applet on older browsers. I dont think you can simply recompile with an older compiler. Your only options are ...

    a. Encourage your users to download the latest version of JRE
    b. Recode your applet using code that is compatible with older versions of java

  5. #5
    Join Date
    Aug 2006

    really interesting problems

    alright well I got it working for java versions 1.4 and up for now, but I'm noticiing some inconsistencies between 1.5 and 1.4. On the java 1.5 jre it displays everything perfectly as it should and I couldn't be happier. On Java 1.4 about half of the pictures I display (I'm doing a slide show of sorts) don't show up, although their titles do. Anyone have any ideas?? Up until now I at least had theories... Thanks.
    you can check it out at http://artliaisons.com under artwork

  6. #6
    Join Date
    Aug 2006
    ok nevermind I figured it out, but just for everyone to know: java 1.4 and lower don't support image file names with spaces in them (off of servers at any rate, they do work in the applet viewer oddly enough). java 1.5 is cool with file names with spaces in them though. Problem solved
    Last edited by osirisboy212; 08-07-2006 at 10:40 PM.

Similar Threads

  1. Problems getting an Applet to run off ftp
    By Manticor in forum Java
    Replies: 2
    Last Post: 05-29-2005, 01:27 AM
  2. Replies: 3
    Last Post: 08-23-2001, 11:01 AM
  3. Applet Scrolling problems
    By hh in forum Java
    Replies: 0
    Last Post: 08-03-2000, 03:51 PM
  4. applet and thread problems
    By aneesha in forum Java
    Replies: 0
    Last Post: 05-06-2000, 10:38 PM
  5. Applet and thread problems
    By Aneesha in forum Java
    Replies: 0
    Last Post: 05-06-2000, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.