use of javax.swing.JScrollPane in project pcgen by PCGen.
the class TempBonusInfoTab method initComponents.
private void initComponents() {
FlippingSplitPane topPane = new FlippingSplitPane("TempBonusTop");
setTopComponent(topPane);
setOrientation(VERTICAL_SPLIT);
JPanel availPanel = new JPanel(new BorderLayout());
FilterBar<CharacterFacade, TempBonusFacade> bar = new FilterBar<>();
bar.addDisplayableFilter(new SearchFilterPanel());
availPanel.add(bar, BorderLayout.NORTH);
availableTable.setDisplayableFilter(bar);
availableTable.setTreeCellRenderer(tempBonusRenderer);
availPanel.add(new JScrollPane(availableTable), BorderLayout.CENTER);
Box box = Box.createHorizontalBox();
box.add(Box.createHorizontalGlue());
addButton.setHorizontalTextPosition(SwingConstants.LEADING);
box.add(addButton);
box.add(Box.createHorizontalStrut(5));
box.setBorder(new EmptyBorder(0, 0, 5, 0));
availPanel.add(box, BorderLayout.SOUTH);
topPane.setLeftComponent(availPanel);
JPanel selPanel = new JPanel(new BorderLayout());
FilterBar<CharacterFacade, TempBonusFacade> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
selectedTable.setDisplayableFilter(filterBar);
selectedTable.setTreeCellRenderer(tempBonusRenderer);
selPanel.add(new JScrollPane(selectedTable), BorderLayout.CENTER);
box = Box.createHorizontalBox();
box.add(Box.createHorizontalStrut(5));
box.add(removeButton);
box.add(Box.createHorizontalGlue());
box.setBorder(new EmptyBorder(0, 0, 5, 0));
selPanel.add(box, BorderLayout.SOUTH);
topPane.setRightComponent(selPanel);
setBottomComponent(infoPane);
setResizeWeight(0.75);
}
use of javax.swing.JScrollPane in project pcgen by PCGen.
the class SummaryInfoTab method initLevelPanel.
private void initLevelPanel(JPanel panel) {
panel.setLayout(new GridBagLayout());
//$NON-NLS-1$
JLabel addLabel = createLabel("in_sumAddLevels");
//$NON-NLS-1$
JLabel removeLabel = createLabel("in_sumRemoveLevels");
JLabel darrowLabel = new JLabel(Icons.button_arrow_down.getImageIcon());
JLabel uarrowLabel = new JLabel(Icons.button_arrow_up.getImageIcon());
addLevelsButton.setMargin(new Insets(0, 8, 0, 8));
addLevelsField.setValue(1);
addLevelsField.setHorizontalAlignment(SwingConstants.RIGHT);
removeLevelsButton.setMargin(new Insets(0, 8, 0, 8));
removeLevelsField.setValue(1);
removeLevelsField.setHorizontalAlignment(SwingConstants.RIGHT);
GridBagConstraints gbc1 = new GridBagConstraints();
GridBagConstraints gbc2 = new GridBagConstraints();
gbc1.weightx = gbc2.weightx = 0.5;
gbc1.insets = new Insets(1, 0, 1, 0);
gbc2.insets = new Insets(1, 0, 1, 0);
gbc2.gridwidth = GridBagConstraints.REMAINDER;
panel.add(addLabel, gbc1);
panel.add(removeLabel, gbc2);
gbc1.ipadx = 30;
panel.add(addLevelsField, gbc1);
gbc2.ipadx = 30;
panel.add(removeLevelsField, gbc2);
gbc1.ipadx = 0;
panel.add(addLevelsButton, gbc1);
gbc2.ipadx = 0;
panel.add(removeLevelsButton, gbc2);
panel.add(darrowLabel, gbc1);
panel.add(uarrowLabel, gbc2);
ClassLevelTableModel.initializeTable(classLevelTable);
gbc2.weightx = 0;
gbc2.weighty = 1;
gbc2.fill = GridBagConstraints.BOTH;
panel.add(new JScrollPane(classLevelTable), gbc2);
}
use of javax.swing.JScrollPane in project pcgen by PCGen.
the class NoteInfoPane method initComponents.
private void initComponents() {
setLayout(new BorderLayout());
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createRigidArea(new Dimension(5, 0)));
//$NON-NLS-1$
hbox.add(new JLabel(LanguageBundle.getString("in_descNoteName")));
hbox.add(Box.createRigidArea(new Dimension(5, 0)));
hbox.add(nameField);
nameField.setText(name);
hbox.add(Box.createRigidArea(new Dimension(5, 0)));
hbox.add(removeButton);
hbox.add(Box.createHorizontalGlue());
noteField.setLineWrap(true);
noteField.setWrapStyleWord(true);
add(hbox, BorderLayout.NORTH);
JScrollPane pane = new JScrollPane(noteField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
add(pane, BorderLayout.CENTER);
}
use of javax.swing.JScrollPane in project pcgen by PCGen.
the class EquipmentModels method prepareScrollPane.
private static JScrollPane prepareScrollPane(JTable table) {
JScrollPane pane = new JScrollPane(table);
Dimension size = table.getPreferredSize();
// account for the header which has not been prepared yet
size.height += 30;
final int decorationHeight = 80;
final int decorationWidth = 70;
Rectangle screenBounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
if (size.height > screenBounds.height - decorationHeight) {
size.height = screenBounds.height - decorationHeight;
}
if (size.width > screenBounds.width - decorationWidth) {
size.width = screenBounds.width - decorationWidth;
}
pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
pane.setPreferredSize(size);
return pane;
}
use of javax.swing.JScrollPane in project pcgen by PCGen.
the class CompanionInfoTab method initComponents.
private void initComponents() {
{
DefaultTableColumnModel model = new DefaultTableColumnModel();
TableColumn column = new TableColumn(0);
column.setResizable(true);
model.addColumn(column);
column = new TableColumn(1, 120, new ButtonCellRenderer(), null);
column.setMaxWidth(120);
column.setResizable(false);
model.addColumn(column);
companionsTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
companionsTable.getTableHeader().setResizingAllowed(false);
companionsTable.setAutoCreateColumnsFromModel(false);
companionsTable.setColumnModel(model);
}
companionsTable.setIntercellSpacing(new Dimension(0, 0));
companionsTable.setFocusable(false);
companionsTable.setRowHeight(23);
companionsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
setLeftComponent(new JScrollPane(companionsTable));
JPanel rightPane = new JPanel(new BorderLayout());
infoPane.setOpaque(false);
infoPane.setEditable(false);
infoPane.setFocusable(true);
//$NON-NLS-1$
infoPane.setContentType("text/html");
rightPane.add(new JScrollPane(infoPane), BorderLayout.CENTER);
JPanel buttonPane = new JPanel(new FlowLayout());
buttonPane.add(loadButton);
rightPane.add(buttonPane, BorderLayout.SOUTH);
setRightComponent(rightPane);
}
Aggregations