You can’t.
The AWT package is not supported in Android, you need to change your implementation to use the Android classes.
See these similar questions:
Porting AWT graphics code to Android
More Related Contents:
- android studio app running on api level 23 but crashes on 19
- Android: Why doesn’t my Service start?
- How to set margin for ImageView in pixels in android java?
- Attempt to invoke virtual method ‘void android.widget.TextView.setText(java.lang.CharSequence)’ on a null object reference – Bundle putExtra [duplicate]
- How to make a .jar out from an Android Studio project
- Android Studio 3.1.3 Gradle Sync Error. Could Not Download Gradle-Core.jar
- This app is not authorized to use Firebase Authentication.Please verify that the correct package name and SHA-1 are configured in the Firebase Console
- Import Google Play Services library in Android Studio
- UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define
- Android Studio – No JVM Installation found
- Error launching Android Studio: Failed to create JVM: error code-6
- Android Studio error: “Manifest merger failed: Apps targeting Android 12” [duplicate]
- Manifest merger failed error
- Android Studio cannot resolve symbol but code executes correctly
- Error:Execution failed for task ‘:app:processDebugResources’. > java.io.IOException: Could not delete folder “” in android studio
- Android Studio: failed to complete gradle execution, cause is empty
- “Hello world” Android app with as few files as possible, no IDE, and text editor only
- Android studio – Failed to find target android-18
- No resource identifier found for attribute ‘layout_behavior’ in package
- How to write NDEF records to NFC tag?
- How to combine one android studio project into another android studio project
- tools.jar seems to be not in Android Studio classpath on Windows 8
- MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent
- Error:Timeout waiting to lock buildscript class cache for build file when change minSdkVersion
- Android Studio layout editor cannot render custom views
- Exception in thread “main” java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
- Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio
- How to enable ProGuard obfuscation in Android Studio?
- Unity3D and Android Studio Integration
- Error:Could not initialize class com.android.sdklib.repositoryv2.AndroidSdkHandler