2012-10-16 4 views
2

구문 분석 후 Rss 파일에서 HtmlString을 가져옵니다. 모든 HTML 태그를 제거하고 양식의 순수 텍스트 만 표시하려면 LWUIT HtmlComponent 클래스를 참조하고 아래 코드를 사용하십시오. :LWUIT HtmlComponent NoSuchElementException

private void displayCompleteNewsScreen(News detailNews) { 
     html.removeAll(); 
     form2.removeAll(); 
     form2.repaint(); 
     form2.addCommand(m_backCommand); 
     form2.addCommandListener(new ActionListener() { 

      public void actionPerformed(ActionEvent ae) { 
       form1.show(); 
      } 
     }); 
    String content= detailNews.getDescription(); 
    html.setPreferredSize(new Dimension(300,300)); 
    html.setHTML(content, null, null, false); 
    form2.addComponent(html); 
    form2.show(); 
} 

내 LWUITform에 성공적으로 텍스트를 표시 할 수 있어요,하지만 난 내가 양식에

Exception1을 내 텍스트를 표시 할 때마다 아래 예외를 던지고있어 :

Uncaught exception: java.util.NoSuchElementException 
    at java.util.Vector.lastElement(Vector.java:456) 
- com.sun.lwuit.html.HTMLComponent.popContainer(HTMLComponent.java:3667) 
- com.sun.lwuit.html.HTMLComponent.processTag(HTMLComponent.java:2825) 
- com.sun.lwuit.html.HTMLComponent.rebuildPage(HTMLComponent.java:1653) 
- com.sun.lwuit.html.HTMLComponent.documentReady(HTMLComponent.java:1113) 
- com.sun.lwuit.html.HTMLComponent$1.run(HTMLComponent.java:770) 
,

Exception2 :

Uncaught exception: 
    java.lang.OutOfMemoryError 
    (stack trace incomplete) 
java.lang.OutOfMemoryError 
    (stack trace incomplete) 

Exception3 :

Uncaught exception: java.lang.IllegalArgumentException: Component is already contained in Container: Container[x=0 y=0 width=0 height=0, layout = BoxLayout, scrollableX = false, scrollableY = false, components = [Container]] 
- com.sun.lwuit.Container.insertComponentAt(Container.java:370) 
- com.sun.lwuit.Container.addComponent(Container.java:334) 
- com.sun.lwuit.html.HTMLComponent.newLine(HTMLComponent.java:1878) 
- com.sun.lwuit.html.HTMLComponent.processTag(HTMLComponent.java:2826) 
- com.sun.lwuit.html.HTMLComponent.rebuildPage(HTMLComponent.java:1653) 
- com.sun.lwuit.html.HTMLComponent.documentReady(HTMLComponent.java:1113) 

: 내 HtmlString이 하나가 나를 도울 수있는 이미지 및 SRC 태그

포함되지 않습니다. ..

답변

0

HTML 코드에 구문 분석 오류가있는 것 같습니다. 실제 HTML 태그, 본문 등을 포함하는 HTML의 전체 집합입니까?