]> ruin.nu Git - moosique.git/blobdiff - MooView.java
*** empty log message ***
[moosique.git] / MooView.java
index 3374bd614d38a4995c927c96adb2a14485c9125e..836629b74ef3fb970e3b669418253d783a4570cb 100644 (file)
@@ -51,8 +51,9 @@ public class MooView extends JScrollPane {
                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],0));
+                       MooTrackTitle title = new MooTrackTitle(tracks[0],0);
+                       titlePanel.add(title);
+                       trackPanel.add(new MooTrackView(tracks[0], title));
                } else {
                        // Creates dialog for progress bar.
                        JDialog progressDialog = new JDialog(Moosique.getGUI(), "Visualizing...", false);
@@ -115,8 +116,9 @@ public class MooView extends JScrollPane {
        public void addTrackView(Track track, int index) {
                ((GridLayout)trackPanel.getLayout()).setColumns(++numberOfTracks);
                ((GridLayout)titlePanel.getLayout()).setColumns(++numberOfTracks);
-               trackPanel.add(new MooTrackView(track), index);
-               titlePanel.add(new MooTrackTitle(track,index), index);
+               MooTrackTitle title = new MooTrackTitle(track,index);
+               titlePanel.add(title, index);
+               trackPanel.add(new MooTrackView(track, title), index);
                validate();
        }