| Author |
JScrollPane and JLabel Challenge
|
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
Ok people, here is a challenge. my screen resolution is 1024x768. I want to create a JLabel 2000x2000 and be able to scroll around the JLabel. Also, I would like for the view to start out relatively close to the center of the JLabel. Any suggestions?? Thanks ------------------ Happy Coding, Gregg Bolinger
|
My Blog | DZone Articles
|
 |
Paul Stevens
Ranch Hand
Joined: May 17, 2001
Posts: 2823
|
|
|
You will need to use setMinimumSize() setPreferredSize() and put the Dimension you want in it. That will give you a large label. Are you putting it on a JScrollPane?
|
 |
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
Ok, so here is some code snipit does that look right? ------------------ Happy Coding, Gregg Bolinger
|
 |
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
I got the code to work, and I can see the scrollPanes, but you can't scroll through the entire JLabel. Any ideas? ------------------ Happy Coding, Gregg Bolinger
|
 |
 |
|
|
subject: JScrollPane and JLabel Challenge
|
|
|