Facing problem in using JEditorPane as renderer for JList

I am trying to use JEditorPane as renderer for a list. But I am facing some problems. First problem is the output in the editorpane is not shown properly. I want to show a html file, but only portion of the first line that is viewable in the editorpane is shown. I, of course, need to show the total content of the file. Again sometimes the editorpane looks blank. If I click on the list then some text are shown in the editor pane. Please help me to overcome these problems.

Here goes the code for the renderer.

list.setCellRenderer(new ListCellRenderer(){

private JEditorPane editor =new JEditorPane();

public Component getListCellRendererComponent(JList mList, Object value,int index,

boolean isSelected,boolean hasFocus){

try{

editor.setPage("file://localhost/C:/networks/network1/description.html");

editor.setBackground(isSelected ? mList.getSelectionBackground() : mList.getBackground());

editor.setForeground(isSelected ? mList.getSelectionForeground() : mList.getForeground());

editor.setBorder(BorderFactory.createRaisedBevelBorder());

editor.setOpaque(true);

}catch(Exception e){

e.printStackTrace();

}

return editor;

}

});

[1847 byte] By [ahmadleada] at [2007-10-2 10:21:34]
# 1
Please somebody help me
ahmadleada at 2007-7-13 1:52:39 > top of Java-index,Desktop,Core GUI APIs...
# 2

hai ahmad,

it could be bcoz of the size of the pane.... the size content might be too large to fit in that pane....... y dont u increase the width of the pane..

or set the size of the pane..... its surely bcoz of the size only....

hope this helps u...... or else revert back for further clarifications...

Regards,

Ciya.

ciyaa at 2007-7-13 1:52:39 > top of Java-index,Desktop,Core GUI APIs...
# 3
I checked dear. This is not bcoz of the size of the pane. Please help.
ahmadleada at 2007-7-13 1:52:39 > top of Java-index,Desktop,Core GUI APIs...
# 4
Help Please
ahmadleada at 2007-7-13 1:52:39 > top of Java-index,Desktop,Core GUI APIs...