I was wondering something.
I have a subclass thas has:
public void OpenReadFileOne() { // Open JFileChooser. chooser1.showOpenDialog(null); // Give the user a notification that the program is busy ready file1 in. label1.setText(" Reading in a file, plz wait."); label1.setForeground(Color.MAGENTA); // Get the selected file. java.io.File file1 = chooser1.getSelectedFile(); // Create a FileInputStream. FileInputStream fileInput1 = null; //Get the name of the selected file, and print it on the GUI screen. fileName1= file1.getName(); // Create a FileInputStream that will be used to read excel files. try {
Now I have a try catch inserted in there too.
As you can see where the try { starts.
Now the plan is to get the text " Reading in a file, plz wait." printed on the GUI.
And then the program is busy with reading in file1 and processing it.
And last he prints out: "File selected: "
finally { // Show the user the name of the selected file that was loaded in. label1.setText(" File selected: " + fileName1); label1.setForeground(Color.BLUE); }
But it doesn't print the " Reading in a file, plz wait." on the GUI.
But it does print the " File selected: ".
So I am thinking he is running the try first before he puts something on the GUI screen.
While that is not suppose to be happening...
Does anybody maybe know why?
Becasue I did put the text " Reading in a file, plz wait." above the try {