def __init__(self, frame): JWindow.__init__(self, frame) self.textarea = JTextArea() # TODO put this color with all the other colors self.textarea.setBackground(Color(225,255,255)) self.textarea.setEditable(0) self.jscrollpane = JScrollPane(self.textarea) self.getContentPane().add(self.jscrollpane)
def __init__(self, frame, textComponent): JWindow.__init__(self, frame) self.textComponent = textComponent self.size = (200,200) self.list = JList(keyPressed=self.key) self.list.setBackground(Color(255,255,225)) # TODO move this color self.getContentPane().add(JScrollPane(self.list)) self.list.setSelectedIndex(0) self.originalData = "" self.data = "" self.typed = ""
def __init__(self, frame, textComponent): JWindow.__init__(self, frame) self.textComponent = textComponent self.size = (200, 200) self.list = JList(keyPressed=self.key) self.list.setBackground(Color(255, 255, 225)) # TODO move this color self.getContentPane().add(JScrollPane(self.list)) self.list.setSelectedIndex(0) self.originalData = "" self.data = "" self.typed = ""
def show(self): # when the popup becomes visible, get the cursor # so we know how to replace the selection self.dotPosition = self.textComponent.getCaretPosition() self.setSize(self.getPreferredSize()) JWindow.show(self)