Why are you posting a question about java, swing, and awt on a Qt forum? You should find a forum that is more relevant. "General Programming" does not mean any programming question. It still must be relevant to Qt.

Your errors indicate you have not imported the files that contain the classes that the errors point to. It is also possible that your java installation does not contain the components you need and should be updated. Probably if you Google for the name of one of these classes, you will find out which imports are needed.