How can I import a library to a Java project in Ne

2019-02-14 19:41发布

I needed a class that could create polygons with Double or Float numbers, instead of int numbers. Well, I found it here, and here is the Jar file download. I extracted the Jar and added it to the libraries in NetBeans; but now, I don't know how to import the package to my project. If I type "import org.apache.batik.ext.awt.geom;", it says that the package does not exist. How can I import that package to my project? Thanks!

2条回答
看我几分像从前
2楼-- · 2019-02-14 20:22

It's not enough to define the library in Netbeans. You need to add the library to your project. Then your import will work.

查看更多
Bombasti
3楼-- · 2019-02-14 20:30

It's very easy.. you just expand the project tree in netbeans and right click to Libraries folder which is in the project.. and select the Add Jar/Folder option and choose your downloaded jar file.. nad click to open.. after that you can able to import these libraries..

prreview

查看更多
登录 后发表回答