diff options
Diffstat (limited to 'src/cppcheckplus/outlookpanel/MyOutlookListPanel.java')
-rw-r--r-- | src/cppcheckplus/outlookpanel/MyOutlookListPanel.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/cppcheckplus/outlookpanel/MyOutlookListPanel.java b/src/cppcheckplus/outlookpanel/MyOutlookListPanel.java new file mode 100644 index 0000000..2b43866 --- /dev/null +++ b/src/cppcheckplus/outlookpanel/MyOutlookListPanel.java | |||
@@ -0,0 +1,61 @@ | |||
1 | |||
2 | package cppcheckplus.outlookpanel; | ||
3 | |||
4 | |||
5 | import java.awt.BorderLayout; | ||
6 | import java.awt.Color; | ||
7 | import java.awt.Component; | ||
8 | import java.awt.Dimension; | ||
9 | import java.awt.Graphics; | ||
10 | import java.awt.Insets; | ||
11 | import javax.swing.JPanel; | ||
12 | import javax.swing.JScrollPane; | ||
13 | import javax.swing.ScrollPaneConstants; | ||
14 | import javax.swing.border.Border; | ||
15 | |||
16 | |||
17 | public class MyOutlookListPanel extends JPanel | ||
18 | { | ||
19 | private MyOutlookList list; | ||
20 | |||
21 | //MyOutlookBar对应的MyOutlookList封装的Panel | ||
22 | private JScrollPane listScrollPane; | ||
23 | private Border scrollBorder; | ||
24 | |||
25 | public MyOutlookListPanel(MyOutlookList list) | ||
26 | { | ||
27 | this.list = list; | ||
28 | listScrollPane = new JScrollPane(list); | ||
29 | // listScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); | ||
30 | listScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); | ||
31 | scrollBorder = new Border() | ||
32 | { | ||
33 | public void paintBorder(Component c, Graphics g, int x, int y, | ||
34 | int width, int height) | ||
35 | { | ||
36 | g.setColor(new Color(233, 223, 207)); | ||
37 | g.drawLine(0, height, x, height); | ||
38 | } | ||
39 | public Insets getBorderInsets(Component c) | ||
40 | { | ||
41 | return new Insets(0, 0, 1, 0); | ||
42 | } | ||
43 | public boolean isBorderOpaque() | ||
44 | { | ||
45 | return true; | ||
46 | } | ||
47 | }; | ||
48 | init(); | ||
49 | } | ||
50 | private void init() | ||
51 | { | ||
52 | listScrollPane.setMinimumSize(new Dimension(0, 0)); | ||
53 | listScrollPane.setBorder(scrollBorder); | ||
54 | this.setLayout(new BorderLayout()); | ||
55 | add(listScrollPane,BorderLayout.CENTER); | ||
56 | } | ||
57 | public MyOutlookList getOutlookList() | ||
58 | { | ||
59 | return list; | ||
60 | } | ||
61 | } | ||