User:Skasavaraju

How to add an image from the java class?

I have to call matlab excutable for some processing.Once processing is done matlab will generate some images. Since matlab take some substantial amount of time for processing i want to create a thread that waits for the matlab excutions and then creates a hbox and appends these resulted images from the matllab. i created images in theard class as follows.

String[] imgsrc={"/images//results/OutImage_perf_run.png","/images//results/OutImage_over_lowbody.png","/images//results/OutImage_acute_lowbody.png"};

String[] labelValues={"Physical Fitness Test","Overuse Injury","Stress Fracture"};

String[] styles={"color:green;font-size:10pt;background:white"};

// String[] buttonIds={"pftButton", "oiButton", "sfButton"};

String[] pageSrc={"/Analysis/PftResult.zul", "/Analysis/OveruseResult.zul", "/Analysis/SFResult.zul"}; Hbox hbox=new Hbox; for (int i=0; i< imgsrc.length;i++) {

Vbox vbox=new Vbox; Window w=new Window; Label label=new Label(labelValues[i]); label.setStyle(styles[0]); w.appendChild(label); com.potix.zul.html.Image deleteImage=new Image; deleteImage.setSrc(imgsrc[i]); w.appendChild(deleteImage); Button button =new Button("Details"); button.addEventListener("onClick", new ButtonListener(pageSrc[i],page)); w.appendChild(button); vbox.appendChild(w); hbox.appendChild(vbox); }	 }//end of constructor Whatever path i mention it says some null pointer exception.

Please guide me how to do this ?

Thank you