我如何添加的javax.swing。*包到我的库为我的Andr​​oid项目?我的、项目、swing、javax

2023-09-03 21:07:23 作者:吹过你身边的风是甜的

首先,我想提一提我是很新的Java编程。这个Android项目是我与Java的第一次经历。因此,对于一个任务,我需要从字符串中剥离HTML标签。我想使用这个答案从Java字符串中删除HTML 来做到这一点任务。为了做到这一点,我需要能够导入的javax.swing.text.html。*和javax.swing.text.html.parser中。*。

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 Removing HTML from a Java 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.*.

我去了我的项目的性质,并尝试这个库添加到我的项目。我看,这是包含在其中位于/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar的rt.jar的文件

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?

推荐答案

您不知道。 Android不使用Swing。你需要使用Android的API来创建你的UI和执行文本分析。考虑 android.text.Html 作为一个简单的方法来从字符串剥离HTML。

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.