Filereader only reads when launched from terminal

My program consists of a JDialog which is launched from a JApplet. Part of my code requires that an input string be checked against a "dictionary" to see if it is a valid word. The dictionary consists of several word lists, organized by length, in a folder called "Data."
Here is the relevant code:
     public boolean checkDictionary (String word) {
          boolean acceptable = false;
          try {
               BufferedReader reader = new BufferedReader(new FileReader("Data/"+word.length()+"lw.txt"));
               String stringRead = reader.readLine();
               while(stringRead != null) {
                    stringRead = reader.readLine();  // read next line
                    if (stringRead.equals(word)) {
                         acceptable = true;
                         reader.close();
               reader.close();
          catch (Exception ex) {
          return acceptable;
     } When I run the program from the terminal (either by typing "java Anagrams" or "firefox Launcher.html"), everything works fine, but if I run it by double-clicking the Launcher.html icon, it fails to read the data files. Everything else in the program works normally, and it doesn't make any difference whether I use a web browser, or appletviewer. Unfortunately, I can't tell what exception is thrown, because the output isn't sent to a terminal.
Any ideas?

It doesn't answer you question but the logic of that method is incorrect: it never checks the first String in the file and it always reads all the words no matter whether or not the word was found already. Make that:
     public boolean checkDictionary (String word) {
          boolean acceptable = false;
          try {
               BufferedReader reader = new BufferedReader(new FileReader("Data/"+word.length()+"lw.txt"));
               String stringRead = reader.readLine();
               for (String stringRead= reader.readLine(); stringRead != null; stringRead= reader.readLine()) {
                    if (stringRead.equals(word)) {
                         acceptable = true;
                         break;
                 reader.close();
            catch (Exception ex) {
          return acceptable;
     } kind regards,
Jos

Similar Messages

  • DNG files will not open in photoshop when launched from lightroom

    This just started, I can't open DNG files in photoshop when launching from within lightroom.  Not sure how to fix this.  the dng files launch fine from bridge.

    As for your issue with DNGs in CS, did you bother to update ACR to version 2.4?
    See the detailed instructions on the download page.
    >What I need to know is whether or not my PS CS will work with files converted by Adobe DNG.
    Of course ACR will, if you correctly install Adobe Camera Raw 2.4.
    No version of Photoshop opens raw or DNG files, only ACR does, hosted by Photoshop. But you do need at least version 2.4 of ACR, which was the first to support DNGs.

  • Using fonts when launching from JNLP

    Hello,
    I followed the directions in this link http://fxexperience.com/2010/05/how-to-embed-fonts/ and was able to add and use fonts in my javafx program when launched from Netbeans. But when I try to launch from JNLP, the fonts do not show up (the text shows up as Arial).
    Is there something special I need to do to access the fonts in the jar and utilize them?
    As the link directed I created a fonts folder in my src folder where I store all the .ttf file, and created a fonts.mf file in META-INF where I map a name to the font file. Works fine when launching from netbeans.
    thanks in advance for your help
    jose

    I've found the problem! It's the timestamp for the JNLP file. But unfortunately I can't figure out the workaround as yet.
    To explain the problem it would be best to start with my application's installation procedure:
    The applcation is installed by way of CD (using javaws -import) as downloading an 8mb jar file over dialup is unwieldy. Subsequent updates are retrieved from the server. Jardiffs are sent back to the webstart client so updates over dialup becomes manageble.
    The application jar file in the CD is version 1.0. Let's say the server is now at version 1.3 with the timestamp 2005-10-01 00:00:00.
    The user installs the application using the CD today which gives his JNLP file the timestamp of 2005-10-03 00:00:00.
    When the application is started, it calls the server to check for updates. Although the JNLP file returned from the server specifically states that the current version is at version 1.3 Java Web Start insists on using the timestamp to perform the comparison first.
    Since the timestamp of the JNLP file in the user's pc is dated later than the JNLP file in the server, Java Web Start ignores the version checking and assumes that the application in the server is the latest and greatest.
    Has anyone encountered a similiar situation? The only solution I can think of is to hack the JNLPDownloadServlet to return a date that's way in the future so that Java Web Start picks up the changes... sigh.
    Is it possible to disable the timestamp checking for the JNLP files? As again, help is mucho appreciated and there are 10 duke dollars at stake too :)

  • [SOLVED] GTK2 apps have wrong theme when launched from desktop entry.

    So I'm setting up KDE and I want to use the QtCurve theme for all applications where possible. I have set (via kde-gtk-config) the GTK2 theme to QtCurve and it half works. GTK2 applications are using the QtCurve theme when they are launched via a command, but they are using what appears to be an ugly version of the Oxygen theme when launched from a .desktop file. I previously installed gtk-qt-engine from the AUR, but have since removed it along with it's files, and as I was using the Oxygen theme at the time, this appears to be what has caused the issue. Does anyone know what is causing this and how to fix it?
    EDIT: Solved by removing ~/.themes folder (obviously only remove the KDE-QT theme if there are other themes in the folder).
    Last edited by RibShark (2013-09-23 17:26:41)

    Thanks, but lxappearance made things rather worse.
    A friend of mine had told me to put "gtk-toolbar-style=GTK_TOOLBAR_ICONS" into settings.ini and my problem is solved now.

  • Browser size when launched from Forms Builder

    Hi, Does anyone know how to set the size of the IE browser when launched from Forms Builder? I have set the width and height setting to 100% so that the applet takes up all the browser space, however the browser is still not as large as I'd like.
    When I start IE on its own, it opens in the desired size, it's only when running it from Forms Builder that it's too small. I've searched on the net, but nothing seems to work, there must be a setting specific to Forms?
    Thanks
    Sam

    If you are using SeparateFrame = True, then you might try using these in your When-New-Form-Instance trigger:
    set_window_property(forms_mdi_window, window_state, maximize);
    set_window_property('Your_Main_Window', window_state, maximize);
    If you are not using SeparateFrame = True, then you may have to use JavaScript in the page where your applet is located. Javascript can also go in your formsweb.cfg file. See:
    HTMLbeforeForm=<script>....</script>
    or
    HTMLafterForm=<script>....</script>

  • How To Set Third Party Media App Is Default When Launched From Default File Manager

    I use rock media player, which can encode & decode The Video and audio files i use, unlike the phone i have, i don't receive the option to set the app as the default media player. I would really like to be able to use this app on the thrive as it is some much a better media player than the thrives defaulty app. Rock player is the name of the app, who do set it as the default player when launched from the default file manager.

    From my experience playing with the Thrive, when you attempt to watch a media file, it will open a menu asking you what application to use. From that popup, you can set a default.
    - Peter

  • Developer Server 6.0 hanging when launched from Netscape 4.6

    Hi, simple question to ask about OAS and Developer Server.
    My Developer Server 6.0 hanging when launched from Netscape 4.61,
    I am currently running...
    Pentium PII 200Mz running NT sp5
    Forms Server version 6.0.5.31.0 (Patch 3 applied)
    OAS version 4.0.7.1.0 (Patch applied)
    Jinitiator 1.1.7.18
    Netscape 4.61 browser
    I have all the latest versions of everything that is available,
    I have followed the instructions.
    I successfully connect to the OAS admin utility and have setup
    all the virtual to physical directory mappings under the default
    listener www. I successfully start all website OAS services.
    I have Forms server successfully started up as a process
    listening on port 9000.
    I have two statics html files created:
    a) with Jinititator 1.1.7.18
    The very first time I connected to this static html file it
    installed Jinitiator as expected. The Forms server splashscreen
    then appears.
    Jinitiator then starts up successfully, no errors appear in the
    Java console. This has proved I am talking to the listener and
    my virtual directory mappings are working.
    At this point there is a lot of disk activity and then all
    stops, the splashscreen remains and appears in the discussion
    area:
    FRM-9999 cannot access "koala.ilaco.gov.bo:9000" and
    a series of java exceptions
    I am pointing to the correct java directories (I think)
    b) with out Jinitiator
    When I try to call using URL with Netscape 4.61 I get a
    message on the status bar saying...
    Applet oracle.forms.engine.Main class oracle/forms/engine/Main
    got a security violation: Method verification error
    Can you help ?
    If you know the answer, please let me know as soon as
    posible.
    Thanks for the answer....
    Rgds,
    Polo
    null

    Bart LEBOEUF (guest) wrote:
    : Hi,
    : I've the same problem during this week. I've resolve the
    : problem by replace DLL's
    : in %ORACLE_HOME%\bin by the ifwcm60.dll from Developer CD-Rom
    : (\extras\sp4\ifwcm60.dll) and vgs60.dll
    (\extras\vgs\vgs60.dll).
    : At first time, it doesn't work. I remove my environnement
    : variables
    : FORMS60_MAPPING and FORMS60_TIMEOUT from my System Control in
    the
    : Config panel, then I reboot and surprise, it works !!!
    : (Look also in database registry of Windows with regedit
    utility
    : in
    : [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE] and remove the two
    : variables if you found them.)
    : I try on my two servers and it worked now perfectly.
    : : Bart.
    I respond your email, with my actual server configuration my
    problem is now: I get the splash screen and after form is hanged.
    My server configuration is:
    Compaq PC, with Pentium II, the software is:
    - Windows NT, with Service Pack 5
    - Oracle Application Server, v.4.0.7.1.0 Enterprice Edition,
    pathset 1
    - Developer Server v.6 patchset 3
    - My browser in this machine is Netscape 4.61
    - Jinitiator 1.1.7.18 is also used.
    My developer server is installed and running on the same machine
    that OAS is. I am using other browser in other machine (IE5)
    and trying to connect to the OAS on the first machine.
    My problems begin when I launch ifsrv60.exe. I copied
    ifwcm60.dll v.6.0.5.0.2, and other files required in the %
    ORACLE_HOME%\bin
    I forced listener Developer Server Port (
    c:\orant\bin\ifsrv60.exe -listen port=9000 )
    Now, I can connect with this process, with the following line:
    telnet koala 9000. The listener is working now.
    I tried to work with my (NonCartride-static html)forms60 form on
    WEB without Jinitiator, but I couldn't.
    With Netscape, in the status bar: Applet
    oracle.forms.engine.Main can3t stop ERROR
    With IE5, I get the splash screen and after the forms is hanged.
    If I use Jinitiator:
    With Netscape, in the status bar: Oracle Jinitiato: applet
    oracle.forms.engine.Main inited then form is hanged.
    With IE5, I get the splash screen and after that, the screen
    freezes and looks like the form is hanged.
    Any further suggestions on this?
    Polo
    null

  • No color toolbar icons from standard launch, ok when launched from another app.

    When launched from another app like google earth the toolbar icons are in color.
    When launched normally the icons have no colors.
    Currently Thunderbird 24.6.0

    another experiment.
    When you have the colour icons, Select Help menu > about (what version is this) when you have the black do the same and see if it is different versions. (pressing F10 will make them menu bar visible if it is not.)
    Thunderbirds icons changes from living colour to black and white quite a few versions ago.
    Reasons for color are;
    * An old version
    * An add-on by way of a Theme
    * The running of Thunderbird in XP compatibility mode in Windows

  • Reader 9.0 - runtime error when launching from pdf

    Reader 9.0 does not like to launch from an associated pdf. It will occasionally open but 98% of the time it returns a Visual C++ Runtime Library error: "This application has requested the Runtime to terminate in an unusual way. Please contact the Application's support team for more information"
    If you open Reader 9.0 directly and drag a pdf into it, there is no problem. Everything works the way it is supposed to. It is only an associated launch that causes the problem. No other apps are experiencing launch problems on this comuter.
    System is running XP-SP3. System resources are not being taxed. Of course I have already tried uninstalling, reinstalling, rebooting.

    Yup, same here, OS and all.
    BUT, I can't even get Reader 9.0 directly without that error!
    When will I learn to stop trusting major X.0 releases from ANY software company?
    As always, I have a 8.1.2 full install saved and reverting back to it for now.
    BTW, Adobe initially looks like they will let you download 8.1.2, but then they switch you back up to 9.0. Gotta watch 'em.

  • Powershell unzip with shell.application not working when launched from windows service

    I have a deployment agent on a machine implemented as a windows service. Service is 32-bit and runs on windows server 2008R2 x64 SP1 with powershell V2. Powershell script requires elevation and to run under x64 because of dependency to powershell module
    'IIS Administration'. To achieve this, the service starts a cmd file which in turn launches powershell x64 console:
    C:\WINDOWS\sysnative\WindowsPowerShell\v1.0\powershell.exe "Start-Process C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell -ArgumentList '-ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File C:\Temp\EndJobCmd\Install.ps1' -Verb RunAs"
    This seems to work well. The problem I have is that the script has a sequence where it unpacks a zip file to a destination folder using shell.application, this works fine when triggered manually on the server or through the task scheduler, but when triggered
    from the service it does not extract any files at all (cannot see any errors thrown by the script but it seems to continue to execute as it logs a successful message to the event log after finishing).
    Unzip sequence looks like:
    $shell = New-Object -com shell.application
    $pkg = $shell.namespace($sourceFile)
    $installDir = $shell.namespace($targetDir)
    $installDir.Copyhere($pkg.items(), 20)
    Any advice greatly appreciated. I have searched some and seen a few people with similar issue but have yet to find a solution.

    If it's still actual, I managed to fix this with having CopyHere params equal 1564. 
    So in my case extract zip function looks like:
    function Expand-ZIPFile{
    param(
    $file, $destination
    $shell = new-object -com shell.application
    $zip = $shell.NameSpace($file)
    foreach($item in $zip.items())
    $shell.Namespace($destination).copyhere($item,1564)
    "$($item.path) extracted"
    1564 description can be found here - http://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx:
    (4) Do not display a progress dialog box.
    (8) Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
    (16) Respond with "Yes to All" for any dialog box that is displayed.
    (512) Do not confirm the creation of a new directory if the operation requires one to be created.
    (1024) Do not display a user interface if an error occurs.

  • Scim makes leafpad take a while to load, except when run from terminal

    Leafpad normally loads up in an instant. But with scim running (More specifically with the required environment variables exported. Scim simply running without the environment variables does not cause the problem, but then scim does not work.), although it shows up immediately, the scrollbar, menubar etc are greyed out for a few seconds and the program cannot be used until it is fully loaded.
    I'm sure this is specifically a leafpad problem, because there is no noticable lag in other programs. (Mousepad for example is fine.) However, the fact that it loads immediately when run from a terminal scares me. Why doesn't gmrun (and the fvwm menu) work just like a terminal? Is there a possible fix to this problem?

    droog wrote:
    I'm not having this problem as far as i can see, I use fvwm and scim already so installed leafpad to test and it starts instantly from fvwm's menu or terminal.
    from gmrun leafpad starts instantly too so maybe i'm missing something.
    what are you exporting?
    Just the normal:
    export XMODIFIERS=@im=SCIM
    export GTK_IM_MODULE="scim"
    export QT_IM_MODULE="scim"

  • Pass Parameters to an external appl when launched from web dynpro ABAP .

    I want to Pass Paramaters to an external application when launced from Web dynpro ABAP . I have successfully launched an .exe file ( Notepad / eViewHSEditor ) from Web dynpro using the logic from Standard WD_TEST_APPL_ACFEXECUTE component  But I am unable to Pass paramters to the .exe file .
    example :-  I would like to pass parameters  text1 text2 in the arugement list and I expect it opens an untitled notepad and in the file it will have parameters text1 text2 . But it is behaving in a different way . Below are the detailed steps of what I have done .
    The steps that I followed :-
    1)  Right now I have created the white list Configuration for Notepad.exe
    2) I have created 1 and 2 postions both of type string and permission Legal .
    3) The Paramter Value is * for both 1 and 2 .
    4) I activated the whitelist and it generated an .XML file
    5)
              application = 'C:
    WINDOWS
    system32
    notepad.exe'.
              argument = 'text1 text2' .
              co_element :- I am reading the element from the conrtext .
          co_element = wd_context->get_lead_selection( ).
          co_element_stru-attribute_name = 'ERROR'.
          co_element_stru-element = co_element.
          wd_this->acf_method_handler->if_wd_acfexecute~execute( application =  application
                                                                 argumentlist = argument
                                                                 errorinformation = co_element_stru ).
    when i execute  the application , it is trying to launch a notepad with file  'text1  text2.txt'  and it doesn't have one , it is asking do you want to create .  If You yes, it will open notepad with name 'text1 text2.txt' . If you Pass abcd in the arugement list , if the file with name abcd.txt exists , it opens the notepad with that file name .

    You try to open notepad from your PC with the same command, you will the same result.
    start->run->notepad "test1 test2". You get the popup saying that "test1 test2" file is not existing. You can google it to find a way to pass the text while opening notepad and try to fit that in your WebDynpro argument. I doubt if it is possible though.

  • Vmware Horizon 3.3.0 - slow when launched from a VM (WS2008 R2) - any solutions ?

    Hi guys,
    We have a VMware Horizon setup that works quite well when accessed from our laptops.
    However, for a number of reasons we also need this environment accessed from a Windows Server 2008 R2 machine that resides as a VM on a hypervisor.
    But the problem is it is very very slow when launched like this (you can feel the mouse cursor lagging or whenever you open a window on the published Vmware View machine). I will point out that the connection to the client VM (WS2008R2) is done through RDP.
    The questions I have since I've not been able to find out so far are:
    1)     Is WS2008R2 x86-64 supported as a client ? Does installation of a VMware Horizon Client on it differ in any way than on a Windows 7 machine ?
    2)     Is the fact that it is virtualized the root cause of the slowness ? If yes, why is that and can I do something to fix it ?
    Thank you very much , I really appreciate your help.
    Jay.

    Ok, solved it myself
    It seems in the "Control Panel > Mouse Options > Pointers > Scheme" the "Windows Aero - System Scheme" was selected. The second I set that to None, the mouse cursor started behaving and it's moving normally.
    Jay.

  • Audio only plays when started from the beginning?

         Hi! I'm fairly new to flash, i'd consider myself a beginner, but recently i've been tasked with making an animation for someone! There is a song playing in the animation, it's a wav and it's on its own layer. There are also drawings i imported in too.
         My problem is, i want to be able to sync up the little drawings to the words of the song, but the audio only plays when i start at 0 on the timeline. If i were to start at let's say frame 24, it won't play. Does anyone know how to fix this? This commission needs to be finished by Wednesday and it's a S L O W process, having to start it over only to hear like one or two words later on

    change the sync property (in the properties panel after clicking the keyframe where your sound starts) from event to stream.  retest.

  • App aliases beep when launched from Dock

    Recently, my rMBP has started beeping (System Alert) when I launch apps that are aliases from the Dock.  If I just put the app in the Dock, no alert when launching it.  But if I make an alias of an app (say, for a collection of apps, like the Adobe Suite, or Internet related apps) in a folder, and drag the folder to the Dock so that I can launch any of the apps in that collection, the app will launch, but I get the beep/System Alert.  For the life of me I can't figure out why, and it only recently started doing this in the last month or so...was fine before.  I can't figure out why, and haven't had any luck Googling the issue.  Has anyone had this happen to them before, or have an idea what could be causing it?

    From my experience playing with the Thrive, when you attempt to watch a media file, it will open a menu asking you what application to use. From that popup, you can set a default.
    - Peter

Maybe you are looking for

  • APEX 3.1.2 Interactive Report bug

    When you click on a column header of an Interactive Report, a dropdown menu appears which contains a text field that filters the list that is shown beneath it. When you TYPE some text into the field in Internet Explorer 7 and then select a value from

  • ITunes and iPhone won't sync. PLEASE HELP

    Hello. So I have this problem. I have the iPhone 5 and it is fully upgraded in all ways. I used to have a MacBook Pro, also all updated with the new iTunes too, where all my music was syncronized. It broke, and I got a new one. We tried to export all

  • I am in Florida with my iPad, find my iPad says I am in Chile. What is the problem?

    Find my iPad says my location is Chile. I am currently using it here in Florida. My friends also say my location is Chile. Any solutions?

  • Sales are not defined

    Dear Friends I am using ECC 6.0 IDES try to create my own enterprise structure by copying std 1000 after completion of define and assigned checked in EC01 which is showing all assignment of enterprise structur but when I am creating Material MM01    

  • Mail Configuration in Split DNS Setup

    I am a new Snow Leopard Server admin. Was wondering about proper configuration for Mail Service in a split DNS set up. Thanks in advance for your assistance! Here are the basic configuration details (with questions to follow): Server's fully qualifie