Example usage for javax.swing JScrollPane setOpaque

List of usage examples for javax.swing JScrollPane setOpaque

Introduction

In this page you can find the example usage for javax.swing JScrollPane setOpaque.

Prototype

@BeanProperty(expert = true, description = "The component's opacity")
public void setOpaque(boolean isOpaque) 

Source Link

Document

If true the component paints every pixel within its bounds.

Usage

From source file:picocash.components.AccountPanel.java

protected JScrollPane createTransactionScrollPane(ListModel listModel) {
    final JXList transactionList = new JXList(listModel);
    transactionList.setBackground(TRANSPARENT_LIST_BACKGROUND);
    transactionList.setCellRenderer(new DefaultListRenderer(new TransactionProvider()));
    transactionList.setRolloverEnabled(true);
    transactionList.addHighlighter(/*  www  . j  a v  a2s .  c o  m*/
            new TransactionPainterHighlighter(HighlightPredicate.ALWAYS, new MattePainter(Color.WHITE)));
    transactionList.addHighlighter(
            new TransactionPainterHighlighter(HighlightPredicate.ROLLOVER_ROW, new PinstripePainter()));

    final JScrollPane scrollPane = new JScrollPane(transactionList);

    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    scrollPane.setViewportBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

    transactionList.setOpaque(true);
    scrollPane.setOpaque(true);

    return scrollPane;
}