4

我正在使用 netbeans 7.2 并想安装 swingX。我已经安装了 swingX 1.6.2 但它不工作。感谢您。

4

2 回答 2

10

The following steps are from here:

Adding SwingX library to NetBeans:

  1. Open NetBeans, go to menu Tools > Library Manager and click "New Library...";
  2. Type a name (could be "SwingX") and click Ok;
  3. Select the Library that you created and, in the Classpath box (on the right), click "Add JAR/Folder...";
  4. Then go to the folder where you downloaded swingx.jar file, select it and click "Add JAR/Folder" in this window.

Now the SwingX components are already available to you use in NetBeans. But, to use them in a project, do the following steps:

Adding SwingX library to the Project Libraries:

  1. Right click on your project that you want to use the SwingX components and select Properties;
  2. Select "Libraries" in the left box;
  3. Click "Add Library..." and select the library that you created in Adding SwingX library to NetBeans ("SwingX", as I suggested);
  4. Click "Add Library" and then Ok.

Now your project can use the SwingX components, but we already need to set the NetBeans's Palette to show the SwingX components.

Adding the SwingX components to the NetBeans's Palette:

  1. Create (or open) a Java GUI Class Form. The Palette will appear;
  2. Right click on the palette and select "Palette Manager...";
  3. Click "New Category...", type a name (could be "SwingX" again) and click Ok;
  4. Select the category that you created in the box and click "Add from Library...";
  5. Select the library that you created in Add SwingX library to NetBeans ("SwingX", as I suggested) and click "Next >";
  6. On the next screen, click in the box and type Ctrl+A (to select all items) and click "Next >" again;
  7. Finally select the category that you created on the third step of this topic ("SwingX", as I suggested);
  8. Click Finish and then Close.
于 2013-02-04T10:44:23.823 回答
2

由于另一个答案有点过时,这是我在 NetBeans 7.3.1 上遵循的步骤

将 SwingX 库添加到 NetBeans(如果您使用 Maven,则不需要)

1) 转到Tools->Ant Libraries并单击Add JAR/Folder以将 SwingX jar 文件添加到 NetBeans 类路径

使 SwingX 组件在调色板视图中可用

1)使用打开调色板菜单Window->Palette

2)点击该窗口底部的空白区域(您可能需要折叠子窗口)并选择Palette Manager

3) 单击New Category并创建一个 SwingX 文件夹

4 non-maven) 如果您使用 Maven,请单击Add from Library并从上方添加 SwingX jar。

4 maven)如果您使用的是 Maven,请单击Add from JAR并从 maven 类路径中选择 SwingX jar。您可以在以下位置找到下载的 jar mavenHOME_DIR\.m2\repository\org\swinglabs\swingx\1.6.x\

4) 选择所有可用的控件,单击下一步,然后从类别中选择 SwingX,然后单击完成

于 2013-08-28T18:27:58.123 回答