Create button to clear/reset graph's displayed data

Hello,
I'm new here and working with labview. I've searched the forum but didn't found a answer that could help me (or at least I think thank)
I'm working on a project to acquire process an ECG signal with a DAQ. In the front panel, I'm trying to display 2 graphs, one showing part of the data in real time and the other showing all the data acquired until that momment. I wanted to add a button to this second graph that, when the user wanted, cleared the data shown in the graph but immediatly continued to show the data.
(trying to make myself clearer)
"show all data acquired --> press button X --> cleans graph display --> show all data acquired"
if anyone could help I would be very thankfull!
Thank you very much,
FM
Solved!
Go to Solution.

Hi FM,
when you use a chart you have to clear it's history (using a property node).
When you use a graph instead you have to clear the array that builds the plot(s)...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • Forms created in Acrobat Pro XL do not display data when viewed on iPads

    I have a simple form that when completed and saved as an Acrobat Pro XL document and then emailed to customers, do not display the field contents of the form when viewed on iPads. So the customers just see a blank form. I have tried to use Optimize for Web and Moblie to solve this, but it appears that many times, since the iPads are so prevalent, that people can;t see the full content of the form that I send. Is there a solution for this?

    When your customers opened the PDF form (which was as an email attachment) on iPads, it is highly likely that Apple Mail (not Adobe Reader for iOS) was displaying the preview of the PDF form.   Please note that Apple products on iPad/iPhone (e.g. Apple Mail, iBooks, Safari) do not render field contents or annotations (sticky notes, highlight, underline, strikeout, freehand drawing, etc.) in PDF documents.
    The Mail sections of the following FAQ documents describe how to open PDF attachments in Adobe Reader for iOS.
    For iPad, see How to get PDF documents into Adobe Reader for iOS (iPad on iOS 7 version)
    For iPhone, see How to open PDF documents in Adobe Reader for iOS (iPhone on iOS 7 version)
    Please let us know if you have additional questions.

  • Hi, I want to display a Linechart  from Excel file(i.e CSV data),I read the csv data using FileReference ,But how to display data in linechart?

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"   >
    <mx:Script>
          <![CDATA[
                import mx.controls.*;
                import mx.collections.*;
                import flash.events.*;
                import mx.collections.ArrayCollection
                [Bindable]
                private var records:Array=new Array();
                [Bindable]
                private var datarecords:ArrayCollection=new ArrayCollection();
                private var xmldata:String="<?xml version=\"1.0\"?>\r\n<dataset>\r\n";
                private var fileref:FileReference=new FileReference();;
                private function readExcel():void
                      var request:URLRequest=new URLRequest();
                      request.url="data/chart.csv";
                      var loader:URLLoader=new URLLoader();
                      loader.dataFormat=URLLoaderDataFormat.TEXT;
                      loader.addEventListener(Event.COMPLETE,eventComplete);
                      loader.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
                      loader.load(request);
                private function eventComplete(event:Event):void
                      var loader:URLLoader=URLLoader(event.target);
                      var record:Array=new Array();
                      var fields:Array=new Array();
                      var obj:Object;
                      var str:String=new String();
                      loader.dataFormat=URLLoaderDataFormat.TEXT;
                      var result:String=new String(loader.data);
                      record=result.split("\r\n");
                      for(var i:int=1;i<record.length;i++)
                            obj=new Object();
                            fields=record[i].split(",");
                            /* obj.col1="Timestamp: "+fields[0];
                            obj.col2="EndDevice-PaLnaMode: "+fields[1];
                            obj.col3="Wap-PaLnaMode: "+fields[2];
                            obj.col4="DownstreamLqi: "+fields[3];
                            obj.col5="UpstreamLqi: "+fields[4]; */
                            obj.col1="<Timestamp>"+fields[0]+"</Timestamp>";
                            xmldata+=obj.col1+"\r\n";
                            obj.col2="<EndDevice-PaLnaMode>"+fields[1]+"</EndDevice-PaLnaMode>";
                            xmldata+=obj.col2+"\r\n";;
                            obj.col3="<Wap-PaLnaMode>"+fields[2]+"</Wap-PaLnaMode>";
                            xmldata+=obj.col3+"\r\n";
                            obj.col4="<DownstreamLqi>"+fields[3]+"</DownstreamLqi>";
                            xmldata+=obj.col4+"\r\n";;
                            obj.col5="<UpstreamLqi>"+fields[4]+"</UpstreamLqi>";
                            records.push(obj);
                            datarecords.addItem(obj);
                      xmldata+="</dataset>";
                      datagrid.dataProvider=records;
                      linechart1.dataProvider=records;
                      private  function onIOError(event:Event):void
                            Alert.show("I/O error"+event.type);
                      private function saveXML():void
                            fileref.save(xmldata,"xmldata.xml");
                      //fileref.save(xmldata,"NewFileName.txt");
                      private function dispData():void
                            fileContents_txt.text=xmldata;
          ]]>
    </mx:Script>     
          <mx:DataGrid id="datagrid" x="19" y="76" width="528" height="242">
                <mx:columns>
                      <mx:DataGridColumn headerText="Timestamp" dataField="col1"/>
                      <mx:DataGridColumn headerText="DevicePaLnaMode" dataField="col2"/>
                      <mx:DataGridColumn headerText="Wap-PaLnaMode" dataField="col3"/>
                      <mx:DataGridColumn headerText="DownstreamLqi" dataField="col4"/>
                      <mx:DataGridColumn headerText="UpstreamLqi" dataField="col5"/>
                </mx:columns>
          </mx:DataGrid>
          <mx:Button x="126" y="32" label="read" click="readExcel()"/>
          <mx:Button x="240" y="32" label="display data" click="dispData();"/>
          <mx:Text id="fileContents_txt" x="10" y="326"/>
          <!-- Define custom Strokes. -->
        <mx:Stroke id = "s1" color="blue" weight="2"/>
          <mx:LineChart  id="linechart1"   height="286" width="385"
                paddingLeft="5" paddingRight="5"
                showDataTips="true" dataProvider="{datarecords}" x="566" y="32">
              <mx:horizontalAxis>
                    <mx:CategoryAxis categoryField="Timestamp"/>
                </mx:horizontalAxis>
                <mx:series>
                    <mx:LineSeries yField="Timestamp"  xField="UpstreamLqi"  interpolateValues="true" form="curve" displayName="Timestamp" lineStroke="{s1}"/>
                </mx:series>
          </mx:LineChart>
          <mx:Button x="406" y="32" label="SaveXML" click="saveXML()"/>
    </mx:Application>

    Um, wrong forum.
    I think you want to ask this question in the Flex forum.

  • APEX 5: Problem displaying breadcrum (Create) button on interactive report

    Hello There
    I am trying to build a small app in APEX 5. I am taking the default 'Sample Database Application' (SDA) as an example for design.
    In SDA the interactive report of Customer a breadcrumb 'Create which is displayed on the top right corner. I am trying to replicate the same in my interactive report, but in vain.
    I have attached the printscreen for your reference. Could you please guide and advise me on how to get the same functionality of breadcrumb create button,etc same as in displayed in SDA into my custom app in APEX 5?
    Thanks a lot for helping me out
    Regards
    Don

    hi ,
    i had used like this .. it is working...
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            R_SELFIELD TYPE SLIS_SELFIELD.
      clear : v_flag.
      CASE R_UCOMM.
        WHEN 'DATA'.
    LOOP AT IT_TEMP.
         if it_temp-checkbox =  'X'.
              v_flag = 'X'.
              v_pernr1 = IT_TEMP-PERNR.
    *--Get compensation data and populate final internal table
              refresh it_fin.
              CALL FUNCTION 'Z_HR_COMP_STATEMENT'
                EXPORTING
                  PERNR = v_pernr1
                  BEGDA = s_date-low
                  ENDDA = s_date-high
                TABLES
                  FINAL = it_fin.
              if not it_fin[] is initial.
                delete adjacent duplicates from  it_fin comparing pernr.
                read table it_fin index 1.
                move-corresponding it_fin to it_final.
                append it_final.
                clear it_final.
              endif.
            endif.
         enddo.
    ENDLOOP.
          if not v_flag is initial.
    *------ display final data
            PERFORM final_display.
          else.
            message s000 with 'Select atleast one pernr'.
          endif.
      endcase.
    ENDFORM.                    "USER_COMMAND
    regards,
    venkat.

  • XY graph datapoint display using cursor

    Hello to all, I am using XY graph to display amplitude v/s time. While running the vi, data is continuously plooted on graph till user stops the vi. I want to add a feature such that, while running the vi, when user click on the graph on particular position using cursor, it should display corresponding time value and amplitude value of that point. I mean value of Y-axis corresponding to X-axis not the cursor position. When using cursor position, it is ok with X-axis but it shows the position of cursor for Y-axis (as property says) , and I want datavalue of that point not y-axis position.
    I hope it is clear with question. Let me have some example...for y=x graph shown below, you can see for cursor x=4.4 and y=6.8, how to display corresponding datapoint which shoud be y=4.4
    Solved!
    Go to Solution.

    While creating (or even after you created), choose 'Snap to' Plot 0.
    Don't let it be 'Free Dragging'
    Example attached.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    Snap to Plot 0.vi ‏10 KB

  • Report to Mintenance CREATE Button

    We created the tutural application where a Report TAB(P1) is linked to the maintenance Page(P2). When this is done the "ID" is passed from the report page to the maintence page. The CREATE button disapears because the pages are linked and there is a CREATE BUTTON test to see if the ID is set. If we Click on the Minatence TAB one of two things happens.
    A) if the is the first time using the application in the session then we get an Error as the P2_ID is not set.
    B) the last ID used will be displayed.
    How can we change the application so the when the mainence TAB is press it Clears the ID and runs with a CREATE Button, but if navigated from the report page if shows the row to be changed?

    if your tabs are Parent Tabs, you could easily set the URL target of your tab to clear the cache for page 2. you'd do that from your Edit Parent Tab screen. you can't do that with a standard tab, though, so you might want to consider clearing your cache on page 2 in an HTML DB process that fires after your current last process on that page. this way your value for P2_ID is consistently cleared after users leave that page. when a user comes back into that page w/o providing a P2_ID value, your create buttons and such should show.
    hope this helps,
    raj
    [Edited by: rmattama on Dec 22, 2003 9:28 AM]
    i wanted to post this part of my answer originally, but i wasn't sure about a specific point. anyhow:
    as a third option, you can consider using the value of :REQUEST to conditionally fire a process or computation that clears P2_ID. if you pay attention to the way your tabs are working, you'll see that clicking on them either submits your current page to then branch to the next or that they're simply links to your other pages. if your current page has no form fields on it, then html db implements your tabs as the simple links to their associated pages. if the current page does have form fields on it, you'll notice that clicking a standard tab submits the page with the value of :REQUEST being equal to the name of the tab. it's that value of :REQUEST that you can use to conditionally fire a process or computation to clear P2_ID. a conditionally fired after_submit computation on page 1 would do it, for instance.
    hope this helps, too,
    raj

  • Waveform Graphs: Is there a way to save data to a file and then clear the graph after each run?

    This is just an added feature that I would like to insert because I end up having to erase the previous graph(for viewing and simplification purposes) after almost every plot cycle. Does LabVIEW 7.0 have a built-in feature that allows the user to automatically clear the graph after each run.
    Thank you,
    Keith Blackwell

    May I recall you that to clear a graph you have to create a property node,
    choose value and connect an 1D array with its first value to zero.
    Then using a Select vi enables you to choose from clear or graph value.
    Gérard
    Gérard Férini
    Switzerland
    http://home.tiscalinet.ch/gferini/
    remove -move to reply personally
    "Greg McKaskle" wrote in message
    news:xEmJc.43762$[email protected]..
    > > I went into the function pallette-->signal manipulation-->align and
    > > resample
    > >
    > > and found something that may be useful, but I'm not sure how to use
    > > it. I guess I have to play around with it by trial and error. Was this
    > > the VI seetting that you were referring t
    o?
    > >
    >
    > The option I was talking about is for the entire VI. It resets the
    > value of all indicators prior to running. The setting is located in the
    > VI Properties dialog on the execution page I believe. In the end, there
    > are multiple ways to get this to work, and if you want just a few
    > indicators to be reset, you want to use locals or control methods, but
    > th eVI Properties is a convenient way to get all indicators cleared at
    once.
    >
    > Greg McKaskle
    >

  • Graph auto display

    Hi,
    I created a bar graph with from/to date parameters. For the from/to dates I am defaulting date values.
    Now when I login to that page, I want to display graph automatically i.e. graph should display with default parameter (from/to date ) values first time without pressing Go button.
    Mohan Rao

    Hi Varad,
    As I told that I am initializing the default values to parameters, hence there is no chance of Null in parameter variables. I think handling the Null is not the solution. I think we have to submit the page automatically once it is loaded. We have to write a process for initializing(submitting) the page on load. but I don't know how to write this process. Please help.
    Regards
    Mohan Rao

  • Create button passing ID value

    Instead of posting the row and then resetting the form how can I get the create button to
    post the row
    re-render the page with the unique key (id) of the record posted as an item
    thanks in advance
    kirk

    Hello Kirk,
    This is almost the default behavior of a wizard created form, only the wizard marks your PK item as hidden. Change the "Display AS" field to be "Display as Text (save state)" and you'll be able to see the field on screen, but not change it.
    Regards,
    Arie.

  • Display data in pop-up graph window

    I am trying to display data continuously in a pop up chart. When I press a button the chart should pop up and show all the previous values as well as those being continuously generated. If possible I want to do this without using local or global variables. This question was asked before too at http://forums.ni.com/ni/board/message?board.id=170&message.id=315949&query.id=9049787#M315949    but I was unable to understand the proposed solution. I am a civil engineer, meaning it will be difficult for me to understand advanced concepts and at times even simple concepts related to computer programming.  I have attached two VIs just to illustrate what I am trying to do.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Popupgraph_main.vi ‏19 KB
    Popupgraph_subvi.vi ‏18 KB

    Sorry, those uploaded VIs were just for a demonstration of my problem.
    As for the Untitled06, when I was trying them in my computer I had named it "Untitled06" but when uploading to this
    forum I changed the name. Forgot about the invoke node.
    What I was asking is, if it was possible to
    acquire data using one VI and show any temporary graph/chart in a
    separate subvi. I did it like attached. Seems like it will work for me.
    smercurio_fc  Thanks regarding the t0. I changed that in this version. Shipped LV examples haven't been a lot of help to me. Most of the time I cannot relate them to what I want to do. I generally prefer to use this forum. 
    Any other (obviously better) solutions? then please do let me know. The only requirement is that chart should appear in a separate VI, it is just a temporary chart and I do not want it to take up space in my main VI front panel.
    Thanks
    Attachments:
    Popupgraph_mainv02.vi ‏24 KB
    Popupgraph_subviv02.vi ‏18 KB

  • Display Data on waveform chart or XY graph over a long period of time

    Display Data on waveform chart or XY graph over a long period of time
    Can anyone help?
    I am acquiring data from an Ni DAQ card with the following parameters - sample rate = 12800, number of samples = 4096. I want to extract order information so as to track changes in the amplitudes of certain frequency harmonics. So I use the sound and vibration toolkit to extract this information as shown in the attached Vi.  I will like to plot the resulting amplitudes against real-time starting at the time the Vi was run.  I really want the display to show these changes over long periods (eg. days, months and even years).
    Problem.
    I have tried to plot the Y component of the resulting magnitude for a given order on a waveform chart. My choice of the waveform chart is because I also want to display  alarm limits (using the mask and limit vi) (I can't have these lines displayed on an XY graph plot).  I tried adjusting the scale offset using the property node and setting the offset to current time. However, the display on the X-axis can only show a span of  2 minutes as will be seen when you run the attached vi. I want the time display on the x-axis to be over a period of  days, months  and even years.  Is there a way to set the maximum scale on the x-axis to be say a year or so in future.
    I really want the display to be like the one in in the second attachment.
    Attached is a sample VI created using an Ni USB 9234 DAQ card. Any card will do but I am only getting the signal from one channel for this example
    I will appreciate any help that can be given to me.
    Thanks
    Attachments:
    Real-Time Graph Display.vi ‏170 KB
    Sampe screen1.doc ‏37 KB

    Long term testing can be tricky- and we'l get into that later.  Lets start with the basics that you have wrong.
    The vi as you have constructed it has only one memory element, the chart history length (default is 1024.)
    You can change the number of points the Chart will remember by Right-clicking the chart an select Chart History Length from the menu.
    But for a long term test - and one where you want to REMEMBER the first value you need a memeory element that is independant of the application.  Your PC WILL loose power or need to be rebooted eventually.  Heck it might even need to be replaced! you really need to store your data in a file. Preferablly in a file that is backed-up on a regular basis so you don't lose every point of data if the PC dies.  It realy hurts when you have to restart a 2yr test because you've lost the 18months of data you collected.
    For an application like this I would seperate my "collection" and "Evaluation" operations. 
    Have one vi that takes the reading and writes it to a file at a configurable rate  You may want 1reading  per minute for seveal days then 1 per hour for a few weeks- then maybe only once or twice a week for the next couple of years since you are looking for LONG TERM stability.  having too much data to evaluate can take a lot of digging to find the few things that interest you (but always take more that you think you need)
    Have another utility that COPIES the files, reads them and displays the data you are interested in that day.  The data you want to look at won't change over time HOWEVER, you WILL want to analize it in different ways depending on what the data trends look like.  Having seperate routines for collection and display allows you to update the display style and analisys without even stopping the collection vi (much less editing the vi)
    Jeff

  • How to add a column to a list created with the Dynamic List Wizard to display the values of the fiel

    Hi,
    ADDT, Vista, WAMP5.0
    We have 2 tables: clients_cli (id_cli, name_cli, tel_cli, and several more fields) and cases_cas (id_cas, idcli_cas, court_cas, and a lot of other fields).
    Clients may have many cases, so table cases_cas have a foreign key named idcli_cas, just to determine which case belongs to which client.
    We designed the lists of the two tables with the Dynamic List Wizard and the corresponding forms with Dynamic Form Wizard.
    These two forms are linked with the Convert Dynamic List and Form Wizards, which added a button to clients list named "add case".
    We add a client and then the system returns to the clients list displaying all clients, we look for the new client just added and then press "add case", which opens the Dynamic Form for cases, enter all case details and everything processes ok.
    However, when we view the cases list it display all the details of the case, including the column and values for the foreign key idcli_cas. As you can image, it is quite difficult for a human to remember the clients ids.
    So, in the cases list we added a another column, named it Name, to display the names of the clients along with cases details. We also created another recordset rsCli, selected the clients_cli table, displaying all columns, set filter id_cli = Form Variable = idcli_cas then press the Test button and everything displays perfect. Press ok.
    Then, we position the cursor inside the corresponding cell of the new Name column, go to Bindings, click on name_cli and then click on insert. The dynamic field is inserted into the table cell as expected, Save the page, and test in browser.
    The browser call the cases list but fails to display the values of the Name column. The Name column is simply empty.
    This issue creates a huge problem that makes our application too difficult to use.
    What are we doing wrong?
    Please help.
    Charles

    1.     Start transaction PM01, Create Infotype, by entering the transaction code.
    You access the Create Infotype screen.
    2.     Choose List Screen.
    3.     In the Infotype no. field, enter the four-digit number of the infotype you want to create.
    When you specify the infotype number, please remember to enter any leading zeros.
    4.     In the Screen Number field, enter the screen number of the list screen you want to enhance.
    5.     Choose Create.
    The Dictionary: Initial screen appears:
    6.     Create the list screen structure.
    7.     Choose Activate.
    8.     Return to the Enhance List Screen in the Enhance Infotypes transaction (PM01).
    9.     Choose Create All.
    The additional fields are displayed on the list screen, however, they contain no data.
    The fields can be filled in the FORM routine FILL-LISTSTRUCT in the generated program ZPnnnn00. The FORM routine is called for each data record in the list.
    Structure ZPLIS is identified when it is generated with a TABLES statement in the program ZPnnnn00.
    The fields can be filled from the Pnnnn structure or by reading text tables.

  • Hide/Show Create button on a report/form page

    Hi, I included one form and the related report on one page.
    When I create a new record, it will show in the report below.
    I make the ID column as the link, which assign the ID to the ID item in the form. DML will do the rest work for display.
    However I got a issue. when I click the edit button for one row, the create button doesn't disappear. Although it has a condition of "VALUE OF ITEM IS NULL". I un-hidden the ID item and it do have value when I edit some row.
    Is this because of some refreshing reason or...?
    Your help will be great appreciated.
    Edited by: Gadfly on 2009-3-16 下午8:02

    BTW, this hide/show pattern of 'KEY VALUE is null' works well when I use two pages(one form and one report.)

  • Creating button in Acrobat 9 form that will email form

    Working on Mac:
    I have created a button in my Acrobat 9 pdf form that has the following action:
    Execute a menu item: File>attach to Email
    When I click on the button it will take me to my email where it is attached and I can send it to somebody. However my HR department works on a PC and it does not work when she clicks on the button. The Reset form and Print forms work fine.
    What can I do to make this work. I do not want a submit button because this form will be filled out by various people who will then email on to their supervisors. I just thought it would be easier for them to have a button to push.
    Thanks.

    The answer will depend on whether the form needs to work with Reader and maybe what version of Acrobat/Reader your users will have. If it needs to work with Reader, the form has to be Reader-enabled, which is an additional step you do as the final step in Acrobat before sending the form to your recipients. Exactly how you do this depends on the version of Acrobat you're using.
    The best approach for your button would be to use the mailDoc JavaScript method, which allows you to set the subject of the email, the recipients (including cc and bcc), and the body of the email. This has been discussed a number of times here before, so you may find more with a search. Post again if you can't find anything.
    You can also use a "Submit a Form" action or the corresponding submitForm JavaScript method, and specify the email address of the recipient using a mailto type URL. This is less flexible than using mailDoc, but is simpler so it may have its virtues.
    Also, not that when responding by email, private info you have in your email signature can get posted to the forum, which you may not want since it's open to the world. You also cannot attach files here, so if you want someone to be able to retrieve it, you'll have to post it somewhere else and provide a link, or get someone to send you their email address so you can send it that way.

  • Scroll bars & creating buttons problem

    I am trying to create a basic photo browser. The upper area is the enlarged view of the image. The lower portion is a scrollable view of the thumbnails in the directory chosen. I have most of it working...except that the scrollable view doesn't scroll, and the buttons that I created don't cause the image to show up in the main view port.
    There is the main window, divided into two parts: upper and lower. The upper part is the main view, as described above. The lower part is a panel. That lower panel contains two things, another panel and a button. This panel inside the lower section contains the scrollable window; this scrollable window is a viewport onto another panel that contains the dynamically created buttons (which are thumbnails of the images in the directory).
    I was trying to force the scrollbar policy to always show the horizontal bar (that is the only one I want visible) but that wasn't working either; I would get compiler errors when that was included. I have tried adjusting sizes of things, and the order that things are added to the main JFrame.
    Any suggestions would be appreciated.
    Here is the code:
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.File;
    import java.io.FileFilter;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.border.EtchedBorder;
    import javax.swing.filechooser.FileNameExtensionFilter;
    * PhotoGUI Browse
    * Description:  Generate a GUI interface for viewing a large view of an image and previews of thumbnails
    * in a directory.  There are two parts to the GUI:  large upper section for main viewing, and a short lower
    * section for viewing the thumbnail previews.  The lower section is also split into two parts:  the left part
    * is a scrollable pane where the thumbnails will be previewed, and then a small section to the right where
    * a button for changing directories will be present.  (I wanted the button to always be visible so didn't
    * put it in the scrollable area.)
    public class PhotoGUI extends JFrame {
         final int SIZE = 75;     //scaling size for images in thumbnail browser
         boolean firstRunThrough = true;               //Changes behavior of directory requester
         private JPanel thumbs;
         private JPanel pickNThumbs;
         private ImagePanel bigView ;
         private JScrollPane scroller;
         private JButton pickDirButton;
         private thumbSelectedListener thumbPicksNose;
         public PhotoGUI () {
              this.setDefaultCloseOperation (EXIT_ON_CLOSE);
              this.setSize(600,600);       //Starting size of the overall container.
              this.setTitle("Eye Photo photo browser");
              //The upper portion of the GUI, where the large view of the image will be held
              bigView = new ImagePanel();       
              //bigView.setSize (600,500);
              //The bottom section of the GUI; will hold the thumbnail previews
              //(in a scrollable panel) and a button for changing directories.
              pickNThumbs = new JPanel();             
              pickNThumbs.setBackground(Color.WHITE);
              pickNThumbs.setSize(600,100);
              pickDirButton = new JButton("Pick directory...");
              //pickDirButton.setSize(75,150);
              dirPickListener dirButton = new dirPickListener ();
              pickDirButton.addActionListener(dirButton);
              thumbs = new JPanel();              //The panel that will hold the thumbnail previews
              scroller = new JScrollPane(thumbs);       //Setting the scroll bar pane to view the thumbnail panel
              //scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
              //scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
              // scroller.setSize(525,100);          
              scroller.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
              pickNThumbs.add(scroller);
              pickNThumbs.add(pickDirButton);
              this.add(bigView);
              this.add(pickNThumbs, BorderLayout.SOUTH);
              String pickedDir = pickDir();               //Setting up the while loop so it will keep requesting
              if (pickedDir.equals("-1")) {
                   if (firstRunThrough)   System.exit(0);          //End program if they don't pick a dir the first time through.
              }else {
                   thumbsUp(pickedDir);                  //They picked good Dir; populate thumbnails
                   firstRunThrough = false;
         public String pickDir () {          
              // This is the file chooser method. 
              JFileChooser dirPicker = new JFileChooser();
              dirPicker.setDialogTitle("Pick a directory");
              dirPicker.setApproveButtonText("Open directory");
              dirPicker.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
              int x = dirPicker.showOpenDialog(getParent());   //maybe I don't need this?
              if (x == JFileChooser.APPROVE_OPTION) {
                   return dirPicker.getSelectedFile().getAbsolutePath();
              } else return "-1";              //Just to cover all possible conditions
         public void thumbsUp (String chosenDir) {
              // Thumb populater method.  It adds each thumb-button to the scroller panel
              thumbs.removeAll();         //Need to remove old directory's buttons
              File selectedDir = new File(chosenDir);
             FileNameExtensionFilter filter = new FileNameExtensionFilter("JPG/GIF/BMP/PNG Images", "bmp", "jpg", "jpeg", "gif", "png");
              File [] dirEntries = selectedDir.listFiles();
              for (File tempFile : dirEntries) {    
                   if (filter.accept(tempFile) && tempFile.isFile()) {       //That way I only get certain types
                        JButton howToNameMultipleButtons = new JButton();
                        howToNameMultipleButtons.setActionCommand(tempFile.getAbsolutePath());
    //                    System.out.println(tempFile.getAbsolutePath());
    //                    System.out.println(howToNameMultipleButtons.getActionCommand());
                        howToNameMultipleButtons.setIcon(new ScaledIcon(tempFile.getAbsolutePath(), SIZE));
                        howToNameMultipleButtons.addActionListener(thumbPicksNose);
                        thumbs.add(howToNameMultipleButtons);
              this.setVisible(true);   //Down here so first run through program opens Dialog before showing
         public class dirPickListener implements ActionListener {
              public void actionPerformed (ActionEvent ae) {
                   thumbsUp(pickDir());     //Opens Dir selection dialog and feeds the thumbnail populater
         public class thumbSelectedListener implements ActionListener {
              public void actionPerformed (ActionEvent ae) {
                   String thumbPicked = ae.getActionCommand();    //Should return path string of thumbButton clicked
                   // System.out.println(ae.getActionCommand());    //TSing step; to see if this bit even fires off.
                   bigView.setImage(thumbPicked);
                   bigView.setToolTipText(thumbPicked);
                   //  bigView.setBackground(Color.GREEN);
    }

    Ah! I got some of it figured out at least...
    Setting the preferred size parameter has caused the scroll bars to display! :) Thanks for the hint on that.
    But I get an error when I try and use the scrollbar policy settings. Here are the results:
    Exception in thread "main" java.lang.IllegalArgumentException: invalid verticalScrollBarPolicy
         at javax.swing.JScrollPane.setVerticalScrollBarPolicy(Unknown Source)
         at javax.swing.JScrollPane.<init>(Unknown Source)
         at PhotoGUI.<init>(PhotoGUI.java:70)
         at PhotoBrowser.main(PhotoBrowser.java:15)And the code I used:
    scroller = new JScrollPane(thumbs,
                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS,
                        ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);       //Setting the scroll bar pane to view the thumbnail panel
              Edited by: Mole_Hunter on Feb 1, 2010 9:57 AM

Maybe you are looking for