public void setFile(File fileIn) {
        if(fileIn == null || !fileIn.exists()) {
			clearSelection();
			return;
		}
		cancelButton.setEnabled(true);
		file = fileIn;
        int i = file.getName().lastIndexOf('.');
        String ext = "file";
        if(i >= 0) {
            ext = file.getName().substring(i+1);
        }
        if(!ext.equals(allowedType)) {
            status.setText("File is not of type " + allowedType);
            status.setForeground(Color.RED);
        } else {
            status.setText(getSizeName(file.length()) + " " + ext);
            if (maxKilobytes != -1 && file.length() / 1024 > maxKilobytes) {
                status.setText(status.getText() + " is larger than " + maxKilobytes + " kb");
                status.setForeground(Color.RED);
            } else {
                status.setForeground(Color.BLACK);
            }
        }
        notifyChanged();
    }