How can I do sorting from ascending to descending then unsort?

Hi all,
Can anybody help on this issue?
I have a bunch of numbers in a table, and I hope when I click the column header once, it will do ascending.
Click again, do descending. Then click three times, become unsort (which is origially ordered in absolute value).
I tried to add tree SortKeys in sorter, but it doesn't work:
List<RowSorter.SortKey> sortKeys = new ArrayList<RowSorter.SortKey>();
sortKeys.add(new RowSorter.SortKey(2, SortOrder.UNSORTED));      // 2 means it's the 3rd column I want to sort
sortKeys.add(new RowSorter.SortKey(2, SortOrder.DESCENDING));
sortKeys.add(new RowSorter.SortKey(2, SortOrder.ASCENDING));
sorter.setSortKeys(sortKeys);Then I tried to implement my own Comparator, but will always get numbers ordered in absolute value.
        Comparator<Float> comparator = new Comparator<Float>() {
            public int compare(Float s1, Float s2) {
                if (s1 < 0) s1 *= (-1);
                if (s2 < 0) s2 *= (-1);
                return s1.compareTo(s2);   
        sorter.setComparator(2, comparator);      // 2 means it's the 3rd column I want to sortThank you very much indeed in advance.
Cheers,
George

Apologies for not saying it clearly.
I can easily do ascending and decending by applying this:
        sorter = new TableRowSorter<TableModel>(table.getModel());
        table.setRowSorter(sorter);But I also need my data to be sorted by absolute value. That's why I tried to implement my own Comparator.
However, it turned out that I will only have one sorting method, which is the absolute value as you have noticed.
Hence I hope the result, if possible, would be if I first click the column header, ascending orders.
Click the second time, decending orders. And then click the third time, absolute value orders.
Cheers

Similar Messages

  • How can I record content FROM an iPad and then publish it back to an iPad?

    Everything I search for talks about pushing content out to an iPad, but what if I want to capture/record content from an iPad? I am trying to do a software simulation, rather than a straigh record.
    I did find a third party application called Reflection that allows me to mirror, or reflect, the iPad onto my computer. The problem is that due to the way the content transmits from the iPad, I would have to manually capture each screen and corresponding action within Captivate.
    Any advice on on this?

    Hello,
    Welcome to Adobe Forums.
    I am not sure about the 3rd Party Application but if you can create a .mp4 video of your IPAD simulation then you can insert that video in Adobe Captivate 6 as a Slide Video.
    Thanks,
    Vikram

  • How can I stop iPhoto from reidentifying faces I have already 'crossed', while still being able to identify and sort new faces.

    iPhoto has detected faces of people I dont know, in my 'iPhoto faces' whenever I click the cross in the corner of the face (when sorting faces) the face temporarily disappears, but once I have uploaded a fresh batch of photos (and want to identify new faces) it automatically re-identifies the old photos that I don't want to have to sort again. How can I stop iPhoto from reidentifying faces I have already 'crossed', while still being able to identify and sort new faces.

    Thank you, that makes sense (I think!) However, I need to be able to tell iPhoto who the people identified in my photos are, does that make sense? How do I identify the people in my new photos without clicking 'find faces'. I know that button searches through my photos to find faces, but it also gets me to the place where I identify the faces as my friends and family, is there a shortcut to get to that place without clicking 'find faces'? That is what I really need, please help!!

  • Change sorting in Finder from ascending to descending and keyboard shortcut

    Hallo,
    can someone point me in the right direction of how to change sorting in Finder from ascending to descending and what are the corresponding keyboard shortcuts?
    I am already using the ctrl-cmd+number key shortcuts to modify my sorting, and a Google search produced the answer that I can change from ascending to descending by hitting the key-combination again. But it does not work ...
    Any help ;-)  ?
    Thank you !

    Never heard of a keyboard command to toggle the sort sequence from ascending to descending and back.
    The usual way to change it is to click the highlighted column name in the Finder window.

  • How can I prevent Bridge from altering my photos?

    HELP!!!
    Within the past few days my Bridge CS4 program has been making my life miserable. I had been utilizing the program to batch photos from my extensive photo library, rename them, sort them (i.e., change sort/ordinal number), and the like without any difficulty and then suddenly, after executing such processes my thumbnails turned completely white and would not open in Bridge, Photoshop CS4 Extended - much less anything else. I tried reopening them as .jpg's, .psd's, .tiff's to no avail. I went into properties on each photo and checked the "open with" tab, and it noted that the photo was not recognized. I had some moderate success opening them with Quicktime Picture Viewer, but converting them back to a Bridge readable format (i.e., their original state) proved impossible. Having noticed that Quicktime had hijacked nearly my entire photo opening process, I uninstalled it in the hope that it would solve the problem. It didn't. I then went into Bridge and Photoshop CS4 preferences to try and modify how photos were opened, and couldn't seem to find anything applicable. I did, however, increase the memory and cache allocated to each program substantially.
    Last night I ran into more problems with Bridge. While scanning both photo negatives and prints into Bridge and saving them into various files, I encountered the same problem indicated in paragraph one. I tried scanning several of them a second time and succeeded; however, I had to save them to a different file and give them dissimilar names in .tiff format. In the process I found more than a dozen ways to spell "Mexico," "Tokyo," and "Ukraine"! They would not save as .jpg's or .psd's.
    I use Windows Vista Home Premium SP1, have a Pentium 4 Dual Core (2.8) processor, 4 GB Memory, Nvidia GE Force 7600 video card (yes, the drivers are up to date), and Hewlett Packard Photosmart C7180 and C7280 printers for scanning. All of the photos involved are stored on a Maxtor One Touch 1TB Turbo auxillary hard drive.
    Also, could anyone suggest how I can get the  SD/MMC card reader on my PC to work?
    Thanks to any and all for assisting me with my problem.
    Wolfgang Holst
    Big Bear Lake, CA

    Thank you curt y for your quick response. I have seen your recommendations on the adobe forums link in the past and many of your solutions
    seem to have helped other people with Bridge problems. I took your suggestion and gave it a whirl - all preferences were restored to defaults - and the problem continues. I get the feeling the problems lies with the program's interaction with Windows.
    Having tried a few more things, I've found that I can move the photo shell (the inscription underneath the thumbnail states, "Window Shell Common") to my desktop and open it there with Photoshop (i.e., going through the song and dance of "open with" and clicking on the CS4 icon, where it opens up in RAW). I must then move it over to Photoshop CS4 and save it as a .jpg or a .psd. Unfortunately, after all this it still won't open in Bridge. By all appearances, Bridge somehow has become corrupted and I'm probably going to have to do a complete Photoshop CS4 uninstall and reinstall.
    I've spent hundreds - if not thousands - of hours scanning into my system some 10,000 photographs of my travels (yes, they are backed up on discs), and Bridge should not be negatively impacting my ability to organize and manipulation them as is happening now. If the uninstall/reinstall does not resolve the problem, I'll be back on this forum for more suggestions.
    As for the card reader issue, I'm well aware of the 2GB/over 2GB issue. I typically use a 4GB or more card in my camera. I can download fine through my HP 7180 and 7280 card readers, but my HP 1518n card reader is a different story. I'll work a little more on it, too.
    Thanks again.
    Wolfgang Holst
    Big Bear Lake, CA    
    Date: Thu, 18 Jun 2009 08:49:46 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I prevent Bridge from altering my photos?
    Have you tried resetting your preferences by holding down the Ctrl key and starting Bridge?  You will get a reset window, choose all 3 options.
    The only thing I know about card readers is that there are 2 versions.  One for cards of 2 gigs or less, and one for HD cards over 2 gigs.  Make sure card and reader match.
    >

  • How can I transfer music from my old iphone 4 to the new iphone 5S without having the music synced to my laptop (e.g. my itunes library is empty)?

    How can I transfer music from my old iphone 4 to the new iphone 5S without having the music on the old phone synced to my laptop (e.g. my itunes library on the laptop is empty) ?
    I tried the "Transfer Purchases" option - however this only worked for apps - not sure if I'm missing some sort of setting.
    I do not want to use iCloud as I do not have enough space for my music.
    Thanks!

    You cannot. The music must be in the iTunes library first. See these User Tips:
    Recover your iTunes library from your iPod or iOS device
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • How can I stream video from a P/DVR to my Mac

    Hi, How can I stream video from a Motorola dcx3400m P/DVR to my Mac? I have tried a Slingbox but the audio is out of sync witht the TV and it drives those watching on iPads or on the iMac in another room NUTS.
    Is it possible to use a TV tuner of some sort. I've looked at the eye TV thing but I live in Canada/USA region and the eye TV products all seem to be for Austrailia or the UK. The one product that might work is a DVR and I don't need to pay for that as I already have one.
    HELP!
    Jeff

    If your Mac has an audio input jack you can connect the output of a cassette machine to it (3.5mm stereo jack required). However many don't, so you will need a USB audio interface - Roland make a range. Alternatively you can buy cassette decks with a built in audio interface.
    You will need a program to record and edit the input: Audacity is free and is often bundled with USB-enabled players.

  • How can I migrate data from SQL Server 6,5 to Oracle 8?

    We have a web site based on Microsoft SQL Server 6.5.Now we plan
    to migrate the database to Oracle 8.
    We have redesigned the tables structure and created tables under
    Oracle 8, so we only need to migrate data from SQL Server.
    We've exported data from SQL Server to text files.
    How can we import data from files and restore to Oracle tables.
    Is there a solution which let us to import data for particular
    table columns,not all columns?
    We'll be appreciated if somene can give suggestions.
    Regards
    Michael
    null

    Thank you for your reply.
    I'll try the Oracle sqlloader utility first.
    Regards
    Micahel
    Oracle Migration Workbench Team wrote:
    : Michael,
    : Oracle sqlloader is user for this sort of operation, see
    : Oracle8i Utilities
    : Release 8.1.5
    : A67792-01
    : available online through Oracle Technology Network.
    : The Oracle Migration Workbench can be used to create bcp and
    : sqlloader scripts, though since you have altered the schema
    these
    : scripts would need to be altered by hand after generation.
    : Some thought has been put into redesigning table structures in
    : the Oracle Migration Workbench, but currently it looks like
    this
    : reengineering will be left to be done by other tools, eg
    Oracle
    : Designer, once the SQLServer database has been duplicated with
    as
    : little change as possible onto Oracle.
    : Hope that helps,
    : Turloch
    : Oracle Migration Workbench Team
    : Michael (guest) wrote:
    : : We have a web site based on Microsoft SQL Server 6.5.Now we
    : plan
    : : to migrate the database to Oracle 8.
    : : We have redesigned the tables structure and created tables
    : under
    : : Oracle 8, so we only need to migrate data from SQL Server.
    : : We've exported data from SQL Server to text files.
    : : How can we import data from files and restore to Oracle
    tables.
    : : Is there a solution which let us to import data for
    particular
    : : table columns,not all columns?
    : : We'll be appreciated if somene can give suggestions.
    : : Regards
    : : Michael
    : Oracle Technology Network
    : http://technet.oracle.com
    null

  • I wrongly scratched the gift card and lost few figures of the code, how can this be sorted, I wrongly scratched the gift card and lost few figures of the code, how can this be sorted

    I wrongly scratched the gift card and lost few figures of the code, how can this be sorted, I wrongly scratched the gift card and lost few figures of the code, how can this be sorted

    If this page doesn't help then you will need to try contacting iTunes support (you will need to give them as much of the serial number and activation code from the card as you can read) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes

  • What is the "Other" category under storage and how can i delete items from this?

    My disc is almost full.  "About this Mac" says that I have 47 GB of "Other."  What is this Other and how can I delete items from this?

    For information about the Other category in the Storage display, see this support article.
    Empty the Trash if you haven't already done so. If you use iPhoto, empty its internal Trash first:
    iPhoto ▹ Empty Trash
    Do the same in other applications, such as Aperture, that have an internal Trash feature. Then reboot. That will temporarily free up some space.
    According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation. You also need enough space left over to allow for growth of the data. There is little or no performance advantage to having more available space than the minimum Apple recommends. Available storage space that you'll never use is wasted space.
    When Time Machine backs up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of recently deleted files. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown asBackups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself. If you followed bad advice to disable local snapshots by running a shell command, you may have ended up with a lot of data in the Other category. Reboot and it should go away.
    See this support article for some simple ways to free up storage space.
    You can more effectively use a tool such as OmniDiskSweeper (ODS) to explore the volume and find out what's taking up the space. You can also delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one.
    Deleting files inside an iPhoto or Aperture library will corrupt the library. Any changes to a photo library must be made from within the application that created it. The same goes for Mail files.
    Proceed further only if the problem isn't solved by the above steps.
    ODS can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    If you have more than one user account, make sure you're logged in as an administrator. The administrator account is the one that was created automatically when you first set up the computer.
    Install ODS in the Applications folder as usual. Quit it if it's running.
    Triple-click anywhere in the line of text below on this page to select it, then copy the selected text to the Clipboard by pressing the key combination command-C:
    sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning to be careful. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The application window will open, eventually showing all files in all folders, sorted by size with the largest at the top. It may take a few minutes for ODS to finish scanning.
    I don't recommend that you make a habit of doing this. Don't delete anything while running ODS as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means. When in doubt, leave it alone or ask for guidance.
    When you're done with ODS, quit it and also quit Terminal.

  • HT1918 I don't have credit or Amex or visa how can I download games from AppStore I am new at iPad ?

    Plz answer I don't have credit card or Amex or visa how can I download games from AppStore I didn't found a solution in support in apple reply please

    If you only want the free apps, take a look here:
    http://support.apple.com/kb/HT2534
    Read the steps carefully as the order in which you follow them is  critical. Note that you can do this only when creating a new Apple ID. You cannot use an existing ID. 
    You will of course not be able to get anything other than the free content without entering in some sort of payment method (credit card, prepaid iTunes card, gift certificate, etc.)
    Regards.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base, before you post a question.

  • HT1725 Everytime I plug my phone into to sync, Itunes starts downloading the same rented movie over and over. I go in and delte it from my library but it does it again. How can I stop this from happening?

    Everytime I plug my phone into to sync, Itunes starts downloading the same rented movie over and over. I go in and delte it from my library but it does it again. How can I stop this from happening?

    The sort fields should generally be empty unless you've putting in custom values to sort solo artists by their surnames. You can apply common changes to thousands of tracks at once, just don't apply the wrong change because there is no undo.
    It is a good idea to backup before undertaking large scale changes. See this backup tip for a suggested approach.
    tt2
    Message was edited by: turingtest2

  • How can I move apps from one computer to the other?

    How can I move apps from one computer to the other?
    (preferably without iCloud)

    Backup your iTunes library to an external drive and onto the other computer
    http://support.apple.com/kb/ht1751

  • How can I transfer work from one computer to another?

    How can I transfer work from one computer to another?

    Welcome to the forum.
    I can think of three basic ways to accomplish what you wish to do:
    Use the Project Archiver to archive your Project (and check the box to gather the media files), to an external HDD. Probably the easiest way to do it.
    Copy the Project and ALL media files to an external HDD, but be prepared to relink the media files to the Project, as the drive letter (part of the Absolute Path) will have changed.
    Edit loosely, and Share to an AV file, which will be Imported into a New Project on that second computer. Or, edit VERY tightly, and do the same. I like the first, as removing, replacing Transitions, etc., can be much more difficult, unless that "tight edit" is 100% done.
    Good luck,
    Hunt
    Message was edited by: Bill Hunt to correct formatting

  • How can I transfer information from one ipad to another?

    how can I transfer information from one ipad to another ?

    What kind of information? You can sync things like Contacts and Calendars by using iCloud. You can backup one iPad to iTunes on a computer and then sync the backup to the other iPad. You can configure your iTunes content and sync the same content to both iPads.
    It is based on what you want to do. Or are you looking for a way to send files from one iPad to another wirelessly? There are apps to do things like that, as well as cloud services, such as DropBox.

Maybe you are looking for

  • How can i transfer my ipone 5s itunes the is in one computer to itunes in a different computer?

    I want to download songs by using iTunes. Now, my iTunes account is in one computer and when I connect my iPhone 5s to a different computer that is much better to work on, it tells me that my iPhone is connected to to iTunes in a different computer a

  • $x_disableItem(pNd, pTest) api call does not work in IE

    Hi, I am trying to use $x_disableItem(pNd, pTest) api in my application. It works great in Firefox but not at all in Internet Explorer. How can I make it work in both browsers? Thanks, Venkat Environment: Oracle 10g APEX 4.1 Firefox 10.0 Internet Exp

  • New patch update (build 282) for Oracle VM Manager 3.0.3

    We have a patch update for Oracle VM Manager 3.0.3. Customers can download it by following instructions from OTN download page: http://www.oracle.com/technetwork/server-storage/vm/downloads/index.html Or go directly to the link below: Oracle VM Manag

  • Ipod nano 1st gen not syncing

    My ipod nano 1st gen is not syncing properly. When I plug it in and itunes starts up, it begins the syncing process, but gets stuck midway through. I have it set to only sync checked songs and a specific playlist. Also, it still has enough memory. Ca

  • Real time effex in iLife 6 slow my video down not bad but some what slow.

    Real time effex in iLife 6 slow my video down not bad but some what slow. When I go to try out different effects it makes my prevue slow as I am looking at it in real time seeing what the effect looked like. I am using a i Mac G5 250gb and 1g of ram.