JEditorPane won't work in a JScrollPane?
So I'm trying to put a JEditorPane within a JScrollPane.. but every time I do it nothing gets displayed. I have the following code:
JScrollPane myScrollPane =new JScrollPane(myEdtiorPane);
myScrollPane.setBounds(new Rectangle(15,365,465,95));
This code works fine when I use other types of components, such as JLists, within a JScrollPane. Any ideas?
[443 byte] By [
bjb39a] at [2007-11-27 4:05:36]

# 5
Looking at the Swing tutorials on this website, it uses setPreferredSize() instead of setBounds() to set the size of the scroll pane. I'm not sure if this is the cause of your problem, but it has always worked fine for me.Good luck!
# 8
when you instantiate your editor pane, do you put in a int argument for the number of columns?Also, what type of container will hold the jscrollpane? Have you tried using different layout managers for this container?
# 9
Post your 10 line program that demonstrates the problem you are having.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the posted code retains its original formatting.