SuperVCD管理系统 完整代码,带各种注释,可以拿这个项目入门。
protected Frame parentFrame;
public MusicDetailsDialog(Frame theParentFrame, MusicRecording theMusicRecording) {
this(theParentFrame, "光盘详细信息 " + theMusicRecording.toString(), theMusicRecording);
}
public MusicDetailsDialog(Frame theParentFrame, String theTitle, MusicRecording theMusicRecording) {
super(theParentFrame, theTitle, true);
myRecording = theMusicRecording;
parentFrame = theParentFrame;
buildGui();
}
private void buildGui() {
Container container = this.getContentPane();
container.setLayout(new BorderLayout());
JPanel topPanel = new JPanel();
topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.X_AXIS));
JPanel infoPanel = new JPanel();
infoPanel.setBorder(new EmptyBorder(10, 10, 0, 10));
infoPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 1;
c.gridwidth = 3;
c.weightx = 0.0;
c.weighty = 0.0;
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.WEST;