I'm optimizing a java program and one of the aspects I would really like to integrate into my program is an message box which prompts the user to input the name of an excel file the program writes. I've been using the JOptionPane to easily construct my message box but I'm unsure of how to return this string and then assign this as the name to the created .xls file. I've been playing around with BufferedReader and readLine() but I was just wondering if I'm on the right track or if I should be going at this another way?