java - MigLayout error: "Unstable cyclic dependency in absolute linked values!" -



java - MigLayout error: "Unstable cyclic dependency in absolute linked values!" -

why sscce (with miglayout libraries) ...

public static void main(string[] args) { seek { uimanager.setlookandfeel("com.sun.java.swing.plaf.windows.windowslookandfeel"); } grab (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { e.printstacktrace(); } jframe frame = new jframe(); frame.setlayout(new miglayout(new lc().fill().insetsall("0"))); jtabbedpane jtp = new jtabbedpane(); jtp.add(new jpanel(), "tab 1"); jtp.add(new jpanel(), "tab 2"); jlabel label = new jlabel("label"); jpanel panel = new jpanel(new miglayout(new lc().fill())); panel.add(jtp, "id tabbedpane, grow, span"); panel.add(label, "pos (tabbedpane.w-label.w) 10, id label"); label.setbounds(100, 100, 10, 10); frame.add(panel, "grow, span"); frame.setsize(500, 500); frame.setlocationrelativeto(null); // sorry, andrew thompson frame.setvisible(true); frame.setdefaultcloseoperation(jframe.exit_on_close); }

throw error:

unstable cyclic dependency in absolute linked values! unstable cyclic dependency in absolute linked values! unstable cyclic dependency in absolute linked values! unstable cyclic dependency in absolute linked values!

?

i figured out if remove windowslookandfeel code, runs fine...

so, problem miglayout , windowslookandfeel. yet real application necessitates use.

edit:

this frame looks when error thrown:

taking @ source code, happens makes corrections size of components while it's doing layout. if makes more count * 8 + 10 corrections, short circuits code prevent infinite loop.

the relevant source (with stuff removed) is:

do { doagain = false; (iterator<cell> = grid.values().iterator(); it.hasnext();) { arraylist<compwrap> compwraps = it.next().compwraps; (int = 0, isz = compwraps.size(); < isz; i++) { compwrap cw = compwraps.get(i); if (j == 0) { doagain |= doabsolutecorrections(cw, bounds); // . . . } // . . . } } cleargrouplinkbounds(); if (++count > ((compcount << 3) + 10)) { system.err.println("unstable cyclic dependency in absolute linked values!"); break; } } while (doagain);

so what's happening if doabsolutecorrections returns true (which if components alter size when corrections done satisfy sizing dependencies) repeat loop, corrections again. you're seeing warning message prints when repeats many times. since corrections can result in changes sizes of linked components, can situation corrections unset y-value 1 component , sets y-value other, when first component has y-value set, un-sets y-value other, , repeats until run out of retries.

the windows l&f caused problem me because seemed components settle situation correction , changed 1 pixel correction, correction caused need redo layout component caused shift 1 pixel back. "recursion" (if want think of way) unstable , didn't arrive @ stable solution.

i don't know solution remove messages, if it's not causing unusual "jiggling" in application (you'll know mean if is), wouldn't worry it. it's message indicate it's giving on corrections because it's recursed many times.

java swing miglayout

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -