How do I add the javax.swing.* packages to my libs for my android project?

拥有回忆 提交于 2019-12-02 11:21:15

问题


First of all I'd like to mention I am very new to Java programming. This Android project is my first experience with Java. So for one task I need to strip HTML tags from a string. I was thinking about using this answer Remove HTML tags from a String to do this task. In order to do this I need to be able to import javax.swing.text.html.* and javax.swing.text.html.parser.*.

I went to the properties of my project and attempted to add this library to my project. I read that this was included in the rt.jar file which was located at /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar

I was able to use the imports but it seems like it added a million libraries I am not using. Will this negatively effect my application? What is the correct way to add just the one extension?


回答1:


You don't. Android doesn't use Swing. You'll need to use Android's API to create your UI and perform text parsing. Consider android.text.Html as a simple way to strip HTML from a string.



来源:https://stackoverflow.com/questions/4230075/how-do-i-add-the-javax-swing-packages-to-my-libs-for-my-android-project

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