I'm trying to resolve some problem and I found old solution: Gradle build null console object
the problem is, the solution includes importing something in the gradle.
How to import for eg: import javax.swing.JOptionPanel
?
I have never imported anything in the build.gradle
and I can't find examples with it.
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.
Find the dependencies section towards the bottom of the file: you will note there are other libraries already imported for you.
implementation group: 'com.example.android', name: 'app-magic', version: '12.3'
Here are links that you may find useful
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.