如何将Jlabel的文本设置为带有中断的ArrayList

时间:2015-11-22 23:18:14

标签: java swing arraylist jlabel

我正在尝试将输出jlabel的文本添加到Netbeans 8.0.2中的数组列表中。我能够将arraylist设置为jlabel,但我需要中断它所以整个事情不在一行。任何人都知道如何有效地做到这一点?

import java.util.*;
public class CollectionAp extends javax.swing.JFrame {
ArrayList <String> CD = new ArrayList();
    /**
     * Creates new form CollectionAp
     */
    public CollectionAp() {
        initComponents();
    }
    private void InitializeClicked(){
        DisplayButton.setEnabled(true);
        AddButton.setEnabled(true);
        RemoveButton.setEnabled(true);
        InitializeButton.setEnabled(false);
        Collections.addAll(CD,"Three Days Grace - Human Race","Steven Wilson - Hand Cannot Erase","Beatcore - Far From Home", "Paris Blohm - Left Behinds","DEAF KEV - Invincible");
    }
    private void DisplayClicked(){
        String DisplayString = (CD.toString());
        OriginalOutput.setText("Original Order\n**********\n" + DisplayString);

0 个答案:

没有答案