Ah figured it out, obvious mistake of using an int when I should have used a double.
Ah figured it out, obvious mistake of using an int when I should have used a double.
int wordpercent = ((count/totalwords)*100);
JOptionPane.showMessageDialog(null, "Count: " + count);
JOptionPane.showMessageDialog(null, "Words: " + totalwords);...
I've decided to take a different approach, this one works so far!
[code]public class TextAnalysis {
public static void main(String[] args) throws Exception {
...
Thanks for the suggestion. It looks like it must be at the end of the file, because I can get it to print out whatever number I want before the "while (words.hasNext)" statements. I've figured out...
import java.io.File;
import java.util.Scanner;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
public class TextAnalysis {
public static...