-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMyJList.java
More file actions
51 lines (37 loc) · 827 Bytes
/
MyJList.java
File metadata and controls
51 lines (37 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.awt.Color;
import java.awt.Graphics;
import java.util.Vector;
import javax.swing.JList;
import javax.swing.ListModel;
public class MyJList extends JList{
private static final long serialVersionUID = 1L;
public MyJList() {
super();
}
public MyJList(ListModel dataModel) {
super(dataModel);
}
public MyJList(Object[] listData) {
super(listData);
}
public MyJList(Vector listData) {
super(listData);
}
@Override
protected void paintComponent(Graphics g) {
setBackground(new Color(0,0,0,0));
g.setColor(new Color(0,0,0,100));
super.paintComponent(g);
setSelectionBackground(getBackground());
}
@Override
protected void paintChildren(Graphics g) {
}
@Override
protected void paintBorder(Graphics g) {
}
@Override
public void paint(Graphics g) {
super.paint(g);
}
}