Java包不进口 [英] Java packages not importing

查看:106
本文介绍了Java包不进口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要导入一堆Java相关的API的到我的Andr​​oid项目,但是当我导入它说,它无法找到包

I am trying to import a bunch of java related API's into my android project but when I import them it says it cannot find the package

这里是我的尝试导入一个例子

here is an example of what I an trying to import

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

所有的的javax.swing 类显示错误。当我进入安装了JAVA JDK的地方,看看我看到那里所有这些类的 src.zip 文件,所以我该怎么办,让他们的工作?

all the javax.swing classes show an error. When I go into where the java JDK was installed and look at the src.zip file I see all those classes in there so what do I do to get them to work?

推荐答案

下面是我发现了interwebs快速搜索后:

Here's what I found after a quick search on the interwebs:

摇摆

<一个href=\"http://stackoverflow.com/questions/4230075/how-do-i-add-the-javax-swing-packages-to-my-libs-for-my-android-project\">How我添加的javax.swing。*包到我的库为我的Andr​​oid项目?

联会:你不能在你的Andr​​oid项目中使用摆动

Synapsis: You can't use swing in your android project

AWT

使用AWT采用Android

联会:不能直接使用AWT库,但你可以使自己实现它,或者使用一个链接到的这里

Synapsis: You can't use the awt library directly, but you can make your own implementation of it, or use the one linked to here.

这篇关于Java包不进口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆