问题
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