Learner
Learner

Reputation: 161

Miglayout: Unable to use it with JPanel

JPanel panel = new JPanel();
panel.setLayout(new MigLayout());

This is my code. I am getting the compiler error

The type org.eclipse.swt.widgets.Layout cannot be resolved. It is indirectly referenced from required .class files and The method setLayout(LayoutManager) in the type Container is not applicable for the arguments (MigLayout)

I have configured the Miglayout.jar in my build path. I can see it under -preferences>javabuildpath>libraries

can anyone help me with this.

Upvotes: 3

Views: 1521

Answers (1)

trashgod
trashgod

Reputation: 205795

For Swing, you probably want to import net.miginfocom.swing.MigLayout, rather than net.miginfocom.swt.MigLayout.

Upvotes: 10

Related Questions