Finally implementing swing based gui functions