Java Code Examples for com.intellij.ui.components.JBScrollPane#setHorizontalScrollBar()

The following examples show how to use com.intellij.ui.components.JBScrollPane#setHorizontalScrollBar() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CourseCard.java    From tmc-intellij with MIT License 4 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT
 * modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    titleLabel = new JLabel();
    nameLabel = new JLabel();
    infoScrollPane = new JBScrollPane();
    informationLabel = new JTextArea();

    setBackground(new Color(255, 255, 255));
    setMaximumSize(new Dimension(332, 73));
    setMinimumSize(new Dimension(332, 73));
    setPreferredSize(new Dimension(346, 107));

    titleLabel.setFont(new Font("Ubuntu", 1, 18)); // NOI18N

    nameLabel.setForeground(new Color(150, 150, 150));

    infoScrollPane.setBackground(new Color(255, 255, 255));
    infoScrollPane.setBorder(BorderFactory.createEmptyBorder(2, 10, 2, 10));
    infoScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    infoScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    infoScrollPane.setViewportBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    infoScrollPane.setHorizontalScrollBar(null);
    infoScrollPane.setPreferredSize(new Dimension(106, 30));

    informationLabel.setEditable(false);
    informationLabel.setBackground(new Color(255, 255, 255));
    informationLabel.setLineWrap(true);
    informationLabel.setWrapStyleWord(true);
    informationLabel.setAutoscrolls(false);
    informationLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    informationLabel.setMaximumSize(null);
    infoScrollPane.setViewportView(informationLabel);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(
                            layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                            layout.createParallelGroup(
                                                GroupLayout.Alignment.LEADING)
                                                    .addGroup(
                                                            layout.createSequentialGroup()
                                                                    .addComponent(titleLabel)
                                                                    .addPreferredGap(
                                                                            LayoutStyle
                                                                                    .ComponentPlacement
                                                                                    .RELATED,
                                                                            155,
                                                                            Short.MAX_VALUE)
                                                                    .addComponent(nameLabel))
                                                    .addComponent(
                                                            infoScrollPane,
                                                            GroupLayout.DEFAULT_SIZE,
                                                            GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE))
                                    .addContainerGap()));
    layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(
                            layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                            layout.createParallelGroup(
                                                GroupLayout.Alignment.BASELINE)
                                                    .addComponent(titleLabel)
                                                    .addComponent(nameLabel))
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                            infoScrollPane,
                                            GroupLayout.PREFERRED_SIZE,
                                            40,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap(
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
}