Sort JCheckBox table column using Collections.sort()

Hello,
I'm trying to add a JCheckBox column to a JTable component but am having a problem with sorting. The problem is that I don't know how to do it. I've tried several different ways without any luck. I would like to use the "java.util.Collections" class for the sorting of the DataVector within the DefaultTableModel (though I did get it to work with shaky implementation of sort that I found on the web).
Any help would be wonderful.
- Dan

Chapter 18, Section 18.5 http://www.spindoczine.com/sbe/

Similar Messages

  • How do I sort data in columns using Pages

    How do I sort data in columns (alphabetically) using Pages?

    If you are referring to text or numbers in a column (not table), then get the free Service plug-in WordService, from Devon Technologies. Put it in the
    /Users/yourlogin/Library/Services folder location.
    Select your data to be sorted. From the Pages menu > Services > Sort Ascending will do the trick. This will work with Pages ’09 and Pages v5.2 or later, as well as Apple Mail, TextEdit, etc.
    The WordService files include a PDF (Read Me) that describes the services included with the package.
    The Service items will only appear in the Services submenu when you have selected your data prior to sort. If these WordService items do not appear in the Services menu as they should per the preceding sentence, then you will need to enable them.
    System Preferences > Keyboard > Shortcuts > Services. Scroll through the right hand list of services until you encounter Sort Ascending and ensure that it is selected.
    If you were referring to sorting a column of data in a table:
    Pages ’09
    Select all cells containing your unordered data. In the Table Inspector, under Edit Rows & Columns, choose Sort Ascending.
    Pages v5.2
    Select cells as before. In the Table heading (A, B, C, etc.) when you roll over the letter, a down-arrow appears. Click, and choose Sort Ascending from the drop down menu.

  • Custom sort pivot table columns with Essbase as the data source

    Is it possible to sort columns in a pivot table according to an arbitrary value that I define when the data is coming from Essbase?
    For example, say I have a dimension called Soda, with values Coke, Diet Coke, Dr. Pepper and Diet Dr. Pepper. I create a report with a sales measure with the measure labels on the rows and the Soda dimension on the column. By default the columns will be sorted alphabetically:
    Coke Diet Coke Diet Dr. Pepper Dr. Pepper
    Sales 1M .5M .75M 1.25M
    I want to create a report that looks like this:
    Coke Diet Coke Diet Dr. Pepper Dr. Pepper
    Sales
    I think I could do this if the source was relational just by creating bins or creating a custom column with a case statement that assigns each Soda an arbitrary value and then sort on this value. Everything I've tried with Essbase as the source, though, results in:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42043] An external aggregate is found in an outer query block. (HY000)
    Any ideas?

    Hi,
    1. You can try solve the 'An external aggregate is found in an outer query block' by changing aggregation rule for your measure both in physical and business layer.
    By default it's set to Aggr_External - change it to Sum
    In physical : Column properties->Aggregation rule
    In business model : Column properties->Aggregation tab -> Default aggregation rule.
    This may change the result - after changing check whether you still get correct values.
    2. Also, in case the desired order is the same as the order of members in the Essbase cube, and you want to leave Aggr_External, you can create a calculated column that will help you with the sort.
    See http://oraclebizint.wordpress.com/2008/04/28/oracle-bi-ee-101332-handling-sort-order-in-hyperion-essbase-931-evaluate-and-mdx/
    Hope this helps,
    Alex

  • Compile error when using Collections.sort for Vector, why?

    The compiler is giving an error when trying to do this (I'm using JDK 1.5.0_09):
    Vector <String> test = new Vector <String>();
    test.add("test1");
    test.add("test2");
    test.add("test3");
    Collections.sort(test);The error being:
    The method sort(Vector<String>) is undefined for the type Collections
    Collections.sort takes List, but Vector is of type List, so this should work, correct?

    ChuckBing wrote:
    No. Vector is not a subclass of List. Use List.um.. Vector implements List

  • How can i use Collections.sort

    hi! i hope someone can help me. Im trying to sort a list that has Strings on it...
    list.add("rmjBBrmj");
    list.add("rmjAArmj");
    list.add("rmjDDrmj");
    list.add("rmjCCrmj");
    How can i use the "Collections.sort" if i wanted it sorted by the capital letters, like rmjAArmj,rmjBBrmj,rmjCCrmj,rmjDDrmj. Thank you very much for your help.

    You override the "natural" sort order by suppling a Comparitor which orders any pair of strings as you see fit, e.g. convert them to upper case before comparing.

  • List of SA,Tables,Columns used in the reports

    Hi Experts,
    We have 5 dashboards and nearly 35 reports from different subject areas now we want to make a list in the excel which
    subject areas,tables,column names ,formulas used in that columns as been used in the particular reports.
    As we have complex reports so it is very hard to check manually is there any option to check all these.
    Thanks,

    Use catalog manager to build a report.
    Open catalog then Select folder->Tools->Create Report
    save it as .csv and open in spreadsheet
    You may have to generate rpd doc since expressions are shared in report level and also in rpd level
    Pls mark correct/helpful

  • Map excel columns to oracle table column using forms 6i

    Hello,
    I am importing data from excel to oracle table using oracle forms 6i.
    Suppose my table have 3 columns id, name,sal. The excel sheet i am importing having
    3 or more colums, also excel sheet columns are not in order as per table columns.
    i.e my table have id, name, sal
    and excel have name, sal, id
    my question is how can i map excel colums with table colums and insert it into table.
    I am using oracle 6i forms (ole2 package).
    Thanks

    What was wrong with the first answer to the same question?
    Re: map excel columns on oracle forms and insert it into database

  • Reg. Updation of PRPS table columns .use of  BAPI_BUS2054_CHANGE_MULTI

    Hi,
    I have used the sequence of BAPI calls as provided below.
    BAPI_PS_INITIALIZATION
    BAPI_BUS2054_CHANGE_MULTI
    BAPI_PS_PRECOMMIT
    BAPI_TRANSACTION_COMMIT
    I would like to update some columns of PRPS table for specified WBS element, uploading data from an excel sheet.
    I get the data from excel sheet to an internal table and pass to BAPI_BUS2054_CHANGE_MULTI row by row.
    It's strange ! .it updates every column for all the row of data w.r.t WBS element But  location field for first row data element get updated and rest ignored.
    can you please suggest me why it happens so?
    Thanks in advance.
    Regards,
    Sourya Prakash.

    Thanks for other responses I got .

  • 'sort' icon in the header of table column

    Hi everybody,
    I am using table UI element in WD ABAP. Table columns can be sorted and the method fro event 'onSort' is defined.
    On each table column header a tool tip with icons  &#9650;&#9660;  appears when the cursor is moved over the right side of the column header.
    Is it possible to make this icon appear on the right of each column header permanently? 
    Thank you for your help,
    Helen

    Hi Jörg,
    We are using IE6 or IE7. And nothing appears. ONSort action exists and defined.
    May be I will create internal message for ABAP WD.
    Kind regards,
    Helen

  • Can data be sorted by multiple columns in numbers version 3

    Since upgrading Numbers to version 3 (now 3.0.1) I have been unable to sort data in spreadsheets using multiple columns.  Anyone found a solution?
    Regards
    kurrajong60

    Here's a simple example. Say you want this sorted first by Region then by Name then by Amount.
    So if you set up a sort index column with a simple formula and all you have to do is this (two clicks):
    Giving you this:
    Of course you could do it as I think Hiroto is suggesting and manually sort first by column B, then sort by C, then sort by A.
    But that's a lot of trouble and it's easy to confuse the order so you end up having to start over again.
    SG

  • Sorting internal table

    Hi all,
    I have a scenario wherein i have to sort the internal table without using the sort function( i.e sort syntax).Is there any logic.
    Can nebody pls help me out.
    Regards
    Jak

    Hai,
    To understand bubble sort, think of an air bubble rising in water
    To sort N items, N passes are made through the data.
    The result of the first pass is that the smallest item is in the last location of the array.
    The result of the second pass is that the second smallest item is in the second last location of the array.
    etc.
    After N passes, the entire array is sorted.
    The operation in each pass is as follows:
    First, the values in the first two locations are compared. If necessary the values are exchanged, so that the smaller one is last.
    Then, the values in the second and third locations are compared. If necessary the values are exchanged, so that again the smaller one is last.
    This process repeats to the end of the array.
    In effect, the smaller item bubbles its way towards the top. It keeps on going until either it reaches the top (and the pass ends), or it strikes a smaller item. In that case it stops itself, and gives that smaller item a nudge to start it on its way.
    If a complete pass is made without any exchanges being made, the data must already be sorted. This is easily checked. Thus it might be possible to halt the algorithm without going through all N passes.

  • A selected row in af:table does not get sorted.

    Hi,
    When a table supports single selection and the table contains quantity of rows gt it can fit into its viewport, then, on sorting, selected row gets out of the sorting process. But when you move to the end of the table, select a row there and then sort the table, then all rows sorted correctly. The selected row, after sorting, always set as a first row in the current viewport, doesn't matter whether it is in the order or out of it.
    Noteworthy, when number of rows is lt the viewport allows:
    1. sorting works as it should to;
    2. on sorting/PPR'ing, as it gets some time, one can see how the viewport updates in two steps and in the first step the first row is the selected one.
    JDev's version is 11.1.1.3.0.
    VO, iterator and tree bindings, af:table all the props related to data retrieving, fetching and row displaying have default values.
    What can cause that?
    Thx,
    Y.

    Hi,
    so what you are saying is that the selected table row is not sorted but added on top. I tried to reproduce this with 11.1.1.3 but can't see the issue. I tried with editable and read-only tables
    Frank

  • Dynamic Component in Table Column

    JDev 11.1.1.6
    Can anyone give me guidance on how to change the component that a table column uses at runtime?
    Basically, I want to have an Input Text on Column B when the value on the Output Text on Column A is within a list of strings.
    Otherwise, I want to have an image on Column B.
    Here is the long-winded scenerio:
    I have a table with 2 columns (Column A and Column B).
    Column A is an OutputText.
    Column B is an InputText.
    The user is only allowed to enter data into Column B when Column A is 'A', 'B', or 'C'.
    If Column A is something other than 'A', 'B', or 'C', I would like to display an image in Column B that alerts the user that they cannot enter any data in this field.
    I tried making the InputText read only, but that doesn't look very good.
    Any help would be appreciated.
    Ray

    You can add image component to the same column and use rendered property on both af:inputText and af:image to show/hide them.
    Dario

  • Hide button in table column

        Hi ,
        I have added 2 buttons in one table column using layout. if the bindproperty for that column is "Approved" than that buttons set to false, if the bindproperty is "Pending" than buttons get visible. i am trying this code, but it is not going to that if condition and switch case
         oTable.addColumn(new sap.ui.table.Column({
          label: new sap.ui.commons.Label({text: "Status"}),
          template: new sap.ui.layout.HorizontalLayout({id:"HL",
            content : [
              new sap.ui.commons.Button({id:"btn1",
                text: "Assign status"
              new sap.ui.commons.Label({}),
              new sap.ui.commons.Button({id:"btn2",
                text : "Deny"
         ).bindProperty("visible","Status",function(oEvent){
          var bt = sap.ui.getCore().byId("HL");
       //   var bt1 = sap.ui.getCore().byId("btn2");
         // var bt2 = sap.ui.getCore().byId("btn3");
          if (oEvent === "Approved"){
           bt.setVisible(false);
    i am trying to use Switch case also
       /* switch(str)
                 case 'Approved' :
                  return bt.setVisible(false), bt1.setVisible(false),bt2.setVisible(false);
                 case 'SE' :
                  return bt.setVisible(true), bt1.setVisible(true),bt2.setVisible(true);
    Can anybody help me in this
    Thanks & Regards,
    Jayasree.

    Hi Robin,
      We tried that is useful, now we are doing same for Table col template.     In template I am having one button and one textview( i used horizantal layout for this).
         oTable.addColumn(new sap.ui.table.Column({
          label: new sap.ui.commons.Label({text: "Status"}),
          template: new sap.ui.layout.HorizontalLayout({id:"HL",
            content : [
              new sap.ui.commons.Button({id:"btn1",
                text: "true"
              new sap.ui.commons.Label(),
              new sap.ui.commons.TextView({id:"TV1",
                text : "True"
              new sap.ui.commons.Button({id:"btn2",
                text: "false"
              new sap.ui.commons.Label(),
              new sap.ui.commons.TextView({id:"TV2",
                text : "false"
         ).bindProperty("text","Status",function(oEvent){
          var bt1 = sap.ui.getCore().byId("btn1");
         var tv1= sap.ui.getCore().byId("TV1");
         var bt2 = sap.ui.getCore().byId("btn2");
         var tv2= sap.ui.getCore().byId("TV2");
          if (oEvent === "1"){ //true
           bt.setEnabled(true);
    tv1.setEnabled(true);
          else (oEvent === "0"){ //false
           bt.setEnabled(false);
    tv1.setEnabled(false);
    i am trying to use Switch case also
       /* switch(str)
                 case '1' :
                  return  bt.setEnabled(true),tv1.setEnabled(true);
                 case '0':
                  return  bt.setEnabled(false),tv1.setEnabled(false);
    but no use it is not able to bind text and button property at a time.

  • Encrypt a table column

    Hello,
    How can I encrypt a table column using oracle. It is more like the password column of the dba_users dictionary views.
    Michael Enudi

    Two other options.
    1.DBMS_CRYPTO
    http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/apdvncrp.htm#sthref2539
    2.DBMS_OBFUSCATION_TOOLKIT => enables an application to encrypt data using either the Data Encryption Standard (DES) or the Triple DES algorithms.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_obtool.htm#sthref4962

Maybe you are looking for

  • Create a animated icon using Adobe Edge...

    Hi there, I have never used Adobe Edge but before I install I wanted to know if it could create a animated icon that's looping and that has transparencies... I have tried animated gifs, but the transparency suck big time... I have tried APNG but Chro

  • How do I transfer data from my passport to my macbook?

    How do I transfer data from my passport to my macbook?  It recognizes the passport as I can see all of the information, but I can't get away from the "checking for sources" spinning wheel.

  • Working with PreparedStatement

    Hello , I want to know how to use varbinary data in PrepareStatement using jdbc driver. I have tried to use setBytes() for setting parameter to prepare statement but it does not work, and it doesn't throw error. I got a resultset with no rows in it.

  • Why do we use jsp instead of servlet

    why do we use jsp instead of servlet

  • Convert .txt file into .xml file

    Hello, How do i convert an .txt file into an .xml file using labVIEW function?. Also i do i extract the header from the text file. My file format is mentioned in attached .txt file. Also I need to extract the header from the converted .xml file. Anti