JPanel and Graphics

Discussion in 'Java' started by Scott, Jul 2, 2003.

  1. Scott

    Scott Guest

    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
    Scott, Jul 2, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. steve smith
    Replies:
    0
    Views:
    532
    steve smith
    Jul 10, 2003
  2. Andreas Beresko

    Add a JPanel to a JPanel...

    Andreas Beresko, Jul 14, 2004, in forum: Java
    Replies:
    6
    Views:
    26,980
  3. Raphael Jolivet

    [JPanel] Drop Down JPanel

    Raphael Jolivet, Jul 18, 2008, in forum: Java
    Replies:
    1
    Views:
    1,518
    John B. Matthews
    Jul 18, 2008
  4. BEHROUZ

    Adding Graphics to Jpanel

    BEHROUZ, Feb 15, 2010, in forum: Java
    Replies:
    2
    Views:
    3,201
  5. t1m1976
    Replies:
    1
    Views:
    2,406
    t1m1976
    Nov 7, 2010
Loading...

Share This Page