How we can control the web page from java swing frame for eg:i want to load the gmail in java swing frame and set the value for username and password from the Frame.
There probably isn't a good solution, if any. While there are Swing components that can display some subset of modern HTML, advanced sites like Gmail generally are beyond their capabilities. For simpler HTML, check out Swing's HTMLEditorToolkit and the Cobra/Lobo library on SourceForge.