Use final local instead of member variable, add instanceof for JDialog.
Merge pull request #995 from karlmortensen/useFinal

Use final local instead of member variable, add instanceof for JDialog.