SuperVCD管理系统 完整代码,带各种注释,可以拿这个项目入门。
}
else {
recordingIcon = new ImageIcon(getClass().getResource("images/music/" + imageName));
recordingLabel = new JLabel(recordingIcon);
}
}
catch (Exception exc)
{
recordingLabel = new JLabel(" 图片不存在 ");
}
recordingLabel.setBorder(BorderFactory.createRaisedBevelBorder());
recordingLabel.setToolTipText(myRecording.getArtist());
infoPanel.add(recordingLabel, c);
container.add(BorderLayout.NORTH, infoPanel);
Track[] tracksArray = myRecording.getTrackList();
JList tracksListBox= new JList(tracksArray);
JScrollPane tracksScrollPane = new JScrollPane(tracksListBox);
TitledBorder listBorder = BorderFactory.createTitledBorder("List of Tracks"); listBorder.setTitleColor(Color.black);
tracksScrollPane.setBorder(listBorder);
container.add(BorderLayout.CENTER, tracksScrollPane);
JPanel bottomPanel = new JPanel();
JButton okButton = new JButton("OK");
bottomPanel.add(okButton);
container.add(BorderLayout.SOUTH, bottomPanel);
okButton.addActionListener(new OkButtonActionListener());
this.pack();
Point parentLocation = parentFrame.getLocation();
this.setLocation(parentLocation.x + 50, parentLocation.y + 50);
}