简体   繁体   English

如何将 MigLayout 导入 Java Swing 项目?

[英]How do you import MigLayout into a Java Swing project?

I have a projet for my classes and I want to improve it a bit by using the external library MigLayout .我的课程有一个项目,我想通过使用外部库MigLayout 对其进行一些改进。

So I downloaded the jar file and imported it to my project's classpath.所以我下载了 jar 文件并将其导入到我的项目的类路径中。

I tried this to import the class but I don't think it's the right way to go:/:我试过这个来导入 class 但我认为这不是 go:/: 的正确方法

package views;

import com.miglayout.MigLayout;  // <----

import javax.swing.JFrame;

public class HomeView extends JFrame {

    ...

}

VS Code and Eclipse output: The package com is not accessible VS 代码和 Eclipse output:package Z4D236D9A2D102C5FE6ADZ1C5 不可访问

Thanks in advance for your responses:)提前感谢您的回复:)

According to the API documentation , the correct class to import is:根据API 文档,要导入的正确 class 是:

import net.miginfocom.swing.MigLayout;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM