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);
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();
}