javax.swing.JList 设置分割线

public class TestJList extends JFrame {
public TestJList() {
JList list = new JList(new String[] { "cc", "zz", "pp" });
this.add(list);
list.setCellRenderer(new DefaultListCellRenderer() {
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.red);
g.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
}
});
this.setTitle("Test JList");
this.pack();
this.setVisible(true);
}
public static void main(String[] args) {
TestJList t = new TestJList();
}
}

javax.swing.JList 设置分割线

上一篇:BZOJ 1072: [SCOI2007]排列perm 状态压缩DP


下一篇:B1072 [SCOI2007]排列perm 状压dp