]> ruin.nu Git - moosique.git/blobdiff - MooView.java
*** empty log message ***
[moosique.git] / MooView.java
index 2defbc6fb50d3641263269134bbe446bc49d6e68..29314d96abc22b5a8409f197e3f24ccd9c2ce2aa 100644 (file)
@@ -38,8 +38,11 @@ public class MooView extends JScrollPane {
         */
        public void setTracks(Track[] tracks) {
                numberOfTracks = tracks.length;
+               trackPanel.removeAll();
+               titlePanel.removeAll();
                if (numberOfTracks == 1) {
                        // If MIDI file is of type 0, creates a view for the track.
+                       trackPanel.setLayout(new FlowLayout());
                        trackPanel.add(new MooTrackView(tracks[0]));
                        titlePanel.add(new MooTrackTitle(tracks[0]));
                } else {
@@ -54,7 +57,6 @@ public class MooView extends JScrollPane {
                        progressDialog.setVisible(true);
        
                        // Starts filling the track panel with track views, while updating the progress bar.
-                       trackPanel.removeAll();
                        trackPanel.setLayout(new GridLayout(1,numberOfTracks));
                        for (int i = 1; i < tracks.length; i++) {
                                trackPanel.add(new MooTrackView(tracks[i]));