Altering a Panel during runtime, repaint etc not working!

Hello all,
I have had a look around this forum for similar problems and all suggestions seem to say use repaint(), revalidate() or validate() to get a JPanel to update, however none of these seem to work for me.
Basically I have a program with multiple panels, one of which is affectedd by JFileChooser, when a new directory is selected the panel alters to show certain files in that directory...all the data alters correctly but the panel will not refresh.
void changeDirectory(String dir){
          currentDirectory = formatDir(dir);
          thumbPanel = new JScrollPane(new thumbnailWindow());
          add(thumbPanel, BorderLayout.CENTER);
          thumbPanel.validate();
          setVisible(true);
     }this is a small snippet of my code and the bit that is giving me the problem,
thumbPanel already exists and is shown in my main program, when the directory is changed the data is altered, so i then want thumbpanel to refrence a new thumbpanel and over write the previous one.
I have already tried to remove the panel first then re add, aswell as repaint, validate, and revalidate. I know this is going to be something fundamental but I don't have a clue what to do now.
All help, comments and criticism is welcomed,
Regards,
Chris.

/* your current code */
void changeDirectory(String dir){
  currentDirectory = formatDir(dir);
  thumbPanel = new JScrollPane(new thumbnailWindow());
  add(thumbPanel, BorderLayout.CENTER);
  thumbPanel.validate();
  setVisible(true);
/* correct code */
void changeDirectory(String dir){
  currentDirectory = formatDir(dir);
  thumbPanel.setViewportView(new thumbnailWindow());
}

Similar Messages

  • Yahoo mail tool bar (delete,more,spam,etc) not working in firefox.Works in Explorer.Web points to Mozilla update."Plug-ins" up to date. Solutions?

    Yahoo mail tool bar (delete,more,spam,etc) not working in firefox.Works in Explorer.Web search points to Mozilla update problem."Plug-ins" up to date. Solutions?
    I've used firefox for years now with out problems. Now that help is needed, Could you make this any more frustrating? I thought I was asking Mozilla help and I'm sent to "users". I went there 1st! there are similar questions but no answers. I've lost time and data. Is there any REAL PEOPLE to help with firefox problems?

    I'm a real person, thanks.
    If you mean, does Mozilla have paid staff you could phone or email, the answer is "No."
    Is the problem with a feature of the Yahoo! mail web page itself, or the Yahoo! toolbar?
    General advice:
    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
    (1) Bypass Firefox's Cache
    Use Ctrl+Shift+r to reload the page fresh from the server.
    Alternately, you also can clear Firefox's cache completely using:
    "3-bar" menu button (or Tools menu) > Options > Advanced
    On the Network mini-tab > Cached Web Content : "Clear Now"
    If you have a large hard drive, this might take a few minutes.
    (2) Remove the site's cookies (save any pending work first). While viewing a page on the site, try either:
    * right-click and choose View Page Info > Security > "View Cookies"
    * (menu bar) Tools > Page Info > Security > "View Cookies"
    * click the padlock or globe icon in the address bar > More Information > "View Cookies"
    In the dialog that opens, you can remove the site's cookies individually.
    Then try reloading the page. Does that help?
    Could you test in Firefox's Safe Mode? That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    ''If Firefox is not running:'' Hold down the Shift key when starting Firefox.
    ''If Firefox is running:'' You can restart Firefox in Safe Mode using either:
    * "3-bar" menu button > "?" button > Restart with Add-ons Disabled
    * Help menu > Restart with Add-ons Disabled
    and OK the restart.
    ''Both scenarios:'' A small dialog should appear. Click "Start in Safe Mode" (''not'' Refresh).
    Any difference in how Yahoo! works?

  • Save Panel Image / Screen Image does not work as an Executable

    The Save Panel Image / Screen Image does not work as an Executable.  It looks like there is a conflict with the Path, since the Screen_Image.exe is launched as Screen_Image.vi.  I've tried this function both ways with the path name change Screen_Image.exe AND Screen_Image.vi.

    Any chance you might be able to post some code illustrating what you are talking about?
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Hello, I encounter a difficulty for activated my lightroom software. I bought the software online in a few months ago and have changed computers, so I reinstall again mias the activation code that I received during my acaht of not working. (attached). Can

    hello,I encounter a difficulty for activated my lightroom software.I bought the software online in a few months ago and have changed computers, so Ireinstall again mias the activation code that I received during my acaht of not working.(attached).Can you help me please

    Call Apple Customer Relations - 1-800-275-2273.  Ask politely & firmly that you want to be transferred to Customer Relations.  Tell them exactly what you stated in your post.
    GOOD LUCK!
    These are user-to-user forums where everyday folk (volunteers) post questions and offer answers (technical support) to each other.  

  • My Keyboard and touch-pad will work during post, but will not work after the os loads?

    I have a G60 and My Keyboard and touch-pad will work during post, but will not work after the os loads? Im running Windows 7, Anyone have any Ideas? I have already tried a hard reset, and safe mode???

    Try pressing the fn key and f2 to reach bios
    or
    try a usb mouse from your desktop
    S70-ABT2N22 Windows 7 Pro & 8.1Pro, C55-A5180 Windows 8.1****Click on White “Kudos” STAR to say thanks!****

  • Unable to embed External CSS file, dropdown list,filter panel and dimension filter are not working in SAP Design Studio Tool

    Hello Everyone,
    I am new to SAP Design Studio. I am working on creating dashboards and I am using Design Studio 1.2 version. Please suggest some solutions for the following issues. Thanks in Advance.
    1. External CSS file which is embeded using custom CSS option under "application component properties" is not working.
        * I kept the external CSS file inside repository-> my application folder.
    2. During runtime, getting javascript error while selecting '-' option from filter panel.
    3. Unable to select or type dimension name under "dimension filer component" properties.
    4. Getting runtime error for dropdown list, and I have inserted the following code under "onStartup" option of Application component properties.
    "DROPDOWN_1.setItems(DS_1.getMemberList("PRODUCTREF", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 20));
    and dimension values are not populated in auto suggest."

    There should be an Error Log under View > Error Log that gives you more details of these errors.  Could you add that?  There is also a View > Script Problems log that provides more details as well.

  • Runtime.exe() is not working from within a jar file.

    Hi All,
    I have a jar file which have classes and a package in it.
    One of these classes is calling another class which is present in the package.
    The code i am using it is as follows:
    Runtime r=Runtime.getRuntime();
    Process p=null;
    p=r.exec("java deep.slideshow.PlayShow");It is working fine when i am executing it without making jar file.
    But when i make a jar file of all these things , this exec() is not working.
    I have tried a lot.
    If any body has any idea suggest me.
    Thanks

    thanks a lot for your reply friend.
    I tried the same you tell me to do by using the cmd;
    java -cp my.jar package.class  And then tried to make the jar file with the help of eclipse,
    after adding my jar file into classpath of my project in eclipse.
    Its working fine on my local system.
    But when i put this jar file on some other system it does not call my jar file(obviously bcz it will not the find the jar file according to the classpath set on my local system. )
    Is there any way that i can keep this jar into my project and then can give the classpath dynamically
    so that it can pick the file from my project automatically.?
    Later on i will pack this whole thing into a full jar file and it will work on a single click.
    Is it possible or not ?
    Please suggest me.
    Thanks

  • MBP will not shut down, also F keys etc. not working. Help?

    Hello, must preface that I am not a very computer-savvy person, so please explain as if to a four-year old.
    My MBP is about 4 years old, but has been working great all that time. Suddenly, a problem.
    I realized that most of my F keys have ceased working, such as turning on the backlit keyboard, adjusting screen brightness, and adjusting volume. I thought a restart would fix it, but my machine will not restart or shut down. I click to request it, but nothing happens. I also try to view "about this mac" from the apple-icon menu (wanted to provide that info for this entry), but the spinning beach ball of doom appears for a moment, then vanishes, and the panel with the info does not open. Also, some of my hot corners have stopped working. Otherwise, it works fine. All my software works, and no sudden crashes.
    I haven't installed any new software recently, or done anything out of the ordinary to the MBP, for a few months at least.
    I haven't forcequitted the machine, tried to start in safe mode, or started while pushing command, R, P, option, or anything else. I did clear the caches and ran disk utility to repair permissions... then saw another post online saying I *shouldn't* do that stuff. Doh.
    Does anyone have any suggestions on how to resolve this? Obviously, the machine is out of warranty, I do have the disks that came with the machine, and I run time machine regularly...but I'd rather not have to do a fresh reinstall of everything, if it can be avoided.
    Any help would be much appreciated.

    "I haven't forcequitted the machine, tried to start in safe mode, or started while pushing command, R, P, option, or anything else."
    do command-option-p-r
    if that does't do it reset the smc.
    http://support.apple.com/kb/HT3964?viewlocale=en_US&locale=en_US

  • Touch Panel Shared variable binding does not work.

    Hi,
    Is there any reason why shared variable binding is not working under Touch Panel Target?
    Is there any plan for implementing or there is some trick I should know?
    Andras

    RebeccaFo wrote:
    Hello Andras,
    which version of LabVIEW are you using? As yu can see in:
    http://digital.ni.com/public.nsf/websearch/04AAA6903A9456F08625715A0026BC57?OpenDocument
    it should work. So what for problems do you have?
    Thanks,
    Just FYI, the KnowledgeBase article linked above has been revised and moved to a new location.  See the new KnowledgeBase 58JFBGD2: Are Shared Variables Available For LabVIEW Mobile Module (Formerly PDA Modul...

  • Modifying default spark panel skin's id=contentGroup not working

    Hello,
    I'm modifying the default "spark.skins.spark.PanelSkin" and then applying this tailored Panel skin to my panel component.  I want to be able to create a left, right, and bottom constraint of 10px to the "contentGroup" --this is all.
    However, I am finding this task near impossible.  I'm changing:
    <s:Group id="contentGroup" width="100%" height="100%" minWidth="0" minHeight="0">
                </s:Group>
    To:
    <s:Group id="contentGroup" left="10" right="10" top="10" bottom="10"  width="100%" height="100%" minWidth="0" minHeight="0">
                </s:Group>
    However, this does NOT work.  Alternatively,  modifying it's "contentGroup"s parent... "contents"... from:
    <s:Group id="contents">
    To:
    <s:Group left="10" right="10" left="10" top="10" bottom="10" id="contents">
    does NOT work either.
    Can someone please tell me how to make the "contentGroup" have a 10px padding around WITHOUT changing the title bar??  Thanks in advance

    I believe your first attempt isn't working because you are defining both a width/height size and top/left/right/bottom constraints (the width/height take precendence)
    Your second attempt isn't working because the "contents" Group is in a VerticalLayout which doesn't respect top/left/bottom/right constraints.
    EDIT:
    Actually setting the left/right/top/bottom on "contents" doesn't have any effect because at the top of the skin file the override of updateDisplayList() sets them to zero.  If you change those two lines from 0 to 10 it should have an effect, but not the one you are looking for.  I suggest this approach:
    Try wrapping the contentGroup in another Group that has width/height  of 100% and set the top/left/right/bottom on the contentGroup:
                <!--- @copy spark.components.SkinnableContainer#contentGroup -->
                <s:Group id="padding" width="100%" height="100%">
                    <s:Group id="contentGroup" top="10" left="10" right="10" bottom="10" minWidth="0" minHeight="0">
                    </s:Group>
                </s:Group>
    Message was edited by: Shongrunden

  • Back panel sound out port is not working COMPAQ SR5060IL

    Hi
    I have Compaq SR 5060IL PC
    Recently i upgraded to windows 7 ultimate from xp
    But one problem is that only the sound-out port of the back panel is not working where as mic-in and sound-in port of rear panel are working perfectly..
    Before upgrading means in windows xp all ports are working,,,,
    pls help 

    Hi:
    You may need to download and install the latest audio driver from Realtek:
    Accept the agreement, download and install the first driver on the list and see if that fixes your issue.
    http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=24&PFid=24&Level=4&Conn=3&DownT...
    Paul

  • Pause key during recording Video demo not work

    Hello everybody, I dont know why, but Pause key during recording Video demo project not work. I tried all others keys what I see in the Preferences dialog box and all works corectly, only Pause key not. Can somebody help me? Win 7, Captivate 6.
    Yarik

    Hi there and thank you for reaching Adobe Community.
    Unfortunately, this feature is not there in Captivate 6 Video demo.
    Thanks!

  • Runtime.exec does not work for commands with lengthy outputs

    I need to use Runtime.exec to run some custom commands on a Unix box. I have been doing this for quite some time now and had begun to feel comfortable when recently I started facing a problem. The thing is, whenever there is a command which prints a lot of data on to the console, the program is not able to exit from the waitFor method. Is there some thing that can be done about this?
    Following is a part of the code I use:
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec (command);
    System.out.println ("Got the process");
    int exitValue = p.waitFor();
    System.out.println ("Exit value: " + exitValue);When the output of the "command" is lengthy, it hangs after printing "Got the process".
    PS: By lengthy output, I mean that the command results in printing lines to the console which might be more than 100 in number. Say, something like what "ls -R /" would do in Unix / Linux.

    From java.lang.Process API doc:
    The Runtime.exec methods may not work well for special processes on certain native platforms, such as native windowing processes, daemon processes, Win16/DOS processes on Microsoft Windows, or shell scripts. The created subprocess does not have its own terminal or console. All its standard io (i.e. stdin, stdout, stderr) operations will be redirected to the parent process through three streams (Process.getOutputStream(), Process.getInputStream(), Process.getErrorStream()). The parent process uses these streams to feed input to and get output from the subprocess. Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.
    So you need to consume the process' output. Check the StreamGobbler example from this article.
    Hope it helps.

  • Control key copy and paste, etc., not working

    I have just purchased a T440S Thinkpad. I am alarmed that Ctl + C and Ctl + V do not work.  Also, I cannot use the Control key in combination with + and -  to zoom in and zoom out.  The Control key in combination with the letter i does not italicize a blocked word.  Does anyone have a solution to this problem?  Will Lenovo technicians be able to provide a fix for this serious problem?   David

    Is this the case for both CTRL keys (you have a CTRL key on each side of the space key) or is one of them working?
    If the right CTRL key is working and the left CTRL key isn't, are you sure you didn't swap the Fn and CTRL key in BIOS?
    -gan

  • Icloud control panel sync to chrome does not work

    Bookmark sync does not work.
    - Installed icloud control 3.0.
    - installed extension for Chrome "iCloud Bookmarks"
    I get the message "icloud Bookmarks extension for Chrome is required". Keep pressing the button enable but nothing happens.
    Please help !

    This helped to know it is one-way and that is why my IPad got nuked.  Is there any software you are aware of that can download or transfer photo albums, not camera rolls or those taken by iphone, toa disc?  there are apps on itunes that I tr5ied but only worked on camera rolls or phtos take with iphone.  I have over 1,000 photos and do not want to make 1,000 emails of redueced size photos that loses original jpg date and data.

Maybe you are looking for

  • 10 foot user interface remote options for Linux

    Hi people! I already posted a topic asking how could i share my music, videos, etc, from my Arch PC to my Arch HTPC. Now I'd like to hear suggestions about remotes, pros and cons, I've already considered these options: 1 - Buy an IR receiver and a st

  • Avoid Joining Table Multiple Times

    I have two tables EMPLOYEE and EMPLOYEE_HOURS. EMPLOYEE contains EMPLOYEE_ID EMPLOYEE_HOURS contains EMPLOYEE_ID, HOURS, TYPE So the EMPLOYEE_HOURS table will contain multiple entries for a given period with hours for types 1, 2 and 3. I need to disp

  • CS4 Student Edition - Can my daughter use this for commercial use after she has finished her studies?

    I have searched all day, having phoned 6 different numbers and researched everywhere to not get a definate answer to this question. We are in the UK, I do not want to spend money on software which she cannot legally use after her studies to produce w

  • I can video chat with my Dad, but he cannot share his screen

    My mac: Lion, 10.7.4  My iChat: 6.0.2 My Dads mac: Snow Leopard, 10.6.8, his iChat: 5.0.3 We are both signed in using our .mac  acounts. I dont know what has happened, but right now we can only Video chat with each other. I am able to invite him to s

  • From notification to test case

    Hello all. This is my scenario: I have created a message through stwb_work. the mesage is being sent automatically to the person responsible. Now, this person wants to navigate from the message to the test tree - is it possible? We are using SM 7.01.