如何从另一个Netbeans项目中的一个NetBeans项目中引用类? [英] How to reference classes from one NetBeans project in another Netbeans project?

查看:249
本文介绍了如何从另一个Netbeans项目中的一个NetBeans项目中引用类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为简单起见,我有两个项目,project1和project2. Project1中有包my.proj1,其中包含类myclass.

I have two projects, project1 and project2 for simplicity's matter. Project1 has package my.proj1 in it, that contains class myclass.

在project2的一个类中创建对象my.proj1.myClass的正确操作顺序是什么?

What is the correct sequence of actions to take for creating object my.proj1.myClass in one of the classes of project2?

我尝试添加project1作为参考,但是由于某些原因,不允许我从my.proj1包装中导入类.

I've tried adding project1 as reference, but for some reason that doesn't allow me to import classes from my.proj1 pakage.

推荐答案

单击当前项目,依次转到属性",库",然后应看到其中一个选项为添加项目". (我实际上并未尝试查看它是否有效.)

Click on your current project, go to Properties, then Libraries, and then you should see one of the options as "Add Project". (I haven't actually tried to see if it works.)

这篇关于如何从另一个Netbeans项目中的一个NetBeans项目中引用类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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