package com.nigorojr.typebest;

public class Line {

}

package com.nigorojr.typebest;

import java.util.ArrayList;

import javax.swing.JPanel;

public class Line extends JPanel {
    private ArrayList<Word> line = new ArrayList<Word>();
}

Add inheritance from JPanel to Line class