JavaのListクラスの要素には、ArrayのようにArray[i]でアクセスするのではなく、List.get(i)の様にインデックスを指定してアクセスする。
http://www.gamedev.net/topic/334269-beginning-question-involving-arraylist/
import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.List; import java.awt.*; //これが要る import net.htmlparser.jericho.Element; import net.htmlparser.jericho.HTMLElementName; import net.htmlparser.jericho.Source; import processing.core.*; public class HelloProcessing extends PApplet{ public String getUrlDataParsing() throws MalformedURLException, IOException{ Source source = new Source(new URL("http://shohei.github.com/counter/")); List<Element> divList = source.getAllElements(HTMLElementName.DIV); Element div = divList.get(0); String result = String.format("%s" , div.getContent().toString()); System.out.println(result); return result; }; public void setup() { size(400, 400); background(0, 0, 0); smooth(); strokeWeight(5); String strings; try { strings = getUrlDataParsing(); TextField inputLine = new TextField(strings); inputLine.setBounds(30,37,125,25); add(inputLine); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void draw() { noStroke(); fill(0,10); rect(0,0,width,height); stroke(255); if (mousePressed) { line(mouseX,mouseY,pmouseX,pmouseY); } } //メイン関数を書くとJavaアプリケーションとして走る // public static void main(String args[]){ // PApplet.main(new String[] { "--present", "HelloProcessing" }); // } }