2 Movies Deleted When Adding More Videos

I was Adding some music videos, but when i was done i check all the sections and 2 movies that i had stored are gone. Is there a limit to how much video content you can have or am i doing something wrong?

There is a limit for the 30gb to 7 500 songs, 75 hours of video and i think 25 000 photos. I don't know what the 60gb is but yes there is a limit

Similar Messages

  • IDVD 7.0.2 crashes when adding more movies

    I am using iDVD 7.0.2, because I have the old 17" Mac laptop.
    The iDVD crashes when adding more than one movie and trying to save the project.
    Any idea about that ?

    I'm assuming you really mean 20GB's or more of hard drive space rather than RAM memory .... only because I don't anyone on this forum with 20GB's or more of random access memory.
    This is directly from the iDvd Help Menu:
    Best Performance
    When you select Best Performance, iDVD encodes your video in the background as you’re working on your project instead of waiting until you burn it. This can significantly reduce the amount of time it takes to create a finished DVD. This is a good choice if your project is an hour or less in duration (for a single-layer disc). You’ll finish your project more quickly, and the encoding quality will be excellent for the amount of video you have.
    Best Performance encodes your video at a preset bit rate that produces great quality for projects that can easily fit on your disc. If you have a larger project that needs to be squeezed onto a disc, you should select one of the other encoding options.
    To check menus open the drop zone editor and check menu info.
    Motion Menus in general are not intended for long durations. Suggestion: Keep loops short and sweet (including any added audio).
    This too is directly from iDvd's Help Menu:
    The menus in a DVD can include background movies that play while the menu is showing as well as buttons that play video (called “motion buttons”). The total allowable playing time for video in all such “motion menus” in a DVD is 15 minutes. If total playing time is longer than 15 minutes, you will not be able to burn the DVD. You can keep track of the playing time for all menus in a project in the Project Info window.
    Hope this helps but if not just come on back.

  • ITunes makes different folders when adding music,videos & pictures

    Hi,
    I use Windows 7. I have found that when adding music,videos & pictures iTunes makes different folder for it.
    I have around 17GB of songs & music. but when I added them to iTunes library it made different folder containing all my songs. Now I have around 34GB of songs. What the ****! It does same for videos & pics.
    Please Help!

    Hi,
    When adding a new song (or any media file) to the iTunes library, it copies those files to a folder (usually C:\Users\<username>\Music\iTunes\iTunes Media\Music ). iTunes does this to keep a backup of your songs. To deactivate this go to Edit>Preference>Advanced (or Ctrl+,  then go to Advanced) and uncheck the checkbox "Copy files to iTunes Media folder when adding to library". iTunes will not copy the music files to its folder. But there is one downside to doing so, if you change the directory (folder or place) of the music that you added to the iTunes library (without copying to its folder), the music will not be played. Trying to play such a song will provide you with a messagebox that asks you to relocate the song or to ignore it. So it is always a good idea to allow iTunes copy the music files to the specified folder automatically. But if you are concerned about the disk space, you can delete the songs' copy of yours (the directory you select).
    If you want to add some songs to the iTunes Media folder, you right click a song (or multiple songs) and click on "Consolidate Files...". These songs will be copied to the iTunes Media folder and it will be there whatever happens.
    If you are afriad that copying a songs will not allow you to copy the music files to another directory from the iTunes Media folder, you shouldn't be. The folder is similar to that of anyother.
    Adding a song without using iTunes is also possible, just copy the songs you want to add to "C:\Users\<username>\Music\iTunes\iTunes Media\Automatically Add to iTunes".
    Regards,

  • Clips splitting when adding more clips

    i have one main movie in my project and then I'm adding more clips on top of it on other video tracks.
    the only problem is, whenever i do that, my main clips splits into two, right in the place where i'm adding a new clip. is there any way to disable that?

    sounds like you are insert editing the new clips and you want to do an overwrite edit.
    if you are doing it by drag and drop, take note of an arrow that appears when you drag the clip to the timeline. if you hover the mouse in the top third of the clip you are editing to, the arrow will point right - meaning it will 'insert' the new clip, and therefore move everything to accommodate. If you hover the mouse in the bottom two thirds, you will see the arrow point down - this means it will be an overwrite edit, and it won't move the other clips..
    cheers
    hugh

  • Viewing mov files when adding to layers

    Hi, im having some trouble viewing my .mov files after adding them to my layers. I know the mov file is viewable because they are videos from Ready2go, and i can preview them on quicktime.
    I import my files to my composition, then select the mov file i want to add to my layers, the layer is created but no video is viewable other than a small square box that contains the video. Its only using one frame for the entire video. Its supposed to creat a layer with as many frames as the videos length.
    Anyone know how to fix that? im pretty sure is some property that im not enabeling or something, because it doesnt reject my mov files.

    From the Digital Jouice website:
    Proxies included for faster RAM previews
    Requires Juicer version 3.81 or above.
    To me this means you are using the proxies and they are in some odd protected CoDec. You will first need to run their Juicer app to extract their protected content to proper work files.
    Mylenium

  • Crash when adding second video to timeline

    Good evening,
    i started to use Imovie for Ipad.
    when I add videos to the timeline,
    i can add one, from videos folder,
    when i add the second it crashes.
    have to reopen app, find again the video, add it, then crash again...
    is a super time waister and very frustrating
    i use it on ipad air 2
    i appreciate all suggestions on how to overcome this
    thank you

    That's called "button over video". This is not a feature Encore offers - you should file a feature request for it.
    You can use a motion menu with Loop Point set as a workaround to do this, but menus are limited to 1 GB on the disc.

  • How do I add/import multiple audio tracks when adding a video to the Elements timeline?

    I have 2 audio tracks that have been made, but only 1 is being brought in. ( It is a .Ts video file that is from Hauppauge Capture and it has game play audio and commentary audio that is being over-layed.) They are written as separate audio tracks but when imported into Premier only 1 of the 2 are being brought in. Is there a way to bring in both files?

    pinhead276
    It is my recollection that we had a similar question a little while ago on this question. I do not recall the outcome. My first impression "it is what it is", but I am trying to dust off my memory to make sure that the user did not come up with a unique way to workaround the situation. I will start searching for the thread that I think that I remember.
    If you find the thread first, please post and let us know.
    More later.
    ATR

  • Media directory deleted when adding folder in XP

    Hi everyone.
    I have used itunes for the radio, but have not used it for my music. Last night I decided to try it. I added my music folder to and it told me it had to convert .wma files to be used in iTunes. It converted maybe 40 files. The problem is, the music folder is now gone. I have lost hundreds of CDs that I have burned, interviews and workshops I have recorded and downloaded, etc. The whole media directory was wiped out. There is nothing in my recycle bin.

    Wow, what a mess! I've never heard of ituens just deleting files when they're imported (or not imported, as the case may be).
    My suspicion is that itunes moved them. Look in itunes menu > Edit Preferences > Advanced.
    Is the little checkbox to "Keep itunes Media folder" organized filled in?
    If so, itunes probably moved them. If they weren't tagged to itune's satisfaction, they probably got dumped into a folder named Unknown Artist/Unknown Album. Especially if they were WAV files, which don't have MP3 file tags.
    On XP, the default path would be
    C:\Documents and Settings\ username \My Documents\My Music\iTunes\iTunes Media
    Have a look there, unless you changed the path before importing yoru items.
    Message was edited by: Katrina S.

  • Black screen when adding more than 2gb memory

    I have Toshiba Satellite P105-6147. I recently added 1 gb to my machine, and wth the 512mb worked fine.  I want to replace 512mb with 2gb - for a total of 3gb - but computer will not boot up in that configuration.  Any suggestions on how to get it to work the extra memory?  Does this model even support more than 2 gb?  Thanks.

    Satellite P105-S6147
    for a total of 3gb
    According to the spec above, the maximum is 2 GB.
    But that model should never had been configured with less than 2 GB. Vista will barely even boot with 1 GB.
    -Jerry

  • HT1473 No error when adding inappropriate video format to iTunes

    When I choose unsupported video format it tells nothing and just ignore my request. I spent 2 hours struggling with that you call "user friendly" interface. Completely disappointed...

    You have to convert them to MPEG-4 files to play them back to your iPod. I suggest using Videora iPod Converter to re-encode your video files to MPEG4

  • New rapport crashes CR when adding more than one table

    Hello SAP Community Network Forums.
    First post, so I hope I landed in the right place.
    If I create a new rapport and add more than 2 tables to the rapport, CR shutdown. The following error is generated:
    Event Type:     Error
    Event Source:     Application Error
    Event Category:     (100)
    Event ID:     1000
    u2026
    Description:
    Faulting application crw32.exe, version 11.5.12.1838, faulting module pgoe1024.dll, version 6.0.0.168, fault address 0x00018404.
    a)     Installed a trial version of CR 2008. Same result.
    b)     Using:  XI 11.5.12.1838
    c)     Running against a Progress 10.2B db. Updated with SP 4.
    d)     Existing rapport is running fine (as long as no more than 1 table is added)
    Any ideas/suggestions would be much appreciated. Regards, Lars.
    Edited by: larsc-app on Apr 29, 2011 3:40 PM

    Hi!
    Are you using auto smart linking functionality of Crystal ? If so, try without auto smart linking with tables - works with me...
    I think the bug is laying on the newest odbc-driver of OpenEdge, above few rows of readme file that game with openedge 10.2b sp05 :
    Note: OE00205286    Type: Workaround
    A file DSN connection to Crystal RDC fails with ODBC 6.0 Drivers
    DataDirect ODBC 6.0 drivers can not handle the full path of a file DSN, causing
    a connection to Crystal RDC to fail. Use the ODBC 5.3 drivers instead of 6.0
    with Release 10,2B05 to work around this problem with the driver.
    -> if you can, try to use older driver (pgoe23...)..
    -Ari

  • Original Files Deleted When Added to iTunes

    If I have a folder of mp3s for a full album, when I open an mp3 in iTunes to be copied to my iTunes folder, the original mp3 file dissapears. However, when I open an mp3 that is by itself in a folder in iTunes to be copied, the original file remains there. Does anyone know why?

    OK I have done some more work and think i have the issue resolved. The problem lies with file formats specifically .mp4 and .m4v
    I suspect the files you are importing are mp4 files. When I do this i get the same behaviour of file names changing their name after playback. When i convert my files to m4v format and import the issue disappears.

  • IDVD shuts down when adding a video sequence... Why???

    Hello
    When I try to add a 2.3 GB. video sequence the program just disappears... No error message or anything, it just closed! Why does it do that, and how can I fix it?
    Best regards
    Jesper Pedersen

    It is in .avi.
    AVI comes in many flavors, not all of which are Mac friendly.
    How do I change it to DV format?
    You can try something like MPEG Streamclip or VisualHub.
    F Shippey

  • Photoshop create in-between frame greyes out when adding existing video and not blank video

    Any way or script that can fix this issue. I an animator and would like to send my keyframes to friends for them to add inbetweens to my frames. Id be nice to figure out how though. When i load  an existing video it grey's out that option.

    You will have to run the convert video to frames function on import...
    Mylenium

  • JTable sorting - problem when adding elements (complete code inside)

    I�m writing this email with reference to a recent posting here but this time with the code example. (I apologize for the duplicated posting � this time it will be with the code)
    Problem: when adding more elements to the JTable (sorted) the exception: ArrayIndexOutOfBoundsException is thrown.
    Example: If the elements in the table are 10 and then the user requests for 8 � the table will produce the correct result. However, if the user will ask for 11 items (>10) the exception will be thrown.
    The program: The program below (compiles and running). A JTable is constructed with 3 items, when you click the button - the return result should be 4 items - this will generate the error, WHY?
    I would highly appreciate your thoughts why this is happening and most importantly � how to fix it.
    Thanks a lot
    3 files:
    (1) TableSorterDemo
    (2) Traveler
    (3)TableSorter
    //TableSorterDemo:
    package sorter;
    import javax.swing.DefaultListModel;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    * TableSorterDemo is like TableDemo, except that it
    * inserts a custom model -- a sorter -- between the table
    * and its data model.  It also has column tool tips.
    public class TableSorterDemo implements ActionListener
         private JPanel superPanel;
         private JButton clickMe = new JButton("click me to get diff data");
         private boolean DEBUG = false;
         private DefaultListModel defaultListModel;
         private JTable table;
        public TableSorterDemo()
             superPanel = new JPanel(new BorderLayout());
             defaultListModel = new DefaultListModel();
             init1();
            TableSorter sorter = new TableSorter(new MyTableModel(defaultListModel)); //ADDED THIS     
            table = new JTable(sorter);             //NEW
            sorter.setTableHeader(table.getTableHeader()); //ADDED THIS
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            //Set up tool tips for column headers.
            table.getTableHeader().setToolTipText(
                    "Click to specify sorting; Control-Click to specify secondary sorting");
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Add the scroll pane to this panel.
            superPanel.add("Center", scrollPane);
            superPanel.add("South",clickMe);
            clickMe.addActionListener(this);              
        public JPanel getPanel()
             return superPanel;
        public void init1()
             //in real life this will be done from the db
             Traveler a = new Traveler();
             Traveler b = new Traveler();
             Traveler c = new Traveler();
             a.setFirstName("Elvis");
             a.setLastName("Presley");
             a.setSprot("Ping Pong");
             a.setNumYears(3);
             a.setVegetarian(true);
             b.setFirstName("Elton");
             b.setLastName("John");
             b.setSprot("Soccer");
             b.setNumYears(2);
             b.setVegetarian(true);
             c.setFirstName("shaquille");
             c.setLastName("oneil");
             c.setSprot("Golf");
             c.setNumYears(22);
             c.setVegetarian(true);
             defaultListModel.addElement(a);
             defaultListModel.addElement(b);
             defaultListModel.addElement(c);
        public void init2()
             //in real life this will be done from the db
             Traveler d = new Traveler();
             Traveler e = new Traveler();
             Traveler f = new Traveler();
             Traveler g = new Traveler();
             d.setFirstName("John");
             d.setLastName("Smith");
             d.setSprot("Tennis");
             d.setNumYears(32);
             d.setVegetarian(true);
             e.setFirstName("Ron");
             e.setLastName("Cohen");
             e.setSprot("Baseball");
             e.setNumYears(12);
             e.setVegetarian(true);
             f.setFirstName("Donald");
             f.setLastName("Mac Novice");
             f.setSprot("Vallyball");
             f.setNumYears(1);
             f.setVegetarian(true);
             g.setFirstName("Eithan");
             g.setLastName("Superstar");
             g.setSprot("Vallyball");
             g.setNumYears(21);
             g.setVegetarian(true);
             defaultListModel.addElement(d);
             defaultListModel.addElement(e);
             defaultListModel.addElement(f);
             defaultListModel.addElement(g);            
        class MyTableModel extends AbstractTableModel
             private DefaultListModel myModel;
             public MyTableModel(DefaultListModel m)
                  myModel=m;
            private String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            public int getColumnCount()
                return columnNames.length;
            public int getRowCount()
                return myModel.size();
            public String getColumnName(int column)
                 return getNames()[column];             
             public String[] getNames()
                  String[] names = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
                  return names;
            public Object getValueAt(int row, int col)
                 return distributeObjectsInTable(row, col, (Traveler) myModel.elementAt(row));
            public Object distributeObjectsInTable(int row, int col, Traveler tr)
               switch(col)
                         case 0:
                              return tr.getFirstName();
                         case 1:
                           return tr.getLastName();
                      case 2:
                           return tr.getSprot();
                      case 3:
                           return new Integer(tr.getNumYears());
                      case 4:
                           return new Boolean (tr.isVegetarian());
                     default:
                         return "Error";
            public Class getColumnClass(int c)
                return getValueAt(0, c).getClass();
        private static void createAndShowGUI()
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("TableSorterDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TableSorterDemo newContentPane = new TableSorterDemo();
            newContentPane.getPanel().setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane.getPanel());
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args)
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable()                   
                public void run()
                    createAndShowGUI();
         public void actionPerformed(ActionEvent ae)
              if (ae.getSource()==clickMe)
                   defaultListModel.removeAllElements();
                   init2(); //if the size of the model was less than 2 items - the result will be ok.
                              //in other words, if you commens the last 2 rows of this method (addElement(f) & g)
                             // the result will be fine.
                   table.updateUI();          
    }//(2) Traveler
    package sorter;
    public class Traveler
         private String firstName;
         private String lastName;
         private String sprot;
         private int numYears;
         private boolean vegetarian;
         public String getFirstName()
              return firstName;
         public String getLastName()
              return lastName;
         public int getNumYears()
              return numYears;
         public String getSprot()
              return sprot;
         public boolean isVegetarian()
              return vegetarian;
         public void setFirstName(String firstName)
              this.firstName = firstName;
         public void setLastName(String lastName)
              this.lastName = lastName;
         public void setNumYears(int numYears)
              this.numYears = numYears;
         public void setSprot(String sprot)
              this.sprot = sprot;
         public void setVegetarian(boolean vegetarian)
              this.vegetarian = vegetarian;
    }//(3)TableSorter
    package sorter;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    public class TableSorter extends AbstractTableModel {
        protected TableModel tableModel;
        public static final int DESCENDING = -1;
        public static final int NOT_SORTED = 0;
        public static final int ASCENDING = 1;
        private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
        public static final Comparator COMPARABLE_COMAPRATOR = new Comparator() {
            public int compare(Object o1, Object o2) {
                return ((Comparable) o1).compareTo(o2);
        public static final Comparator LEXICAL_COMPARATOR = new Comparator() {
            public int compare(Object o1, Object o2) {
                return o1.toString().compareTo(o2.toString());
        private Row[] viewToModel;
        private int[] modelToView;
        private JTableHeader tableHeader;
        private MouseListener mouseListener;
        private TableModelListener tableModelListener;
        private Map columnComparators = new HashMap();
        private List sortingColumns = new ArrayList();
        public TableSorter() {
            this.mouseListener = new MouseHandler();
            this.tableModelListener = new TableModelHandler();
        public TableSorter(TableModel tableModel) {
            this();
            setTableModel(tableModel);
        public TableSorter(TableModel tableModel, JTableHeader tableHeader) {
            this();
            setTableHeader(tableHeader);
            setTableModel(tableModel);
        private void clearSortingState() {
            viewToModel = null;
            modelToView = null;
        public TableModel getTableModel() {
            return tableModel;
        public void setTableModel(TableModel tableModel) {
            if (this.tableModel != null) {
                this.tableModel.removeTableModelListener(tableModelListener);
            this.tableModel = tableModel;
            if (this.tableModel != null) {
                this.tableModel.addTableModelListener(tableModelListener);
            clearSortingState();
            fireTableStructureChanged();
        public JTableHeader getTableHeader() {
            return tableHeader;
        public void setTableHeader(JTableHeader tableHeader) {
            if (this.tableHeader != null) {
                this.tableHeader.removeMouseListener(mouseListener);
                TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
                if (defaultRenderer instanceof SortableHeaderRenderer) {
                    this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
            this.tableHeader = tableHeader;
            if (this.tableHeader != null) {
                this.tableHeader.addMouseListener(mouseListener);
                this.tableHeader.setDefaultRenderer(
                        new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer()));
        public boolean isSorting() {
            return sortingColumns.size() != 0;
        private Directive getDirective(int column) {
            for (int i = 0; i < sortingColumns.size(); i++) {
                Directive directive = (Directive)sortingColumns.get(i);
                if (directive.column == column) {
                    return directive;
            return EMPTY_DIRECTIVE;
        public int getSortingStatus(int column) {
            return getDirective(column).direction;
        private void sortingStatusChanged() {
            clearSortingState();
            fireTableDataChanged();
            if (tableHeader != null) {
                tableHeader.repaint();
        public void setSortingStatus(int column, int status) {
            Directive directive = getDirective(column);
            if (directive != EMPTY_DIRECTIVE) {
                sortingColumns.remove(directive);
            if (status != NOT_SORTED) {
                sortingColumns.add(new Directive(column, status));
            sortingStatusChanged();
        protected Icon getHeaderRendererIcon(int column, int size) {
            Directive directive = getDirective(column);
            if (directive == EMPTY_DIRECTIVE) {
                return null;
            return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
        private void cancelSorting() {
            sortingColumns.clear();
            sortingStatusChanged();
        public void setColumnComparator(Class type, Comparator comparator) {
            if (comparator == null) {
                columnComparators.remove(type);
            } else {
                columnComparators.put(type, comparator);
        protected Comparator getComparator(int column) {
            Class columnType = tableModel.getColumnClass(column);
            Comparator comparator = (Comparator) columnComparators.get(columnType);
            if (comparator != null) {
                return comparator;
            if (Comparable.class.isAssignableFrom(columnType)) {
                return COMPARABLE_COMAPRATOR;
            return LEXICAL_COMPARATOR;
        private Row[] getViewToModel() {
            if (viewToModel == null) {
                int tableModelRowCount = tableModel.getRowCount();
                viewToModel = new Row[tableModelRowCount];
                for (int row = 0; row < tableModelRowCount; row++) {
                    viewToModel[row] = new Row(row);
                if (isSorting()) {
                    Arrays.sort(viewToModel);
            return viewToModel;
        public int modelIndex(int viewIndex)
            return getViewToModel()[viewIndex].modelIndex;
        private int[] getModelToView()
            if (modelToView == null) {
                int n = getViewToModel().length;
                modelToView = new int[n];
                for (int i = 0; i < n; i++) {
                    modelToView[modelIndex(i)] = i;
            return modelToView;
        // TableModel interface methods
        public int getRowCount() {
            return (tableModel == null) ? 0 : tableModel.getRowCount();
        public int getColumnCount() {
            return (tableModel == null) ? 0 : tableModel.getColumnCount();
        public String getColumnName(int column) {
            return tableModel.getColumnName(column);
        public Class getColumnClass(int column) {
            return tableModel.getColumnClass(column);
        public boolean isCellEditable(int row, int column) {
            return tableModel.isCellEditable(modelIndex(row), column);
        public Object getValueAt(int row, int column) {
            return tableModel.getValueAt(modelIndex(row), column);
        public void setValueAt(Object aValue, int row, int column) {
            tableModel.setValueAt(aValue, modelIndex(row), column);
        // Helper classes
        private class Row implements Comparable {
            private int modelIndex;
            public Row(int index) {
                this.modelIndex = index;
            public int compareTo(Object o) {
                int row1 = modelIndex;
                int row2 = ((Row) o).modelIndex;
                for (Iterator it = sortingColumns.iterator(); it.hasNext();) {
                    Directive directive = (Directive) it.next();
                    int column = directive.column;
                    Object o1 = tableModel.getValueAt(row1, column);
                    Object o2 = tableModel.getValueAt(row2, column);
                    int comparison = 0;
                    // Define null less than everything, except null.
                    if (o1 == null && o2 == null) {
                        comparison = 0;
                    } else if (o1 == null) {
                        comparison = -1;
                    } else if (o2 == null) {
                        comparison = 1;
                    } else {
                        comparison = getComparator(column).compare(o1, o2);
                    if (comparison != 0) {
                        return directive.direction == DESCENDING ? -comparison : comparison;
                return 0;
        private class TableModelHandler implements TableModelListener {
            public void tableChanged(TableModelEvent e) {
                // If we're not sorting by anything, just pass the event along.            
                if (!isSorting()) {
                    clearSortingState();
                    fireTableChanged(e);
                    return;
                // If the table structure has changed, cancel the sorting; the            
                // sorting columns may have been either moved or deleted from            
                // the model.
                if (e.getFirstRow() == TableModelEvent.HEADER_ROW) {
                    cancelSorting();
                    fireTableChanged(e);
                    return;
                // We can map a cell event through to the view without widening            
                // when the following conditions apply:
                // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and,
                // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
                // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and,
                // d) a reverse lookup will not trigger a sort (modelToView != null)
                // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
                // The last check, for (modelToView != null) is to see if modelToView
                // is already allocated. If we don't do this check; sorting can become
                // a performance bottleneck for applications where cells 
                // change rapidly in different parts of the table. If cells
                // change alternately in the sorting column and then outside of            
                // it this class can end up re-sorting on alternate cell updates -
                // which can be a performance problem for large tables. The last
                // clause avoids this problem.
                int column = e.getColumn();
                if (e.getFirstRow() == e.getLastRow()
                        && column != TableModelEvent.ALL_COLUMNS
                        && getSortingStatus(column) == NOT_SORTED
                        && modelToView != null) {
                    int viewIndex = getModelToView()[e.getFirstRow()];
                    fireTableChanged(new TableModelEvent(TableSorter.this,
                                                         viewIndex, viewIndex,
                                                         column, e.getType()));
                    return;
                // Something has happened to the data that may have invalidated the row order.
                clearSortingState();
                fireTableDataChanged();
                return;
        private class MouseHandler extends MouseAdapter {
            public void mouseClicked(MouseEvent e) {
                JTableHeader h = (JTableHeader) e.getSource();
                TableColumnModel columnModel = h.getColumnModel();
                int viewColumn = columnModel.getColumnIndexAtX(e.getX());
                int column = columnModel.getColumn(viewColumn).getModelIndex();
                if (column != -1) {
                    int status = getSortingStatus(column);
                    if (!e.isControlDown()) {
                        cancelSorting();
                    // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                    // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                    status = status + (e.isShiftDown() ? -1 : 1);
                    status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
                    setSortingStatus(column, status);
        private static class Arrow implements Icon {
            private boolean descending;
            private int size;
            private int priority;
            public Arrow(boolean descending, int size, int priority) {
                this.descending = descending;
                this.size = size;
                this.priority = priority;
            public void paintIcon(Component c, Graphics g, int x, int y) {
                Color color = c == null ? Color.GRAY : c.getBackground();            
                // In a compound sort, make each succesive triangle 20%
                // smaller than the previous one.
                int dx = (int)(size/2*Math.pow(0.8, priority));
                int dy = descending ? dx : -dx;
                // Align icon (roughly) with font baseline.
                y = y + 5*size/6 + (descending ? -dy : 0);
                int shift = descending ? 1 : -1;
                g.translate(x, y);
                // Right diagonal.
                g.setColor(color.darker());
                g.drawLine(dx / 2, dy, 0, 0);
                g.drawLine(dx / 2, dy + shift, 0, shift);
                // Left diagonal.
                g.setColor(color.brighter());
                g.drawLine(dx / 2, dy, dx, 0);
                g.drawLine(dx / 2, dy + shift, dx, shift);
                // Horizontal line.
                if (descending) {
                    g.setColor(color.darker().darker());
                } else {
                    g.setColor(color.brighter().brighter());
                g.drawLine(dx, 0, 0, 0);
                g.setColor(color);
                g.translate(-x, -y);
            public int getIconWidth() {
                return size;
            public int getIconHeight() {
                return size;
        private class SortableHeaderRenderer implements TableCellRenderer {
            private TableCellRenderer tableCellRenderer;
            public SortableHeaderRenderer(TableCellRenderer tableCellRenderer) {
                this.tableCellRenderer = tableCellRenderer;
            public Component getTableCellRendererComponent(JTable table,
                                                           Object value,
                                                           boolean isSelected,
                                                           boolean hasFocus,
                                                           int row,
                                                           int column) {
                Component c = tableCellRenderer.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                if (c instanceof JLabel) {
                    JLabel l = (JLabel) c;
                    l.setHorizontalTextPosition(JLabel.LEFT);
                    int modelColumn = table.convertColumnIndexToModel(column);
                    l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
                return c;
        private static class Directive {
            private int column;
            private int direction;
            public Directive(int column, int direction) {
                this.column = column;
                this.direction = direction;
    }

    The table listens to the TableModel for changes. Changing the table by adding/removing
    rows or columns has no affect on its table model. If you make changes to the table model
    the table will be notified by its TableModelListener and change its view. So tell
    MyTableModel about the change of data:
    public class TableSorterDemo implements ActionListener
        MyTableModel tableModel;
        public TableSorterDemo()
            defaultListModel = new DefaultListModel();
            init1();
            tableModel = new MyTableModel(defaultListModel);
            TableSorter sorter = new TableSorter(tableModel);
        public void actionPerformed(ActionEvent ae)
            if (ae.getSource()==clickMe)
                defaultListModel.removeAllElements();
                init2();
                tableModel.fireTableStructureChanged();
    }

Maybe you are looking for

  • I have windows 7 and have been using Firefox for the last several months and now I can' open it up for some reason.

    I've been using firefox as my principle browser for quite some time. I normally just click on it once and it opens to the home page with google search in the middle of the page. I downloaded some e-mail attachment about a job and that's when it seeme

  • Passing data from calling page to popup window

    Hi All, We are developing a BSP application for business card.I need to provide a preview button . when the user clicks this button a poopup window should open with the preview of business card. My problem is how to pass the values like name , design

  • Mouse freezing frequently?

    I am working in iMovie 4 (home movies for the grandparents for Christmas). As I hold the mouse down to scroll through a clip, the mouse freezes. Completely stops working. Cursor frozen. Most of the time, if I unplug the mouse from the keyboard and pl

  • Download Adobe Acrobat Standard 9, or

    I lost disc and I am not really sure if it was Abobe 9 actually. Is there a way to tell by the serial number what version Acrobat it is for? If not, I believe it was 9. Is this available for download from their FTP or somewhere? I only see 10 and lat

  • Feedback! What do you all want to see in Q1?

    Hi All - just wanted to get your feedback. Is the content relevant, useful? Or what would you like to see more of? Let me know as we plan our next bootcamp in Q1! Thanks