SuperVCD管理系统 完整代码,带各种注释,可以拿这个项目入门。
ArrayList categoryArrayList = myDataClient.getCategories(); Iterator iterator = categoryArrayList.iterator(); String aCategory; while (iterator.hasNext()) { } aCategory = (String) iterator.next(); categoryComboBox.addItem(aCategory); topPanel = new JPanel(); musicListBox = new JList(); musicListBox.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); musicScrollPane = new JScrollPane(musicListBox); detailsButton = new JButton("详细..."); clearButton = new JButton("清空"); exitButton = new JButton("退出"); bottomPanel = new JPanel(); this.setLayout(new BorderLayout()); topPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); topPanel.add(selectionLabel); topPanel.add(categoryComboBox); this.add(BorderLayout.NORTH, topPanel); this.add(BorderLayout.CENTER, musicScrollPane); bottomPanel.setLayout(new FlowLayout()); bottomPanel.add(detailsButton); bottomPanel.add(clearButton); bottomPanel.add(exitButton); this.add(BorderLayout.SOUTH, bottomPanel); detailsButton.addActionListener(new DetailsActionListener()); clearButton.addActionListener(new ClearActionListener());