Skip to content

Commit

Permalink
Adds border and padding to cells of detail view of Tables
Browse files Browse the repository at this point in the history
Adds a border and padding around cells displayed when clicking on one of the table labeled rectangles.  Also removes coloring of rows when clicking on the table.
  • Loading branch information
Marc Halperin committed Jun 18, 2015
1 parent 135eba5 commit 4fc1cc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/org/ohdsi/rabbitInAHat/DetailsPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
Expand All @@ -43,6 +44,7 @@
import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.UIManager;
import javax.swing.border.MatteBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
Expand Down Expand Up @@ -355,6 +357,8 @@ public FieldPanel() {
JScrollPane fieldListPanel = new JScrollPane(table);
table.setFont(font);
table.setRowHeight(24);
table.setBorder(new MatteBorder(1, 0, 1, 0, Color.BLACK));

fieldListPanel.setBorder(BorderFactory.createTitledBorder("Fields"));
add(fieldListPanel, BorderLayout.CENTER);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.awt.Color;
import java.awt.Component;
import java.awt.Insets;

import javax.swing.JTable;
import javax.swing.JTextArea;
Expand Down Expand Up @@ -32,9 +33,7 @@ public Component getTableCellRendererComponent(JTable table, Object value, boole
jtext.setFont(table.getFont());
jtext.setSize(table.getColumn(table.getColumnName(column)).getWidth(), (int)jtext.getPreferredSize().getHeight());

if(isSelected){
jtext.setBackground((Color)UIManager.get("Table.selectionBackground"));
}
jtext.setMargin(new Insets(10,5,10,5));

return jtext;
}
Expand Down

0 comments on commit 4fc1cc1

Please sign in to comment.