i'm trying implement gui , i'm missing jtextfield
. want below everything, , wide 2 comboboxes. add height. trying use inside grouplayout
(in code below), gets messed if so. there way of creating new group layout underneath 1 , add textfield
? thank
grouplayout layout = new grouplayout(getcontentpane()); getcontentpane().setlayout(layout); layout.setautocreategaps(true); layout.setautocreatecontainergaps(true); grouplayout.sequentialgroup horizontalgroup = layout.createsequentialgroup(); horizontalgroup.addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(javax.swing.grouplayout.alignment.leading) .addcomponent(jbutton1) .addgap(50, 50, 50) )); horizontalgroup.addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(javax.swing.grouplayout.alignment.leading) .addcomponent(fromlabel) .addcomponent(timelabel) )); horizontalgroup.addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(javax.swing.grouplayout.alignment.leading) .addcomponent(mainlabel) .addcomponent(querylabel) .addcomponent(employeemsg) .addcomponent(stoplistdeparture) .addcomponent(departuretime, grouplayout.preferred_size, grouplayout.default_size, grouplayout.preferred_size) .addcomponent(jtextfield) )); horizontalgroup.addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(javax.swing.grouplayout.alignment.trailing) .addcomponent(tolabel) )); horizontalgroup.addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(javax.swing.grouplayout.alignment.trailing) .addcomponent(stoplistarrival) .addcomponent(querybutton) .addgap(200, 200, 200) )); layout.sethorizontalgroup(horizontalgroup); ///////////////////////////////////////////////////////////////////////////////////// // creating vertical view grouplayout.sequentialgroup verticalgroup = layout.createsequentialgroup(); verticalgroup.addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(javax.swing.grouplayout.alignment.leading) .addcomponent(mainlabel) .addgap(50, 50, 50) )); verticalgroup.addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(grouplayout.alignment.leading) .addcomponent(jbutton1) .addcomponent(employeemsg) .addgap(50, 50, 50) )); verticalgroup.addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(grouplayout.alignment.leading) .addcomponent(querylabel) .addgap(40,40,40) )); verticalgroup.addgroup(layout.createparallelgroup(grouplayout.alignment.trailing) .addcomponent(jbutton1) //.addcomponent(jseparator, javax.swing.grouplayout.preferred_size, 27, javax.swing.grouplayout.preferred_size) .addcomponent(fromlabel) .addcomponent(tolabel) .addcomponent(stoplistdeparture) .addcomponent(stoplistarrival) ); verticalgroup.addgroup(layout.createparallelgroup(grouplayout.alignment.trailing) .addcomponent(departuretime, grouplayout.preferred_size, grouplayout.default_size, grouplayout.preferred_size) .addcomponent(timelabel) .addcomponent(querybutton) ); verticalgroup.addgroup(layout.createparallelgroup(grouplayout.alignment.trailing) .addcomponent(jtextfield) ); layout.setverticalgroup(verticalgroup);
Comments
Post a Comment