本文整理了Java中javax.swing.JScrollPane.setOpaque()
方法的一些代码示例,展示了JScrollPane.setOpaque()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.setOpaque()
方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:setOpaque
暂无
代码示例来源:origin: magefree/mage
private void makeTransparent() {
panelCardArea.setOpaque(false);
cardArea.setOpaque(false);
panelCardArea.getViewport().setOpaque(false);
panelControl.setBackground(new Color(250, 250, 250, 150));
panelControl.setOpaque(true);
cbSortBy.setModel(new DefaultComboBoxModel<>(SortBy.values()));
}
代码示例来源:origin: magefree/mage
public void useExtendedView(VIEW_MODE extendedViewMode) {
this.extendedViewMode = extendedViewMode;
int alpha = 255;
switch (chatType) {
case GAME:
case TABLES:
case DEFAULT:
alpha = CHAT_ALPHA;
}
this.txtConversation.setExtBackgroundColor(new Color(0, 0, 0, alpha)); // Alpha = 255 not transparent
this.txtConversation.setSelectionColor(Color.LIGHT_GRAY);
this.jScrollPaneTxt.setOpaque(alpha == 255);
this.jScrollPaneTxt.getViewport().setOpaque(chatType != ChatType.TABLES);
}
代码示例来源:origin: magefree/mage
public Cards(boolean skipAddingScrollPane) {
initComponents(skipAddingScrollPane);
setOpaque(false);
//cardArea.setOpaque(false);
setBackgroundColor(new Color(0, 0, 0, 100));
if (!skipAddingScrollPane) {
jScrollPane1.setOpaque(false);
jScrollPane1.getViewport().setOpaque(false);
jScrollPane1.setBorder(EMPTY_BORDER);
}
if (Plugins.instance.isCardPluginLoaded()) {
cardArea.setLayout(null);
}
cardArea.setBorder(EMPTY_BORDER);
setGUISize();
}
代码示例来源:origin: magefree/mage
private void makeTransparent() {
this.addComponentListener(this);
setOpaque(false);
cardGrid.setOpaque(false);
cardSelectorScrollPane.setOpaque(false);
cardSelectorScrollPane.getViewport().setOpaque(false);
cbSortBy.setModel(new DefaultComboBoxModel<>(SortBy.values()));
cbSortBy.setSelectedItem(sortSetting.getSortBy());
jTextFieldSearch.addActionListener(searchAction);
// make the components more readable
tbColor.setBackground(new Color(250, 250, 250, 150));
tbColor.setOpaque(true); // false = transparent
tbTypes.setBackground(new Color(250, 250, 250, 150));
tbTypes.setOpaque(true); // false = transparent
cardSelectorBottomPanel.setBackground(new Color(250, 250, 250, 150));
cardSelectorBottomPanel.setOpaque(true); // false = transparent
}
代码示例来源:origin: magefree/mage
private void initComponents() {
setOpaque(false);
jPanel = new JLayeredPane();
jPanel.setLayout(null);
jPanel.setOpaque(false);
jScrollPane = new JScrollPane(jPanel);
Border empty = new EmptyBorder(0, 0, 0, 0);
jScrollPane.setBorder(empty);
jScrollPane.setViewportBorder(empty);
jScrollPane.setOpaque(false);
jScrollPane.getViewport().setOpaque(false);
this.add(jScrollPane);
}
代码示例来源:origin: org.netbeans.api/org-openide-dialogs
scroll.getViewport().setOpaque(false);
scroll.setBorder(BorderFactory.createEmptyBorder());
scroll.setOpaque(false);
代码示例来源:origin: magefree/mage
public AbilityPicker() {
setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
initComponents();
jScrollPane2.setOpaque(false);
jScrollPane2.getViewport().setOpaque(false);
UIManager.put("ScrollBar.width", 17);
jScrollPane2.getHorizontalScrollBar().setUI(new MageScrollbarUI());
jScrollPane2.getVerticalScrollBar().setUI(new MageScrollbarUI());
}
代码示例来源:origin: magefree/mage
/** Creates new form CombatDialog */
public CombatDialog() {
JPanel contentPane = new JPanel() {
private static final long serialVersionUID = -8283955788355547309L;
public void paintComponent(Graphics g) {
g.setColor(new Color(50, 50, 50, 100));
g.fillRect(0, 0, getWidth(), getHeight());
}
};
setContentPane(contentPane);
initComponents();
this.setModal(false);
combatArea.setOpaque(false);
jScrollPane1.setOpaque(false);
jScrollPane1.getViewport().setOpaque(false);
getRootPane().setOpaque(false);
//setDefaultCloseOperation(JInternalFrame.HIDE_ON_CLOSE);
}
代码示例来源:origin: magefree/mage
public AbilityPicker(List<Object> choices, String message) {
this.choices = choices;
setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
if (message != null) {
this.message = message + " (single-click)";
}
initComponents();
jScrollPane2.setOpaque(false);
jScrollPane2.getViewport().setOpaque(false);
UIManager.put("ScrollBar.width", 17);
jScrollPane2.getHorizontalScrollBar().setUI(new MageScrollbarUI());
jScrollPane2.getVerticalScrollBar().setUI(new MageScrollbarUI());
}
代码示例来源:origin: magefree/mage
public void initComponents() {
hand = new mage.client.cards.Cards(true);
hand.setMinOffsetY(HAND_MIN_CARDS_OFFSET_Y);
hand.setCardDimension(GUISizeHelper.handCardDimension);
jPanel = new JPanel();
jScrollPane1 = new JScrollPane(jPanel);
jScrollPane1.getViewport().setBackground(new Color(0, 0, 0, 0));
jPanel.setLayout(new GridBagLayout()); // centers hand
jPanel.setBackground(new Color(0, 0, 0, 0));
jPanel.add(hand);
setOpaque(false);
jPanel.setOpaque(false);
jScrollPane1.setOpaque(false);
jPanel.setBorder(EMPTY_BORDER);
jScrollPane1.setBorder(EMPTY_BORDER);
jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
jScrollPane1.getHorizontalScrollBar().setUnitIncrement(8);
jScrollPane1.setViewportBorder(EMPTY_BORDER);
setLayout(new BorderLayout());
add(jScrollPane1, BorderLayout.CENTER);
hand.setHScrollSpeed(8);
hand.setBackgroundColor(new Color(0, 0, 0, 0));
hand.setVisibleIfEmpty(false);
hand.setBorder(EMPTY_BORDER);
hand.setZone(Zone.HAND.toString());
}
代码示例来源:origin: magefree/mage
textAreaScrollPane.setOpaque(false);
textAreaScrollPane.setBackground(new Color(0, 0, 0, 0));
textAreaScrollPane.getViewport().setOpaque(false);
代码示例来源:origin: magefree/mage
/**
* 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() {
jScrollPane1 = new javax.swing.JScrollPane();
text = new javax.swing.JTextPane();
setMinimumSize(getPreferredSize());
setOpaque(false);
setPreferredSize(new Dimension(dimension.frameWidth, dimension.frameHeight));
setLayout(null);
jScrollPane1.setBorder(null);
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane1.setFocusable(false);
jScrollPane1.setOpaque(false);
text.setBorder(null);
text.setEditable(false);
text.setFont(new java.awt.Font("Arial", 0, 9));
text.setFocusable(false);
text.setOpaque(false);
jScrollPane1.setViewportView(text);
add(jScrollPane1);
jScrollPane1.setBounds(20, 110, 130, 100);
jScrollPane1.setBounds(new Rectangle(dimension.contentXOffset, dimension.textYOffset, dimension.textWidth, dimension.textHeight));
}// </editor-fold>//GEN-END:initComponents
代码示例来源:origin: magefree/mage
/**
* 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() {
scrollPane = new javax.swing.JScrollPane();
text = new javax.swing.JTextPane();
setFocusable(false);
setMinimumSize(new Dimension(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT));
setName("bigCardPanel"); // NOI18N
setOpaque(false);
setPreferredSize(getMinimumSize());
setLayout(null);
scrollPane.setBorder(null);
scrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setOpaque(false);
text.setEditable(false);
text.setFocusable(false);
text.setOpaque(false);
scrollPane.setViewportView(text);
add(scrollPane);
scrollPane.setBounds(20, 230, 210, 120);
scrollPane.setBounds(new Rectangle(CONTENT_MAX_XOFFSET, TEXT_MAX_YOFFSET, TEXT_MAX_WIDTH, TEXT_MAX_HEIGHT));
}// </editor-fold>//GEN-END:initComponents
代码示例来源:origin: magefree/mage
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
cardScroll.setOpaque(false);
cardScroll.getViewport().setOpaque(false);
cardScroll.setViewportBorder(BorderFactory.createEmptyBorder());
代码示例来源:origin: magefree/mage
public BigCard(boolean rotated) {
initComponents();
if (!Plugins.instance.isCardPluginLoaded()) {
initBounds(rotated);
}
setDoubleBuffered(true);
setOpaque(true);
this.scrollPane.setOpaque(true);
this.scrollPane.setVisible(false);
}
代码示例来源:origin: magefree/mage
jScrollPaneSystem.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jScrollPaneSystem.setFocusable(false);
jScrollPaneSystem.setOpaque(false);
代码示例来源:origin: protegeproject/protege
private Component createDocPanel() {
createTextPanel();
readmeScroller = new JScrollPane(readmePane,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
readmeScroller.setOpaque(false);
return readmeScroller;
}
代码示例来源:origin: stackoverflow.com
JTextArea textArea = new JTextArea();
textArea.setOpaque(false);
textArea.setBackground(new Color(red, green, blue, alpha));
JScrollPane scrollPane = new JScrollPane(textArea);
scrollPane.getViewport().setOpaque(false);
scrollPane.setOpaque(false);
代码示例来源:origin: datacleaner/DataCleaner
public static JScrollPane scrolleable(final JComponent comp) {
final JScrollPane scroll = new JScrollPane();
if (comp != null) {
scroll.setViewportView(comp);
}
scroll.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scroll.setOpaque(false);
scroll.getViewport().setOpaque(false);
return scroll;
}
代码示例来源:origin: antlr/antlr3
public void initComponents() {
//textArea.setOpaque(false);
tree.setOpaque(false);
scroll.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
scroll.setOpaque(false);
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.add(scroll);
this.setBorder(BorderFactory.createEmptyBorder());
this.setOpaque(false);
}
内容来源于网络,如有侵权,请联系作者删除!