import java.awt.Color; import java.awt.Graphics; import javax.swing.JList; import javax.swing.ListModel; public class TimeLineJList extends JList { private static final long serialVersionUID = 1L; private static final int MARK_WIDTH = 2; private Interface interf; public TimeLineJList(ListModel dataModel, Interface interf) { super(dataModel); this.interf = interf; } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.BLACK); int maxHeight = getPreferredSize().height; int mark = Util.transformZoom(interf.tick, interf.timeLinePanel.getZoomLevel()); g.fillRect(mark, 0, MARK_WIDTH, maxHeight); } }