java - Spaces between the elements MigLayout -


maybe of able me, because i'm sitting on few hours , not know do. checked documentation several times, out effect

i need create java gui components a1, a2, a3 aligned left, elements b1, b2, b3 aligned right. textarea grow window, , bottom similar numeric keypad.

problem number one: items not want change when change window size

problem number two: large gap between buttons

http://i.stack.imgur.com/azmkw.png

    package zad32;      import javax.swing.*;     import net.miginfocom.swing.*;     public class migtest extends jframe {        public migtest() {         setlayout(new miglayout());          add(new jbutton("a1"));         add(new jbutton("a2"));         add(new jbutton("a2"));          add(new jbutton("b1"), "right align");         add(new jbutton("b2"), "right align");         add(new jbutton("b3"), "right align, wrap");          add(new jscrollpane(new jtextarea(20,50)), "grow, span, wrap");          add(new jbutton("1"));         add(new jbutton("2"));         add(new jbutton("3"));         add(new jtextfield("to jest jtextfield", 15), "span 3, right align, wrap");          add(new jbutton("4"));         add(new jbutton("5"));         add(new jbutton("6"));         add(new jtextfield("to jest jtextfield", 15), "span 3, right align, wrap");          add(new jbutton("7"));         add(new jbutton("8"));         add(new jbutton("9"));         add(new jtextfield("to jest jtextfield", 15), "span 3, right align, wrap");          setdefaultcloseoperation(dispose_on_close);         pack();         setvisible(true);       }        public static void main(string[] args) {         new migtest();       }      } 

answer gap:

font-size:0; must added parent element 

alternatively, can do:

setlayout(new miglayout("gap rel 0", "grow")); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -