I'm trying to create a game. It has gotten to the point where the game board does not fit on the screen, so I would like to add some scroll bars.
The only way I have found to do this is to use a JScrollPane, but it says it only works with "lightweight" components. While I'm not 100% sure what that means, I'm pretty sure Canvas isn't one of them. I am currently drawing the gameboard on a Canvas, so I think that could cause a problem when I want to add scroll bars, yes?
Anyone have experience with this kind of thing? Would using a BorderLayout on my JFrame that is the game work, and then just add JScrollBars to the borders and the Canvas in the middle? I've never tried to use scroll bars before, so I'm at a loss.
Thanks for any help you can give.
The only way I have found to do this is to use a JScrollPane, but it says it only works with "lightweight" components. While I'm not 100% sure what that means, I'm pretty sure Canvas isn't one of them. I am currently drawing the gameboard on a Canvas, so I think that could cause a problem when I want to add scroll bars, yes?
Anyone have experience with this kind of thing? Would using a BorderLayout on my JFrame that is the game work, and then just add JScrollBars to the borders and the Canvas in the middle? I've never tried to use scroll bars before, so I'm at a loss.
Thanks for any help you can give.
