简体   繁体   English

无法导入 javax.swing 类(在 Android-studio 项目中)

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

I'm using Android studio.我正在使用 Android 工作室。 I was trying to import javax.swing.*;我试图import javax.swing.*; for login page so I tried to write sentence to import which is import javax.swing.*;.对于登录页面,所以我尝试写句子导入,即 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!这是一个Android应用程序! Why do you want to use things in the Swing framework?为什么要使用 Swing 框架中的东西? It doesn't make sense!这没有意义!

If you want to show a JDialog , try creating an AlertDialog .如果要显示JDialog ,请尝试创建AlertDialog If you want the really convenient javax.swing.Timer , try this class I wrote.如果你想要真正方便的javax.swing.Timer ,试试我写的这个 Most Swing components have android counterparts!大多数 Swing 组件都有 android 对应组件!

There is no point in using Swing in an android app, because android doesn't support anything in Swing.在 android 应用程序中使用 Swing 毫无意义,因为 android 不支持 Swing 中的任何内容。

You are trying to import Swing framework into Android SDK and it can't work.您正在尝试将 Swing 框架导入Android SDK ,但它无法工作。 Android doesn't use Swing. Android 不使用 Swing。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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