Can somebody suggest that whether there is an api in java which can control microcontrollers . I want to come up with a gui which can send a signal to a microcontroller ?
Any ideas i mean even a design idea
Usually not. Most of the time, you will have to make a native library, using a language like C, and then make calls to that library using Java Native Interface (JNI).
Thats really going to depend on how the microcontroller normally communicates, isn't it? There are so many options as the microcontroller architectures have been moving in the direction of network compatibility for some time.