I can't import Javax.swing

青春壹個敷衍的年華 提交于 2020-01-07 08:08:06

问题


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?


回答1:


You are trying to access java swing class which is not a part of android SDK.




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/39740238/i-cant-import-javax-swing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!