B
Ben
Hi, just wondering if anyone knows whats going on here>
- I have a class that creates a drawable JPanel within a JFrame.
- The class then runs a method that reads in a file, line by line and
uses the lines to changes various objects within the class.
- After each line the JPanels repaint method is called.
This works fine. However I created another JFrame, made visible by a
button on the first JFrame. The JFrame captures a file name and calls
the method to read in the file and make the changes, using the captured
file name. However the JFrame just freezes. I thought this maybe had
something to do with threading. So I let the method be called by the
constructor as it was done originally. However I changed this to use
two while loops. The first never end as the second only starts when
the filename is changed from "". This works fine, however the program
is noticably slower at responding to various things.
Is this anything to do with threading? This What is a better solution?
Thanks.
Ben.
- I have a class that creates a drawable JPanel within a JFrame.
- The class then runs a method that reads in a file, line by line and
uses the lines to changes various objects within the class.
- After each line the JPanels repaint method is called.
This works fine. However I created another JFrame, made visible by a
button on the first JFrame. The JFrame captures a file name and calls
the method to read in the file and make the changes, using the captured
file name. However the JFrame just freezes. I thought this maybe had
something to do with threading. So I let the method be called by the
constructor as it was done originally. However I changed this to use
two while loops. The first never end as the second only starts when
the filename is changed from "". This works fine, however the program
is noticably slower at responding to various things.
Is this anything to do with threading? This What is a better solution?
Thanks.
Ben.