Search in sources :

Example 71 with JScrollPane

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);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FilterBar(pcgen.gui2.filter.FilterBar) TempBonusFacade(pcgen.facade.core.TempBonusFacade) BorderLayout(java.awt.BorderLayout) Box(javax.swing.Box) SearchFilterPanel(pcgen.gui2.filter.SearchFilterPanel) EmptyBorder(javax.swing.border.EmptyBorder) FlippingSplitPane(pcgen.gui2.tools.FlippingSplitPane) CharacterFacade(pcgen.facade.core.CharacterFacade)

Example 72 with JScrollPane

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);
}
Also used : JScrollPane(javax.swing.JScrollPane) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel)

Example 73 with JScrollPane

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);
}
Also used : JScrollPane(javax.swing.JScrollPane) BorderLayout(java.awt.BorderLayout) JLabel(javax.swing.JLabel) Box(javax.swing.Box) Dimension(java.awt.Dimension)

Example 74 with JScrollPane

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;
}
Also used : JScrollPane(javax.swing.JScrollPane) Rectangle(java.awt.Rectangle) Dimension(java.awt.Dimension)

Example 75 with JScrollPane

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);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) DefaultTableColumnModel(javax.swing.table.DefaultTableColumnModel) BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) TableColumn(javax.swing.table.TableColumn)

Aggregations

JScrollPane (javax.swing.JScrollPane)832 JPanel (javax.swing.JPanel)431 Dimension (java.awt.Dimension)271 JLabel (javax.swing.JLabel)269 BorderLayout (java.awt.BorderLayout)260 JButton (javax.swing.JButton)191 GridBagLayout (java.awt.GridBagLayout)149 JTable (javax.swing.JTable)148 BoxLayout (javax.swing.BoxLayout)140 Insets (java.awt.Insets)122 GridBagConstraints (java.awt.GridBagConstraints)121 ActionEvent (java.awt.event.ActionEvent)120 JTextArea (javax.swing.JTextArea)110 ActionListener (java.awt.event.ActionListener)103 FlowLayout (java.awt.FlowLayout)96 JTextField (javax.swing.JTextField)70 FormLayout (com.jgoodies.forms.layout.FormLayout)60 Container (java.awt.Container)55 JSplitPane (javax.swing.JSplitPane)55 MouseEvent (java.awt.event.MouseEvent)52