Swing (and JavaFX) are used for Java Desktop applications.
So you can't use Java Swing on Android because Java Swing is not supported on Android. Android System has its own UI API framework already inbuilt and doesn't use Swing Library at all.
That said to import a Library into gradle you can follow these steps.
In Android View, open build.gradle file (module app)

Find the dependencies section towards the bottom of the file: you will note there are other libraries already imported for you.

- Add the library you need by following this format
implementation group: 'com.example.android', name: 'app-magic', version: '12.3'
- You can use Google to find the Library group, name and version:
Here are links that you may find useful
Add build dependencies
Maven Repository
Google's Maven Repository