def build_replace_row(self): ''' Builds the replace row. ''' panel = JPanel(FlowLayout()) label = JLabel("Replace: ") panel.add(label) self.replace_field = JTextField(20, actionPerformed=self.find_next) label.setLabelFor(self.replace_field) panel.add(self.replace_field) return panel
def build_find_replace_rows(self): labels = ("Find: ", "Replace: ") # Create and populate the panel. panel = JPanel() for label in labels: row_panel = JPanel(FlowLayout()) label = JLabel(label, JLabel.TRAILING) row_panel.add(label, FlowLayout.LEFT) textfield = JTextField(20) label.setLabelFor(textfield) row_panel.add(textfield, FlowLayout.RIGHT) panel.add(row_panel) return panel