本文整理汇总了Python中javax.swing.JTextArea.background方法的典型用法代码示例。如果您正苦于以下问题:Python JTextArea.background方法的具体用法?Python JTextArea.background怎么用?Python JTextArea.background使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTextArea
的用法示例。
在下文中一共展示了JTextArea.background方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getListCellRendererComponent
# 需要导入模块: from javax.swing import JTextArea [as 别名]
# 或者: from javax.swing.JTextArea import background [as 别名]
def getListCellRendererComponent(self, lst, value, index, isSelected, cellHasFocus):
text = value["text"]
renderer = JTextArea(text=text)
renderer.foreground = self.colormap[value["type"]]
renderer.font = self.font
if isSelected:
renderer.background = Color.YELLOW
return renderer
示例2: initGUI
# 需要导入模块: from javax.swing import JTextArea [as 别名]
# 或者: from javax.swing.JTextArea import background [as 别名]
def initGUI(self):
#Set up subpanel1
appName = JTextArea('Politeness Gauge\n'+'\nSarah Robinson \nAnna Clegg')
appName.setLineWrap(True)
appName.setWrapStyleWord(True)
appName.setEditable(False)
appName.background = 240,240,240
instructions = JTextArea(' Ever agonized over whether or not your emails' +
' are polite enough? \n Never fear! With our politeness gauge' +
' we can provide suggestions on improving your emails' +
' with just the click of a button. \n Just type your email ' +
'into the text box below and hit Score!')
instructions.setLineWrap(True)
instructions.setWrapStyleWord(True)
instructions.background = 240,240,240
northPanel = JPanel(GridLayout(2,1))
northPanel.add(appName)
northPanel.add(instructions)
self.subPanel1.add(northPanel, BorderLayout.NORTH)
self.userText.setEditable(True)
self.userText.setLineWrap(True)
self.userText.setWrapStyleWord(True)
self.userText.setRows(100)
#self.userText.wordWrap = True
self.subPanel1.add(self.userText, BorderLayout.CENTER)
self.subPanel1.add(self.button, BorderLayout.SOUTH)
label = JLabel("Politeness Evaluation")
self.subPanel2.add(label)
self.subPanel2.add(self.emoticonFeedback)
self.subPanel2.add(self.curseFeedback)
self.subPanel2.add(self.styleFeedback)
self.subPanel2.add(self.overallFeedback)
self.mainPanel.add(self.subPanel1)
self.mainPanel.add(self.subPanel2)