简体   繁体   中英

Cannot import javax.swing classes (in Android-studio project)

I'm using Android studio. I was trying to import javax.swing.*; for login page so I tried to write sentence to import which is import javax.swing.*;.

But nothing happen and the sentence to import despair.

Could you please teach me how to fix this problem?

您正在尝试访问不属于android SDK 的 java swing 类。

It's an Android app! Why do you want to use things in the Swing framework? It doesn't make sense!

If you want to show a JDialog , try creating an AlertDialog . If you want the really convenient javax.swing.Timer , try this class I wrote. Most Swing components have android counterparts!

There is no point in using Swing in an android app, because android doesn't support anything in Swing.

You are trying to import Swing framework into Android SDK and it can't work. Android doesn't use Swing.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM