Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot use MigLayout in Eclipse, but it works in Groovy Console
    primarykey
    data
    text
    <p>I am using Windows 7, Eclipse 4.2.1 and (trying to use) MigLayout 4.0.</p> <p>I have downloaded miglayout-4.0-swing.jar, added it to my classpath and succesfully run the following script in Groovy Console:</p> <pre><code>import groovy.swing.SwingBuilder import groovy.swing.factory.LayoutFactory import javax.swing.WindowConstants as WC import net.miginfocom.swing.MigLayout def swing = new SwingBuilder() swing.registerBeanFactory('migLayout', MigLayout) swing.build { frame(id: 'eventScrollPanel', pack: true, show: true, defaultCloseOperation: WC.EXIT_ON_CLOSE) { migLayout(layoutConstraints: "fill, debug", columnConstraints: "", rowConstraints: "") panel() { label(text: "test") } } } </code></pre> <p>In Eclipse, I have added the external jar file to my JDK and checked that it appears in Project => Properties => Java Build Path => Libraries tab => JRE System Library [jdk1.7.0_09]. However, the script fails with the following error:</p> <pre><code>Caught: java.lang.ExceptionInInitializerError java.lang.ExceptionInInitializerError at net.miginfocom.layout.UnitValue.&lt;init&gt;(Unknown Source) at net.miginfocom.layout.UnitValue.&lt;clinit&gt;(Unknown Source) at net.miginfocom.layout.PlatformDefaults.&lt;clinit&gt;(Unknown Source) at net.miginfocom.swing.MigLayout.&lt;init&gt;(Unknown Source) at net.miginfocom.swing.MigLayout.&lt;init&gt;(Unknown Source) at MigLayoutExamples$_run_closure1_closure2.doCall(MigLayoutExamples.groovy:12) at MigLayoutExamples$_run_closure1_closure2.doCall(MigLayoutExamples.groovy) at MigLayoutExamples$_run_closure1.doCall(MigLayoutExamples.groovy:10) at MigLayoutExamples$_run_closure1.doCall(MigLayoutExamples.groovy) at MigLayoutExamples.run(MigLayoutExamples.groovy:9) Caused by: java.lang.NullPointerException at net.miginfocom.layout.LayoutUtil.hasBeans(Unknown Source) at net.miginfocom.layout.LayoutUtil.&lt;clinit&gt;(Unknown Source) ... 10 more </code></pre> <p>Also, the migLayout reference at the start of line 12 of the script is underlined by Eclipse, i.e. Eclipse canot resolve the reference.</p> <p>All help gratefully appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload