Results 1 to 6 of 6
  1. #1
    kopros is offline Member
    Join Date
    Dec 2007
    Posts
    5
    Rep Power
    0

    Default GUI get stuck while reading a file

    Hi,
    I am having a problem with a program that is parsing a big file. The problem is that while parsing the big file the program's interface get stuck and I cannot use it until the end of reading the file..

    any ideas?? thnx

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    kopros is offline Member
    Join Date
    Dec 2007
    Posts
    5
    Rep Power
    0

    Default

    I tried this , but I get many errors
    example
    code:

    new Thread() {
    public void run() {
    parseDatasetFile();
    solveDataset(getFileName(selectedIndex),time);
    } }.start();

    error:
    local variable selectedIndex is accessed from within inner class needs to be declared final at line 310

    When I set the selectedInex final I get other errors.. any solution??

  4. #4
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    Read file in blocks in reader thread, passing data to parse data file and solve data set is advanced and may suggest longer studies to get program to run correctly. Examine stack, list and set datatypes: Perhaps passing new List( data ) to parseDatasetFile(); and solveDataset(getFileName(selectedIndex),time); .... passing an actual system file is slower, also it is design issue if Dataset has to be finished in definite order.

    GUI can be designed to show progress.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Seems you have to learn about inner class too. What is the selectedIndex and where it's initialized. What error message you get when it's declared as final.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

Similar Threads

  1. Help reading file
    By fritz1474 in forum New To Java
    Replies: 4
    Last Post: 09-17-2008, 03:28 AM
  2. reading csv file help
    By fritz1474 in forum New To Java
    Replies: 5
    Last Post: 09-04-2008, 08:41 PM
  3. Right use of file reading ?
    By jurka in forum New To Java
    Replies: 3
    Last Post: 08-27-2008, 08:16 PM
  4. Reading a file
    By mew in forum New To Java
    Replies: 2
    Last Post: 12-30-2007, 12:23 PM
  5. Reading from a file
    By leebee in forum New To Java
    Replies: 1
    Last Post: 07-23-2007, 12:02 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
  •