Fixed the width of categoryChooser

This commit is contained in:
Akarshit Wal
2015-08-20 00:12:50 +05:30
parent 2d9567e885
commit cc6fcae770
2 changed files with 7 additions and 4 deletions
@@ -59,6 +59,7 @@ public class ContributionListPanel extends JPanel implements Scrollable, Contrib
protected ContributionListing contribListing = ContributionListing.getInstance();
protected JTable table;
DefaultTableModel dtm;
JScrollPane scrollPane;
Font myFont;
public ContributionListPanel() {
@@ -104,7 +105,8 @@ public class ContributionListPanel extends JPanel implements Scrollable, Contrib
// There is a space before Status
String[] colName = { " Status", "Name", "Author" };
dtm.setColumnIdentifiers(colName);
JScrollPane scrollPane = new JScrollPane(table);
scrollPane = new JScrollPane(table);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
table.setFillsViewportHeight(true);
// table.setBorder();
table.setDefaultRenderer(Contribution.class, new StatusRendere());
@@ -188,6 +188,7 @@ public class ContributionTab {
});*/
int catChooserWidth = ContributionManagerDialog.AUTHOR_WIDTH + contributionListPanel.scrollPane.getVerticalScrollBar().getPreferredSize().width - 10;
GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
@@ -206,9 +207,9 @@ public class ContributionTab {
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,
GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
.addComponent(categoryChooser,
ContributionManagerDialog.AUTHOR_WIDTH - 10,
ContributionManagerDialog.AUTHOR_WIDTH - 10,
ContributionManagerDialog.AUTHOR_WIDTH - 10)
catChooserWidth,
catChooserWidth,
catChooserWidth)
.addContainerGap()).addComponent(loaderLabel)
.addComponent(contributionListPanel).addComponent(errorPanel)
.addComponent(statusPanel));