How to use MiG layout with Eclipse?

I was Google and checked the stack overflow, and nothing helped ... I hope someone can.

Usually I just write my code manually, but I'm working on a Java project with a GUI, and I like what MiG Layout has to offer, so I want to use it. I downloaded the .jar file from the website, but I cannot access it from my project.

I am using Eclipse now as my IDE for this project, because I do not want to deal with this particular thing manually. I am new to Eclipse, but here is what I tried: import the .jar file (using the Import tool for the project), add the following code to my files:

import net.miginfocom.swing.MigLayout; import javax.swing.*; 

According to this page , this should work, right?

But when I try to run the program, this message meets me:

 Exception in thread "main" java.lang.Error: Unresolved compilation problem: MigLayout cannot be resolved to a type 

What am I doing wrong?

+4
source share
1 answer

It seems that the "import tool" part is not working properly - Eclipse does not actually use the jar file.

I suggest you right-click on the project, select "Properties" and go to the "Build Path" page. Check out the Libraries tab. Assuming the jar file is missing, add it and everything should be fine.

+7
source

All Articles