I have one JTextfield for getting the database name to be created and JButton for performing database creation action in my swing form. The problem is
JTextfield
JButton
Before create database just use:
create database
DROP DATABASE IF EXISTS db_name;
and don't bother checking whether it exists or not. Check MySQL DROP DATABASE Syntax.