Java.io and applets

I have about 20 ascii files that my applet will read when a certain button is pushed. The buttons have the names of 7 of the major files on them. I want to add files to the server but not change the code. I have been able to do this from a local machine using the following code fragment.
url = app.getCodeBase();
f = new File(url.getPath());
list = f.list(this);
sort();
for(int i=0, j = 0, k = 0;i<list.length;i++) {
if(Character.isDigit(list.charAt(list[i].length() - 5))) {
b = new JButton(list[i].substring(0,list[i].length()-4));
b.setFont(fTen);
b.setBackground(Color.white);
b.setFocusPainted(false);
b.addActionListener(this);
b.setSize(100,20);
b.setLocation(k*100, j*20);
add(b);
k = (j == 19) ? k+1 : k;
j = (j < 19) ? j+1 : 0;
The problem arises when I place the jar file on the apache server. Url.getPath() returns / as the directory to look in and when i view the list of files, they are files from c:\ and not the apache web servers home directory. I am running under windows 2000. Does anyone know a way to get the file name from the server in this manner. thanks.

Forgot to mention that there is another awkward way of doing the same thing. This will only work if your web site doesn't contain a file named index.htm. You will notice that when you type the following:
http://www.mywebsite.com
If there is no index.html at that site, the browser will give you a directory listing -- you can make an inputstream to read and filter out the files that you need.
Hope this helps.
V.V.

Similar Messages

  • Configuration of java extensions and applets

    Hi,
    I'm running IIS5.1/CFMX7.0.1 and once again have difficulty
    configuring my extensions/applets:
    - extension: cfx_pdf (easel.com)
    - self-written richtexteditor applet (swing/jdk1.4) with
    retrieval function
    After some trouble both have been running on 6.1.
    Now I'm upgrading to CFMX 7.0.1, set the class paths and
    added both extensions but Java doesn't seem to get the job done.
    1. It can't locate the cfx_pdf jar class
    2. It is not retrieving the text from the richtexteditor
    after a post
    Is there any way to verify my settings besides the
    webconfiguration tool?
    Does CF have an alternative way to configure my extensions?
    Each time I configure CF( 6.1 & 7.0) extensions (both C++/Java)
    on some server (XP/MS2003 & IIS5.1/6.0) I run in to these
    problems...
    Cold Fusion is really getting on my nerves with this
    issue...

    PimDor,
    This should not be too hard to figure out. First, click on
    the system information link in cfadmin. Check the classpath and
    make sure your jar file is there for each cfx. Next, unzip the jar
    file using winzip or similar. Just view the main classname and note
    its capitalization. Java is case sensitive so when you enter the
    java cfx classname it must be spelled correctly. Also, if it is
    part of a package you must enter that using dot notation. So, if I
    have a CFX_ken that uses Kenco.class in package com.adobe.ken I
    enter the classname in cfadmin as: com.adobe.ken.Kenco . Note the
    capital K in Kenco. If this package were in ken.jar, I should be
    able to find ken.jar listed in the classpath on the sysinfo page.
    Finally, as a test you should be able to do a cfobject/java
    call and dump the class to confirm the class is available. So
    following the above example see the attached code. The cfdump
    should show the methods of your cfx class.

  • Can't get java runtime, and applets, running inside Firefox 11.

    I have gone to my Windows 7 control panel and enabled java for the mozilla family,
    which implies the web browser I use, Firefox 11 at the moment.
    I have gone to Firefox/Tools/Add-Ons/Plugins and have enabled the
    Java Deployment Kit 6.0.250.3
    However, when I go to the Oracle Java test page
    http://www.java.com/en/download/testjava.jsp
    It can't detect java working in my web browser.
    The install missing plugins button appears in the top right,
    and while it downloads java, it consistently fails here stating
    that I have the option to install manualy (which I have successfully done already).
    I have the java 6 download manager working, however I can't run applets embedded in the web browser.
    Please, how do I get my java working in firefox for my applets?

    Zachary1234 wrote:
    Yes, 32 bit java and a 32 bit web browser seem to be the only working answer for applets,
    even in windows 7 (and adherence to the firefox browser).No, its not. Its exactly as I said, not what you make of it. If you have a 64 bits firefox, install a 64 bits runtime.
    Let me put it differently: applets work just fine on my 64 bits Windows 7 under a 64 bits Firefox 11 with a 64 bits runtime.

  • Java Applications and Applets

    Are local Java programs only command line runnable? How can I create exe like programs? I already know about how Java doesn't use compilation, but bytecode interpretation.
    Can applets run locally or only browserly.

    Are local Java programs only command line runnable?Several programs set up batch files to invoke it with java.
    How can I create exe like programs?You can make an executable jar, and the java interpreter is invoked normally.
    I already know about how Java doesn't use compilationIt does use compilation. Java code compiles to java bytecode. This is run on the java interpreter. It doesn't compile down to native machine code, but it IS compiled.
    Can applets run locally or only browserly. Applets can run locally in using applet runner.

  • Java Program and Applet

    I am writing a program in which i need to take a string a user and count the number of words, Characters, and
    a particular sub-string. i need to Present back this info. I am a virtual beginner and i did not get any way of doing this. Please somebody help me

    geez man, you make it sound like your dying and need someone to save you. Since I am too lazy to write the whole program for you (and why should I?). You could use something like this to count the characters
    numOfChars = sentence.length()-1;that will give you the number of characters in the string including spaces.
    hmm thats enough to get you started :-p. Be sure to seach the forum to. You should be able to find the solution to your problem reletively easily.

  • JRE 6 freeze browsers and Java Control Panel Applet stops working!

    Hello,
    this is the second time I got this problem with Java JRE 6 ! First one was a month or two ago:
    I have Java JRE 6 update 20 installed on a Windows 7 64bit ultimate. It was working...much time ago...then i found my browser (firefox, google chrome or IE8) was freezing when I open java application or test pages. I tried uninstalling it, cleaning the system with Revo Uninstaller, or CCleaner or JavaRA and reinstalling with no luck. The other problem is the same that user Mass8 had (http://forums.sun.com/thread.jspa?threadID=5372196&start=15&tstart=0)
    ...my java control panel applet is not working and give me this:
    http://www.iouppo.com/lite/pics/df9b61008b5bf9de61a13d8bfa3ddad1.jpg
    I tried disabling UAC, running JRE, starting Win7 in safe mode with network...but browser always freeze. It's not a true freeze, with CPU busy at 100% (cpu stays in idle) but it seems to wait for something. It's not a problem with video card driver on my machine, because I can start java control panel from command prompt...and without the noddraw switch, using this command:
    javaw -Xbootclasspath/a:..\lib\deploy.jar -Duser.home="%HOMEDRIVE%%HOMEPATH%" com.sun.deploy.panel.ControlPanel
    This was the description of my first time.....then I replaced my system with an Acronis image...and I used the system for sometimes....and Java was working until 3-4 days ago! So I did another image of the system with all things working.
    Then this morning...I tried the java test page.....and surprise! It's not working anymore!
    In these days I think I only disabled UAC and Account virtualization....maybe JAVA saves things there...and then when I disabled UAC (Windows7 deleted those folders and files) it can't find there anymore???? Who can help me?
    I don't want to restore my image every month!
    My system is 100% virus free and from the last image restoration I didn't visit suspicious sites and so on....I have antivirus and antispyware software...all is perfectly CLEAN. Any ideas or things to try?

    I'm beginning to think it's something related to Hybernation after using JAVA....I'm using it very often...and if I use it...and I suspect Java is KO...i try control panel and it doesn't works....then I try with browser and it freeze (or keep waiting...and i can only force to close it)
    THEN,
    when I reboot my system I get this window
    http://www.iouppo.com/lite/pics/09501eb799c165bb25ece8fd3261e41c.jpg
    suggesting me to rename the folder C:\Program in C:\Program1 ...and if i don't rename it...java will never work...instead if I allow it...Windows will fix it!......This until...the next hybernation....:(....
    try to replicate this...maybe I found where is the problem..

  • Is it possible to run a website built in Java and applet from Safari browser in iPad

    Is it possible to run a website built in Java and applet from Safari browser in iPad?

    Java isn't supported on the iPad

  • What're the differences between JSP, Java Script, and Java Applet?

    I am confused by the concepts: JSP (Java Server Page), Java Script, and Java Applet? What are their main differences?

    I don't know about differences, but one of their main similarities is that each of them has a page in Wikipedia.
    JSP
    JavaScript
    [Java applet|http://en.wikipedia.org/wiki/Java_applet]
    There. That should give you enough information.

  • I was always instructed by Apple to install all updates.  I followed their advice and my Java disappeared and I can no longer play pogo scrabble.  pogo's "advice" to install Java is useless.  HELP PLEASE!

    I was always instructed by Apple to install all new updates offered.  When I installed the last one on my 10.5.7 macbook, my java disappeared.  Java's advice is useless.  I can no longer play pogo scrabble without java.  Please help.  Thank you very much.

    MadMAC0 posted at https://discussions.apple.com/message/20107182?ac_cid=tw123456#20107182 that:
    Apple has posted (10/22/12) the approved solution for restoring the Java 6 plug-in:
    Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality.

  • Was asked to install Oracle Java 8 and now after LibreOffice asked for Apple Java 6

    Hello,
    a few weeks ago I was told by a webpage I need java, it was a movie site, so I was doubting it and so I went to the oracle page via google search and found Java 8 (jre 8u40-macosx-x64).
    Today I installed LibreOffice and after first opening ittold me, that I need Java 6 and asked, if I want to search for it. I let it search. There was not the usual browser window -like thing (which I guess is the App-store, where I am offered to upgrade to 10.10 for free and told that there are 4 incompatible updates for iLife products available). Instead it was just a small progress-bar window that had the title "apple software update" (or similar).
    I then quit it, because it was not making progress.
    Now I close LibreOffice and then thought "well lets install Java 6", but this time I was not asked to install it. Also "apple software update" doesn't offer it, when I launch the blue "A"-icon (i.e. Appstore?).
    What do I need? Should I delete Java 8? How do I get Java 6?
    I found this, but it doesn't help me: http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-preferences.html and Apple Java Vs Oracle Java? Do I need both?
    THANKS!!!
    Machine: Mac Mini 2012, 10.9.5

    Thank you! In the meantime I found that item labeled as "2014-001" on the apple.support page.
    It mentions that it will remove all Java web applet and that there was a certain button one has to push to install it. I don't find the button "missing plugin" (well maybe that will come once it is needed?)
    Can Apple J6 and Oracle J8 coexist?
    From the fact that apple's J misses the web applet, I guess they will complement each other right?
    Also, am I right, that, if I go to Safari/Firefox -> Security I can disable Java for web stuff (but it will be still intact for Java applications like LibreOffice) and once I will encounter a webpage that wants Java, I will be told and can activate it in Safari/Firefox -> Security ? (Since I guess it is better to disable Java on the web???)
    Will the web sites always tell me, if they need Java or will pages not work and I will wonder why?

  • Java 1.6 Applet on a mac... Can't get it to work

    Hi all,
    I posted this on another section of the forum, but they suggested this would be a better place. Sorry for a duplicate post.
    I am developing a Java 1.6 Applet, and it works fine on Windows and Linux, but I can't seem to get it to work on a Mac.
    I really have little expierence with Macs. I downloaded the newest mac java 1.6. I installed it. I went to the terminal, and verified that it is using java 1.6 (using the java -version command). But then when I load up safari or firefox, the applet will not load. If I open the java applet console, it tells me that it is using a 1.5 jre. I can't seem to be able to change the applet plugin to point to the 1.6 jre.
    Note, that if I go to a terminal, and I run the applet with the 1.6 appletviewer, it works fine. My only issue is getting it to work in the browser on a mac.
    Any ideas?
    Thanks,
    -Adam

    Same problem. Mac 10.5 Firefox 3
    JavaFX 1.0 was just released. I can't get the JavaFX example applets to run with any kind of worthwhile quality -- I have to downgrade the Whole System to 1.5! Results in very low frames per second on the animation examples, and eventual complete freeze up of Firefox. I guess I'll click the giant orange Install Me button on the javafx.com website & see if that gets me any further.
    Sun should implement their JVM and platform support for Apple computers. Current Java system on Mac is a miserable experience.

  • HT5493 Java update and reverting to 1.6 plug in.

    Good afternoon.
    After installing the java update this week I've realised it makes my Macbook useless for work. I regularly rely on a Corporate Information System at my University to access student records. This system is incompatible with Java 7, upon installing the update it directs me to install the plug in from Oracle (for which only java 7 is available) When trying to access the system it comes up with the following error, "requires jinitiator 1.1.8.2 or higher" Which I assume is a change between Java 6 and 7.
    Spent a long time with the Universities tech support who couldn't help only to confirm that Java 7 is not supported (and even directed me to several .exe windows programs to update jinitiator, as well as to some malware). Apple Tech suport had no solution to the problem either other than to time machine back to before the update.
    I have now used time machine to restore to prior to the update (which took 48 hours for 300GB!!!!!)
    So ideally I would like to install the update (for various reasons, including security) but still have access to University system.
    Can anyone provide any advice how I can do so?
    Alternatively I suppose I will have to avoid this update, but I assume it is forever going to remind me. If that is the case then is there a way to permanently tell my macbook to ignore this update?
    Any help greatfully received?
    Kind regards
    Josh

    So ideally I would like to install the update (for various reasons, including security) but still have access to University system.
    It doesn't sound like you can. If this is a web-based Java applet, there is no Java 6 applet plug-in anymore. Apple has removed it in this update, so you have no choice but to use Java 7 for web applets. If it is not a web applet, rolling back should work fine, but the system may be incompatible with the changes in the latest version of Java 6 as well. If you can't use the latest versions of Java, you will be forced to use a version of Java that is not only vulnerable to attack, but that the hackers of the world have now gotten a road map to (in the form of the update). Just because a vulnerability is patched does not mean that it stops being exploited... many vulnerabilities continue to be exploited for years, due to people who are unable or unwilling to install security updates.
    Honestly, you shouldn't have to be forced to compromise the security of your system to use this software. You need to speak to people at your university at a higher level than just the techs, and explain to them how this system is compromising both university security and the individual security of every person who uses it. Scare them, and they'll light a fire under the techs to get this fixed.

  • Calling a javascript function from java code and getting tha value in Java

    Hi,
    I would like to call a Java script function confirmRemove() from Java code upon meeting a condition..
    for example the code snippet is:
    if(true){
    // I want to call js confirmRemove() over here. And get the value of variable "answer" in this if block.
    <html>
    <head>
    <script type="text/javascript">
    function confirmRemove() {
         var answer = confirm("Are you sure you want to Delete?")
    </script>
    </head>
    <body>
    <form>...

    Hi,
    Back in 2003 I have used an Applet which contain java code and this java code was calling the java scripts ( different methods, DHTML etc..)
    There was a component developed by NetScape called JSObject I am not sure it there is other third party component other then the JSObject
    look at this article which shows how (based on JSObject)
    [http://java.sun.com/products/plugin/1.3/docs/jsobject.html|http://java.sun.com/products/plugin/1.3/docs/jsobject.html]
    Regards,
    Alan Meio
    London,UK

  • Where is the built in Java runtime and development environment in my MAC???

    I keep reading that my macintosh (dual G5 with OSX 10.4.10) came with a fully configured and ready-to-use Java runtime and development environment, however I cannot find, nor do I know how to open it. Doe anyone know how to open this up? thanks so much!

    Your JRE should already be configured so that when you double-click a self-executing jar or open a page with an Applet it will run.
    Your compiler (javac) should be available through your sheel in your terminal application.
    If none of this helps you (and it may well not) you may want to consider installing an IDE. Eclipse for example has a Mac OS version, I am sure there are others but I do not develop on Mac so I can't tell you about them.
    http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/20071103/eclipse-java-europa-fall2-macosx-carbon.tar.gz

  • I look for a "java client IRC applet"

    Hello every body and good hollydays!
    For long time, I looked for a open source java "client irc" applet.
    I have found one, but it does' n run! (it needs to be signed and unfortunatly
    I don't doing it !).
    Briefly i need links about all this subject.
    A great thanks.
    elias

    Search in google by "java client IRC applet" found many different links :-)

Maybe you are looking for

  • Missing day in the calendar

    Has anybody else noticed that Oct 15th appears twice in the calendar, whereas Oct 16th is missing?

  • Automation Plugin in Adobe Bridge

    I've written a contact sheet automation plugin (much the same as Contact Sheet II, but allows more text fields to be included), and I'd like to get it to work from Adobe Bridge. I've included the FileBrowserAware {} in my PiPL resource block, but Bri

  • Problem with Input help inside an adobe interactive forms

    Hi Experts, I'm currently implementing a Webdynpro ABAP application containing a Interactive forms. I'm using Adobe Live Cycle Designer 8.0, Acrobat reader 9.2, Internet Explorer 7.0 My problem is that when I click on the "input help" button inside t

  • IMovie upgrade to 10.6.3 problem

    Has anyone upgraded iMovie version to 10.6.3 and failed then on to get any audio ?? How to fix this please ?? Running on iMac (21.5 inch) Thanks. Jim

  • Error 1935 while installing Photoshop Elements 7 on Vista

    I have tried to install Adobe Premiere Elements 7 on my PC with Vista and it goes through the whole installation process until the end where a screen pops up with: Error 1935 {97F81AF1-OE47-DC99-A01F-C8B3B9A1E18E} HR RESULT 0X800736FD Windows Vista B