|
7 | 7 | import com.shuzijun.leetcode.plugin.model.PageInfo;
|
8 | 8 | import com.shuzijun.leetcode.plugin.model.Question;
|
9 | 9 | import com.shuzijun.leetcode.plugin.model.QuestionView;
|
10 |
| -import com.shuzijun.leetcode.plugin.utils.URLUtils; |
11 | 10 | import com.shuzijun.leetcode.plugin.window.NavigatorTableData;
|
12 | 11 | import icons.LeetCodeEditorIcons;
|
13 | 12 |
|
@@ -103,6 +102,14 @@ protected MyJBTable<QuestionView> createMyTable(MyTableModel<QuestionView> myTab
|
103 | 102 | MyJBTable<QuestionView> myJBTable = new MyJBTable(myTableModel) {
|
104 | 103 | @Override
|
105 | 104 | protected void prepareRenderer(Component component, Object value, int row, int column) {
|
| 105 | + |
| 106 | + if (component instanceof JLabel) { |
| 107 | + if (column == 0 || column == 2 || column == 3 || column == 4) { |
| 108 | + ((JLabel) component).setHorizontalAlignment(SwingConstants.CENTER); |
| 109 | + } else { |
| 110 | + ((JLabel) component).setHorizontalAlignment(SwingConstants.LEADING); |
| 111 | + } |
| 112 | + } |
106 | 113 | if (column == 3) {
|
107 | 114 | if (value != null) {
|
108 | 115 | if (value.toString().equals("Easy")) {
|
@@ -173,10 +180,10 @@ public boolean compareSlug(QuestionView myData, String titleSlug) {
|
173 | 180 | }
|
174 | 181 |
|
175 | 182 | protected void setColumnWidth(MyJBTable myJBTable) {
|
176 |
| - myJBTable.getColumnModel().getColumn(0).setMaxWidth(20); |
177 |
| - myJBTable.getColumnModel().getColumn(2).setMaxWidth(50); |
178 |
| - myJBTable.getColumnModel().getColumn(3).setMaxWidth(60); |
179 |
| - myJBTable.getColumnModel().getColumn(4).setMaxWidth(50); |
| 183 | + myJBTable.getColumnModel().getColumn(0).setMaxWidth(30); |
| 184 | + myJBTable.getColumnModel().getColumn(2).setMaxWidth(60); |
| 185 | + myJBTable.getColumnModel().getColumn(3).setMaxWidth(70); |
| 186 | + myJBTable.getColumnModel().getColumn(4).setMaxWidth(60); |
180 | 187 | }
|
181 | 188 |
|
182 | 189 | }
|
0 commit comments