Results 1 to 3 of 3
  1. #1
    galliva is offline Member
    Join Date
    Apr 2011
    Posts
    1
    Rep Power
    0

    Unhappy JPanel - Refresh Problem

    Dear All,
    I have a simple JFrame with inside a JPanel, with inside 2 others JPanels.

    The top-inside panel displays an image, the bottom-inside panel has a JSlider. The user can use the JSlider to "animate" the image (for every movement of the JSlider a new frame is loaded and displayed).

    This is the current situation:



    The problem is that, as soon as the user moves the JSlider, the top JPanel start to have some drawing / refresh problems: the JSlider is painted also in the top panel (just painted, is not usable).



    As soon as the user resize the JFrame everything is again displayed correctly.

    What can I do to avoid this issue?

    I tried with repaint(), revalidate(), removeAll() and then add(...) but I was not able to solve this.

    Thank you for your help!

    Best,
    galliva

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Hint: If you need our help, then your next step would be to post the offending code. The best code would be a small compilable program that demonstrates the problem, an SSCCE

Similar Threads

  1. how to refresh the contents of a JPanel
    By pratim in forum AWT / Swing
    Replies: 1
    Last Post: 03-13-2011, 06:28 PM
  2. refresh view of Jpanel
    By VineetKumar in forum AWT / Swing
    Replies: 1
    Last Post: 11-21-2008, 01:49 AM
  3. Jpanel won't refresh
    By alon2580 in forum AWT / Swing
    Replies: 3
    Last Post: 08-22-2008, 05:26 PM
  4. Can't refresh a JPanel/text
    By nickbeacroft in forum AWT / Swing
    Replies: 8
    Last Post: 06-23-2008, 05:23 PM
  5. refresh JPanel
    By olesja in forum AWT / Swing
    Replies: 1
    Last Post: 04-16-2008, 03: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
  •