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