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]
# 1
http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html
suparenoa at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...
# 2
Um.. ok? I tried out the components found on that page.. still having the same problem.
bjb39a at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...
# 3
Still trying to get this to work.. now using a JTextPane.. no luck. Anyone have any ideas? It's taking far too long to figure out something that should be so trivial.
bjb39a at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...
# 4
This is absolutely maddening.
bjb39a at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...
# 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!
clairec666a at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...
# 6
No luck with that either.
bjb39a at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...
# 7
Oh. I'm getting a little stuck for ideas here. Are you sure that your editor pane has a preferred size set, and that it contains some text?
clairec666a at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...
# 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?
petes1234a at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...
# 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.

camickra at 2007-7-12 9:10:36 > top of Java-index,Desktop,Core GUI APIs...