If this is a web-based application, that means that the
Java code will run on the server, not the desktop; Swing has to run on the user's desktop.
You could consider using an
applet in your web-based application, though. An applet is Java code that is sent to the browser to be executed. Not all users will have Swing-capable browsers, though, so it's generally something you'd want to avoid.