Results 1 to 2 of 2
  1. #1
    pratim is offline Member
    Join Date
    Mar 2011
    Posts
    8
    Rep Power
    0

    Default how to refresh the contents of a JPanel

    hello, i am new to JAVA SWING and i don't know all its features very well. I need to refresh the contents of a JPanel, which is in a JFrame. I have succesfully used card layout. i have several JPanels in a JFrame.

    Now what i need to do is to refresh the contents of only one JPanel. Again at the same time i have a question whether i need to refresh all the JPanels seperately, if i have to do refresh of all the JPanels? My JPanels have different contents in different JPanels. Plz, help me in this regard. i don't understand what to do. I have heard about repaint(), revalidate(), updateUI(). but i don't know the difference that when to use them...?

    i have to refresh my JPanel in a regular interval of 1 hour, whether i have to use timers? Plz, help me in am rather confused.

    Thanks in advance. Any small help from u will highly be appreciated.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

Similar Threads

  1. Replies: 1
    Last Post: 02-23-2010, 10:48 AM
  2. refresh view of Jpanel
    By VineetKumar in forum AWT / Swing
    Replies: 1
    Last Post: 11-21-2008, 02:49 AM
  3. Jpanel won't refresh
    By alon2580 in forum AWT / Swing
    Replies: 3
    Last Post: 08-22-2008, 06:26 PM
  4. Can't refresh a JPanel/text
    By nickbeacroft in forum AWT / Swing
    Replies: 8
    Last Post: 06-23-2008, 06:23 PM
  5. refresh JPanel
    By olesja in forum AWT / Swing
    Replies: 1
    Last Post: 04-16-2008, 04:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •