JPanel and Graphics

S

Scott

Hi,

I have a design question. I'm writing a Java app that displays a set
number of graphics drawn onto a JPanel. However, I only want one graphic
to be displayed at a time, allowing the user to use next and previous
buttons to move through all the available graphics. This, of course,
seems like an ideal use for the CardPanel layout. But, I have a question
about memory use and efficiency. If I end up pre-drawing 100 or so
cardpanels, isn't this really inefficient? Shouldn't I just use one
JPanel and then redraw it each time the next/previous buttons are pressed?
I suppose going the latter route means more of a wait moving between
images, while the former means a longer wait while everything is predrawn,
but faster movement between images. Does this seem correct? And for an
even simplier question - how would I cause the JPanel to be redrawn,
without redrawing the rest of my user interface? Thanks for any help!

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top