What I am trying to do is read from a file to an ArrayList and then display it using a JOptionPane. The only problem is the code i am having trouble with is in an ActionListener and I believe somehow I have created an infinite while loop because when I click the button the ActionListener is attached to, noting happens.
The .txt file I am trying to read from:
My judgement here is that there was no infinite loop at all. When you are running a GUI based program you don't get to see any exceptions thrown by the JVM. Now, when your index counter was reaching 'size' then the JVM would have been throwing an exception which since your program being a GUI program you wouldn't have had an oppurtunity to see. This happens becuase the exception is thrown to the standard output stream which is typically the console. Since the program halted at that instruction the instruction
never got executed and hence you never got to see the JOption Pane which led you to believe that since there was no output, there must have been an infinite loop somewhere.
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.