Create dynamic check boxes and arranged horizontally
public class loginfinal implements EntryPoint {
RootPanel rt;
AbsolutePanel absolutePanel;
AbsolutePanel absolutePanelanother;
ArrayList<String> a1=new ArrayList<String>();
public void onModuleLoad() {
rt=RootPanel.get();
rt.setSize("100%", "100%");
absolutePanel = new AbsolutePanel();
rt.add(absolutePanel, 65, 218);
absolutePanel.setSize("943px", "");
a1.add("AERONAUTICAL");
a1.add("FOOD PROCESSING");
a1.add("BIO TECHNOLOGY");
a1.add("COMPUTERS");
a1.add("CHEMICAL");
a1.add("COMMUNICATION");
a1.add("CHEMISTRY(12th GRADE)");
a1.add("CHEMISTRY(ADVANCE)");
a1.add("CIVIL");
a1.add("ENVIRONMENT");
a1.add("ELECTRONICS");
a1.add("ELECTRICAL");
a1.add("AUTOMBILE");
a1.add("INSTRUMENTATION");
a1.add("MATHS(12th GRADE)");
a1.add("MATHS(ADVANCE)");
a1.add("METALLURGY");
a1.add("MINING");
a1.add("MARINE");
a1.add("MECHANICAL");
a1.add("PHYSICS(12th GRADE)");
a1.add("PHYSICS(ADVANCED)");
a1.add("PLASTICS");
a1.add("RUBBER");
a1.add("TEXTILE");
size1=a1.size();
lenth12= a1.get(0).length();
System.out.print(lenth12);
for(int m=1;m<a1.size();m++)
{
if(lenth12<a1.get(m).length())
{
lenth12=a1.get(m).length();
System.out.print("length in loop " +lenth12);
}
}
for(int j=0;j<a1.size();j++)
{
System.out.print("\n"+a1.get(j)+"\n");
Collections.sort(a1);
}
for(int k=0;k<a1.size()/5;k++)
{
login(k);
}
}
public void login(int l)
{
final HorizontalPanel h1[]= new HorizontalPanel[5];
final CheckBox checkBox[] = new CheckBox[size1];
final AbsolutePanel ap1[]=new AbsolutePanel[10];
for(int i=0;i<6;i++)
{
ap1[i]=new AbsolutePanel();
ap1[i].setStyleName("gwt-absolutepanel1");
}
for(int j1=0;j1<5;j1++)
{
h1[j1]=new HorizontalPanel();
h1[j1].setStyleName("gwt-horizontal1");
}
while(b<size1)
{
checkBox[b] = new CheckBox();
checkBox[b].setTitle("fkg");
// checkBox[b].setText();
lenth123=a1.get(b).length();
//System.out.print("upper wali lenth\n"+lenth12);
//System.out.print("niche wali lenth\n "+lenth123);
TotalLenth= lenth12-lenth123;
//System.out.print("total lenth \n"+TotalLenth);
str12="";
for(int g=0; g<TotalLenth; g++)
{
str12= str12+ " ";
}
//System.out.print(str12+"\n");
String s1=a1.get(b);
checkBox[b].setStyleName("gwt-checkbox1");
// System.out.print(s1);
//System.out.print("monica"+str12+"\n");
// checkBox[b].setText();
System.out.print("get html \n"+checkBox[b].getHTML());
checkBox[b].setHTML(a1.get(b)+ str12);
h1[g].add(checkBox[b]);
// System.out.print("value of b "+b+"\n");
b++;
v++;
// System.out.print("value of v "+v+"\n");
if(v>=5)
{
v=0;
ap1[g].add(h1[g]);
g++;
break;
}
// System.out.println("in while loop");
}
//System.out.println("absolute panel"+g);
absolutePanel.add(ap1[g-1]);
}
}
public class loginfinal implements EntryPoint {
RootPanel rt;
AbsolutePanel absolutePanel;
AbsolutePanel absolutePanelanother;
ArrayList<String> a1=new ArrayList<String>();
public void onModuleLoad() {
rt=RootPanel.get();
rt.setSize("100%", "100%");
absolutePanel = new AbsolutePanel();
rt.add(absolutePanel, 65, 218);
absolutePanel.setSize("943px", "");
a1.add("AERONAUTICAL");
a1.add("FOOD PROCESSING");
a1.add("BIO TECHNOLOGY");
a1.add("COMPUTERS");
a1.add("CHEMICAL");
a1.add("COMMUNICATION");
a1.add("CHEMISTRY(12th GRADE)");
a1.add("CHEMISTRY(ADVANCE)");
a1.add("CIVIL");
a1.add("ENVIRONMENT");
a1.add("ELECTRONICS");
a1.add("ELECTRICAL");
a1.add("AUTOMBILE");
a1.add("INSTRUMENTATION");
a1.add("MATHS(12th GRADE)");
a1.add("MATHS(ADVANCE)");
a1.add("METALLURGY");
a1.add("MINING");
a1.add("MARINE");
a1.add("MECHANICAL");
a1.add("PHYSICS(12th GRADE)");
a1.add("PHYSICS(ADVANCED)");
a1.add("PLASTICS");
a1.add("RUBBER");
a1.add("TEXTILE");
size1=a1.size();
lenth12= a1.get(0).length();
System.out.print(lenth12);
for(int m=1;m<a1.size();m++)
{
if(lenth12<a1.get(m).length())
{
lenth12=a1.get(m).length();
System.out.print("length in loop " +lenth12);
}
}
for(int j=0;j<a1.size();j++)
{
System.out.print("\n"+a1.get(j)+"\n");
Collections.sort(a1);
}
for(int k=0;k<a1.size()/5;k++)
{
login(k);
}
}
public void login(int l)
{
final HorizontalPanel h1[]= new HorizontalPanel[5];
final CheckBox checkBox[] = new CheckBox[size1];
final AbsolutePanel ap1[]=new AbsolutePanel[10];
for(int i=0;i<6;i++)
{
ap1[i]=new AbsolutePanel();
ap1[i].setStyleName("gwt-absolutepanel1");
}
for(int j1=0;j1<5;j1++)
{
h1[j1]=new HorizontalPanel();
h1[j1].setStyleName("gwt-horizontal1");
}
while(b<size1)
{
checkBox[b] = new CheckBox();
checkBox[b].setTitle("fkg");
// checkBox[b].setText();
lenth123=a1.get(b).length();
//System.out.print("upper wali lenth\n"+lenth12);
//System.out.print("niche wali lenth\n "+lenth123);
TotalLenth= lenth12-lenth123;
//System.out.print("total lenth \n"+TotalLenth);
str12="";
for(int g=0; g<TotalLenth; g++)
{
str12= str12+ " ";
}
//System.out.print(str12+"\n");
String s1=a1.get(b);
checkBox[b].setStyleName("gwt-checkbox1");
// System.out.print(s1);
//System.out.print("monica"+str12+"\n");
// checkBox[b].setText();
System.out.print("get html \n"+checkBox[b].getHTML());
checkBox[b].setHTML(a1.get(b)+ str12);
h1[g].add(checkBox[b]);
// System.out.print("value of b "+b+"\n");
b++;
v++;
// System.out.print("value of v "+v+"\n");
if(v>=5)
{
v=0;
ap1[g].add(h1[g]);
g++;
break;
}
// System.out.println("in while loop");
}
//System.out.println("absolute panel"+g);
absolutePanel.add(ap1[g-1]);
}
}
No comments:
Post a Comment