本文整理汇总了Python中javax.swing.JLabel.background方法的典型用法代码示例。如果您正苦于以下问题:Python JLabel.background方法的具体用法?Python JLabel.background怎么用?Python JLabel.background使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JLabel
的用法示例。
在下文中一共展示了JLabel.background方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createAuxPanelWrapper
# 需要导入模块: from javax.swing import JLabel [as 别名]
# 或者: from javax.swing.JLabel import background [as 别名]
def createAuxPanelWrapper(self, auxPanel, auxTitle):
# Initialize auxillary panel
leftPanel = JPanel()
leftPanel.layout = BorderLayout()
leftPanel.addFocusListener(LeftFocusListener(self))
# NengoStyle.applyStyle(leftPanel);
if self.showTitle:
# Create auxillary panel's title bar
titleBar = JPanel()
titleBar.border = BorderFactory.createEmptyBorder(0, 0, 5, 0))
NengoStyle.applyStyle(titleBar)
titleBar.background = NengoStyle.COLOR_BACKGROUND2
titleBar.opaque = True
titleBar.layout = BorderLayout()
titleLabel = JLabel(title)
titleLabel.font = NengoStyle.FONT_BIG
NengoStyle.applyStyle(titleLabel)
titleLabel.background = NengoStyle.COLOR_BACKGROUND2
titleLabel.opaque = True
hideButtonTxt = " >> " if self.orientation == 'right' else " << "
hideButton = JLabel(hideButtonTxt)
NengoStyle.applyStyle(hideButton)
hideButton.background = NengoStyle.COLOR_BACKGROUND2
hideButton.opaque = True
# Keep in this order, Swing puts items added first on top.
# We want the button to be on top
titleBar.add(hideButton, BorderLayout.EAST)
titleBar.add(titleLabel, BorderLayout.WEST)
hideButton.addMouseListener(HideButtonListener(self, hideButton))
leftPanel.add(titleBar, BorderLayout.NORTH)
leftPanel.minimumSize = self.minimumSize
if auxPanel is not None:
# NengoStyle.applyStyle(auxPanel)
leftPanel.add(auxPanel, BorderLayout.CENTER)
return leftPanel