Re: Scroll bar not showing up
fiziwig wrote:
....
As for a short compilable example, I'd have to do a lot of cut ans
pasting to get rid of the extraneous stuff. The class in question is
about 1600 lines of code.
After looking at your 205 lines of trimmed code, and taking another
40 lines from it that were redundant to the immediate problem, I still
had little idea of what you are trying to achieve, or why you are using
a JLayeredPane.
In any case, that prompted me to look at the example you pointed to..
I took my scrollbar code from
http://www.java2s.com/Code/Java/Swing-JFC/AquickdemonstrationofJScrollBarbothverticalandhorizontal.htm
which supposedly works.
Supposedly? Didn't you try it? It works as advertised for me.
But then, there are no mention of JLayeredPane's in that example.
In the end I changed your JLayeredPane for a JPanel and the
JScrollBar appeared.
I doubt that answers your initial technical question, but then,
none of us yet seem clear on what you are trying to achieve.
And as an aside.. did you note how that example you linked to
contained just 58 lines of code? With the top 9 lines (comments)
removed, it comes to 49 lines - 11 shorter than the 60 I estimated
needed to display JScrollBars, and over 150 lines shorter than your
example.
Andrew T.