Using a JCheckBox to select all...

In my program there is a window which contains a panel which has an array of jcheckboxes in it, within another panel on this frame I want to have a single check box that when selected will select all of the checkboxes in the array and when unselected will unselect all fo the checkboxes in the array. Does anyone know how to do this?

So I've stumbled upon an answer to my own questions so I thought I would share it in case anyone else comes across the same issue. In this code the array "thelist[]" is an array of checkboxes:
       final JCheckBox selectall = new JCheckBox("Select All",true);
        selectall.addActionListener(new
                ActionListener()
                        public void actionPerformed(ActionEvent event)
                            if(selectall.isSelected() == true)
                                for (int i = 0; i < thelist.length; i++)
                                thelist.setSelected(true);
else
for (int i = 0; i < thelist.length; i++)
thelist[i].setSelected(false);

Similar Messages

  • Using band zoom to select all data points within the band

    I'm feeling stupid this morning. I'm a new user with 2011, but haven't figured out how to copy a portion of data. I can use view 2D axis system to view my data. Then I use band zoom to get to the portion I need, but for the life of me I can't get it to copy that portion. I have set flags at the beginning and end and such, but the best I get is the beginning point, a single no value point and the end point. I am not getting all the points in between the flags. Am I supposed to somehow flag all points in the zoom view? I have done a search, but can't figure out what I am doing wrong.
    Robert
    Solved!
    Go to Solution.

    Hello Robert,
    This is a pretty easy and straight forward thing to do:
    Put you data into the VIEW window. Then pick the BAND cursor in the toolbar (see below)
    Select the "Set Flags" icon in the VIEW windows with the data and the Band Cursor:
    After you have the data selected with the FLAGS (the data points will be displayed in a thicker line style) click on the "Copy Data Points" icon:
    You will get a full copy of the data in the band, copied to a  new channel in the Data Portal. In the example below I dragged the new data into both windows (not that the red data is still highlited by the flags, this it's a thicker line style).
    That should answer your question, please let me know if you have additional questions,
         Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • I created folders in iphoto on my imac, synch using itunes and selected all photos from iphoto but those albums don't show up...most my albums do but a few don't!??

    I have a new iMac and I'm a new mac user....I have an iphone5..and ipad2.
    I have created folders on the imac in iphoto.
    I am synching the ipad and iphone with mac using itunes...selecting all photos, 3,500+ and although all the pictures may be sharing on all devices, the folders aren't.
    I have created several folders and copied pictures into those folders and they look fine while in iphoto....but I can't get the to synch into ipad and iphone using itunes.

    Folders in iPhoto do not contain photos. Albums and Events do. Folders can contain albums, but not photos on their own.
    So, do you mean Albums?

  • Select all in email

    I'm a new iMAC owner and how do I use the mouse to select all in email? What I want to do is delete all the emails in my trash. On a PC I can right click and select all would appear. On my iMacI know I can use cmdA or move the cursor to edit on the task bar at the top and click select there. Both these solutions are combersome. Further, can I right click in text to get to select all?
    Thanks,
    Mr. Allen

    You can arrange to have the Trash mailbox emptied on a regular schedule. Open Mail preferences, click on the Accounts icon in the toolbar. Select your account. Click on the Mailbox Behaviors tab. You can configure the Trash mailbox to be emptied regularly by selecting an option from the drop down menu.

  • How to select all the frames in a document?

    i did select only particular active session.is it possible to select all the frames in a document?

    Hi vinothvijay,
    You can use below interface to select all the frames in the document.
    ISelectionManager* selMgr = Utils<ISelectionUtils>()->GetActiveSelection();
    if(selMgr)
       selMgr->SelectAll(ac,nil);
    Regards,
    Santosh K.

  • Using Itunes 12.0.1.26 on iMac with Yosemite 10.10.1.  I 'select all' to highlight, dragg

    I have Itunes 12.0.1.26 on my home iMac (mid-2011) with OS X Yosemite 10.10.1. I have been using 'select all' to highlight a playlist of 42 songs which I've purchased on iTunes and dragging and copying them to a Lexar USB flash drive. They appear to copy onto the flash drive but my philips shelf CD USB player shows "no songs" when I put the flash drive into it. I've also noticed that the songs on the flash drive under "kind" show either "protected MPEG-4 audio" or "Apple MPEG-4 audio". What I am I doing wrong that I can correct so I can take this flash drive around with me and listen to my music on other devices with USB ports?
    Thanks, Nick

    I would like to join this discussion. here is my contribution:
    It has been a problem for me over time (spans several versions of both iPhone, iTunes and MACOSes)that iTunes does not sync properly between my MacBookPro and my iPhone.
    The problem persists even on iPhone 6.
    The problem is easily described: I buy a song on iTunes on my MaBookPro iTunes client, and add it to a playlist. Then I ask the same client to sync the new song and the playlist addition of it to my iPhone. This never works the way you would expect from Apple software. The efforts I have to make to get the new song and the playlist addition over to my iPhone (like restarting both MacBookPro and iPhone, repeating the Sync-request until one of the devices hangs, or else the Sync-process uses huge amounts of time and behaving strangely and illogically from one request to the other, etc) remind me of the worst and most clumsy versions of Windows.
    Obvioulsy this problem has been reported many times. Why isn't it solved? Is it because Apple does not want to, or is it because they can't?

  • Using (Select All) for report parameter

    Hi there,
    I am Looking for assistance in making the the (Select All) option work for a particular report. The parameter is for product families (which there are about 47 unique results for). The report is also influenced by two other parameters, one being a date type
    i.e 'MTD' 'YTD' 'MAT'. When a long date type such as MAT is selected, selecting all families causes the report to get stuck in an endless loop.
    I've tried creating my own <Select All'> item in the parameter dataset, then I have the opposite issue, the <Select All> selection works perfectly but when I try and tick two or more product families I recieve the following error:
    "An expressions of non-boolean type specified in a context where a condition is expected, near ',' "
    Parameter Dataset:
    SELECT '<Select All>' AS family_description, '<Select All>' AS family_code
    UNION ALL
    SELECT DISTINCT family_description, family_code
    FROM dim_item AS item
    ORDER BY family_description
    Snippet From Main Report Dataset:
    Where
    sales.oe_branch_code IN (@Branch)
    And
    sales.order_status <> 'X' and sales.line_status <> 'X'
    AND (item.family_code IN (@Family) OR @Family = '<Select All>')
    Any help is appreciated
    Thanks Kindly
    SQL Novice

    Hi KCBA,
    I have check the query you have provided the issue cause by the query "
    AND (item.family_code
    IN (@Family)
    OR @Family =
    '<Select All>')" you are using which is incorrect.
    If the parameter @Family have set as "Allow multiple values" then you don't need to add new label "Select All" for the multiple value parameter already have this section, if the parameter @Family is not the multiple values
    parameter and you want to select all the values or just select one, you can modify the query as below which will works fine:
    "AND (item.family_code =
    (@Family) OR
    @Family = '<Select All>'
    If you are using the stored procedure and have issue about add multiple value parameter in the where clause, you are take reference to below similar case about how to create an function to make it work:
    Passing multi-value parameter in stored procedure ssrs
    If I have some misunderstanding, please try to provide more details information about the relationship of all the parameters (Cascading or not ), current result  you have got and expect result you want(Snapshot).
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Using Select all to create multiple lines in a sales order

    Hello SAP experts,
    In our business practice users create multiple line sales orders with reference to contracts and use the copy paste method and then assign each line to the contract manually.
    After a few years of this practice i found a new way to create multiple lines but it doesn't quite work correctly. When you have created the first line of an order if you click on the select all button the system will ask you how many lines do you want to copy. I don't know if this is standard SAP but 3 things don't happen when we use this 1) The schedule line information is blank 2) conditions do not copy from the contract even though the contract has been referenced. 3) Since there is no schedule line information the order fails when saving and we get a update terminated message.
    I am having problems finding any documentation around this function so any help with this would be greatly appreciated.
    error when updating is
    Transaction..   VA01
    Update key...   4D358878A8B601AAE10080000A2C4982
    Generated....   28.01.2011, 13:47:23
    Completed....   28.01.2011, 13:47:23
    Error Info...   00 671: ABAP/4 processor: GETWA_NOT_ASSIGNED

    GETWA_NOT_ASSIGNED
    Many threads are there on this error message and you would come to know if you google with this text.  Check couple of threads where  the same topic was discussed
    [Re: GETWA_NOT_ASSIGNED|Re: GETWA_NOT_ASSIGNED;
    [Re: GETWA_NOT_ASSIGNED ABAP Dump|GETWA_NOT_ASSIGNED ABAP Dump;
    Also there are some 20 OSS notes on this error message and you can have a look at the following notes:-
    1)   Note 913679 - VA01: Short Dump GETWA_NOT_ASSIGNED on click of quantity.
    2)   Note 591955 - ABAP runtime error GETWA_NOT_ASSIGNED
    3)   Note 870670 - SD_SALES_DOCU_MAINTAIN_DIALOG termination with GETWA_NOT_***
    4)   Note 141314 - VA02: Dump with 'GETWA_NOT_ASSIGNED'
    thanks
    G. Lakshmipathi

  • How do you SELECT ALL on a page (used to CTRL L-CLICK in margin then mouse over selection)?

    In Pages 4x you could hold CTRL+LEFTMOUSE while in the margin area then select multiple things on that page you were looking by mousing over them (including selecting all).  Now you have to go one item at a time to delete? Is there a work-around?

    Ghazgkull wrote:
    . ctrl+clicking in iTunes selects all.
    No, it does not. You are still incorrect.
    ctrl + click does NOT select anything.
    It checks all boxes when you ctrl click on one box.
    If you want to select a bunch of consecutive songs...
    Select one then Shift click another, This will select all items from the first selection to the last selection.
    This is just plain nutty and is normally achieved on Windows 7 using ctrl+a,
    No it doesn't
    ctrl + a selects all.
    You are not selecting anything when you check all boxes. You are sinmply checking all boxes.

  • How do you select all paragraphs using the same style in Pages 5.2?

    I'm trying to find how to select all paragraphs using the same style in Pages 5.2 without any success.  I writing a book and I need to able to adjust all my paragraph styles globally.  I see how upgrade my paragraph style when I do something new, but not how to revert back to the orginal template.
    For example, in my custom template for my book I have 12 font for a review questions paragraph style.  I changed the font size for all this paragraph style to 18 font.  Now I want to change it back to size 12 font.  But I have this paragraph style at the top and bottom of my document.  How to I select all of my review questions style so I can make the font change to all at the same time? 
    I just upgrade to Pages 5.2 from Pages '09. 
    Thanks for the help,
    Rob

    The Pages User Guide might help here.
    Better to post your topic in the Pages designated community > Pages: iWork: Apple Support Communities

  • "all my music is unchecked.  I can not check whole playlists by using the top checkmark to select all.  I went to all my playlists, same thing.  I can only press them ONE at a time, which will take about a day to check all of them." Please help.Windows7

    "While in MY MUSIC on itunes, all my music is unchecked.  I can not check whole playlists by using the top checkmark to select all.  I went to all my playlists, same thing.  I can only press them ONE at a time, which will take about a day to check all of them.
    any ideas?  anyone have same problem?  This just happened since last update." I have windows7

    Thanks A Lot! I should have clicked: "This solved my question" But Thanks all the same!

  • I sent iTunes to trash. I was able to recover the program but have to "put back" songs one at a time. Is there any way to put back from trash using the "select all" command?

    I sent iTues to trash by mistake (trying to delete files from "yesterday"). I got the program back but have to "put back" songs one at a time. Is there a way to put back multiple songs using the "select all" command or anything else? Thanks for the help.

    The prgram is in one location and the library (media + library files) are in another. Sending it all to the trash would take some pretty delibrate multiple actions and digging through multiple folders, so I don't know how this was managed unless there's something in Snow Leopard that's new. Occasionally I have moved a file to the trash in Finder that I didn't want to and I can use Finder's "undo" to undo the last move. With many files...?

  • I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and I find it very annoying.

    I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?

    . Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?
    Check, if you have the "Primary Only" option enabled. Then keywords will only be applied to the "Primary Image":
    See:                  Keywords or ratings are applied only to one of the selected images - why?
    Uncheck the little square button with the "1".

  • Have a question I do not use mail in my computer I use yahoo and I have all these emails and selected all and then delete then delete trash and they always come back how do I stop these old email in apple mail? I never send anything from there but I have

    have a question I do not use mail in my computer I use yahoo and I have all these emails and selected all and then delete then delete trash and they always come back how do I stop these old email in apple mail? I never send anything from there but I have the same email in yahoo but delete them and they still show up in apple mail from day one how do I get rid of these once and for all.Please help
    <Edited by Host>

    I am soooooooooooo confused now.  Ok, if you are having problems with Yahoo Mail and Gmail but you do not use Apple's Mail you need to do the following:
    1 - Post in Yahoo's Mail forums and/or contact their tech support.
    2 - Post in Gmails forums and/or contact their tech support.
    Neither of the above are Apple's products.

  • Selecting all columns makes oracle use more indexes than only selectng one?

    I have 3 queries here that differ only slightly, conceptually, but the plans are massively different. What I cant work out is that the difference is only in the select list.. The fields referenced in the where clause are properly indexed for this purpose
    SELECT
      scc.expiry_date
    FROM
      bw3.int_file_log_details  ifld
      INNER JOIN
      bw3.svc_card_status_change scsc
      USING
        (institution_number, file_number)
      INNER JOIN bw3.svc_client_cards scc
      USING
        (card_number)
    WHERE
      institution_number = '00000001' AND
      file_number = '00002504'This one above does a full table scan of SCC, over 3.5 million records
    SELECT
      card_number
    FROM
      bw3.int_file_log_details  ifld
      INNER JOIN
      bw3.svc_card_status_change scsc
      USING
        (institution_number, file_number)
      INNER JOIN bw3.svc_client_cards scc
      USING
        (card_number)
    WHERE
      institution_number = '00000001' AND
      file_number = '00002504'This one above does an index fast full scan of SCC's pk (which is cardnumber), as does doing a "SELECT null as dummy FROM..."
    SELECT
    FROM
      bw3.int_file_log_details  ifld
      INNER JOIN
      bw3.svc_card_status_change scsc
      USING
        (institution_number, file_number)
      INNER JOIN bw3.svc_client_cards scc
      USING
        (card_number)
    WHERE
      institution_number = '00000001' AND
      file_number = '00002504'This one above does the index range scan of the columns mentioned in the where clause and two index unique scans to link in IFLD and SCC (because they are joined on their PKs)
    I would expect all queries to run this way and completes in ~0.01 seconds
    Now, I get that oracle will sometimes use only an index instead of a table access when the requested data can be got from the index, but the actual query is pulling data from some columns not in indexes, so must be accessed in the table:
    SELECT
      scsc.card_prod_data as "Field1",
      substr(card_number,1,4)||' '||
        substr(card_number,5,4)||' '||
        substr(card_number,9,4)||' '||
        substr(card_number,13,4)||' '||
        substr(card_number,17) as "Field2",
      '                           ' as "Field3",
      scc.emboss_line_1 as "Field4",
      scc.emboss_line_2 as "Field5",
      TO_CHAR(TO_DATE(scc.last_issued_date, 'YYYYMMDD'), 'MM/YY ')||
        TO_CHAR(TO_DATE(scc.expiry_date, 'YYYYMMDD'), 'MM/YY  ')||
        '    ' as "Field6",
      'B'||
        card_number||
        '^'||
        RPAD('0', 27, ' ')||
        '^'||
        to_char(to_date(scc.expiry_date, 'YYYYMMDD'), 'YYMM')||
        service_category_code||
        '000000000000' as "Field7",
      card_number||
        '='||
        to_char(to_date(scc.expiry_date, 'YYYYMMDD'), 'YYMM')||
        service_category_code||
        '000000000000' as "Field8",
      card_number as "Field9",
      scsc.cvv_cvc2 as "Field10"
    FROM
      bw3.int_file_log_details  ifld
      INNER JOIN
      bw3.svc_card_status_change scsc
      USING
        (institution_number, file_number)
      INNER JOIN bw3.svc_client_cards scc
      USING
        (card_number)
    WHERE
      institution_number = '00000001' AND
      file_number = '00002504'This query above, which uses some data from all tables, does a table full scan of SCC, yet if I SELECT * FROM.. I get the expected index usage and table access by index rowid for all tables..
    Why is oracle doing an FTS when I choose only some columns, yet doing index access when I select * ?
    Edited by: charred on Oct 5, 2010 11:37 AM

    Selectivity of indexes?
    For a query linking these tables:
    int_file_log_details <-> svc_card_status_change <-> svc_client_cards
    I'm expecting Oracle to:
    Use an index range scan of the index on svc_card_status_change that is a nonunique index of institution_number and file number. Selectivity of this index is:
    1 institution number in the entire table
    59 distinct file numbers in the entire table
    4.1million records in the entire table
    From there, with the records it found, to use index unique scan of the PKs of int_file_log_details (file_number: 1 record required) and PK of svc_client_cards (card_number: poetntially thousands of records required)
    I can understand if oracle might decide it can get 69k records out of 4.1 million faster by FTS the cards table rather than having the indirection of the index... what I cannot understand is:
    If I select all the data from the query (SELECT *) it does unique index scans for the 2 records
    If I select say, only one non-indexed non-joined column from each table, oracle prefers a FTS of the cards table..
    Is oracle not realising that there are only 2 records I need out of cards? Why would select * differ? Is it that oracle thinks "select * is a large amount of data, so it'll be faster to use the index and target certain rows" vs "select one_column can be garnered more quickly by scanning the table and generating a lower overall memory load" ?

Maybe you are looking for