def initUI(self): global outputTextField self.panel = JPanel() self.panel.setLayout(BorderLayout()) toolbar = JToolBar() openb = JButton("Choose input file", actionPerformed=self.onClick) outputLabel = JLabel(" Enter output file name: ") outputTextField = JTextField("hl7OutputReport.txt", 5) print outputTextField.getText() toolbar.add(openb) toolbar.add(outputLabel) toolbar.add(outputTextField) self.area = JTextArea() self.area.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)) self.area.setText("Select your HL7 ORU messages text file to be converted to tab-delimited flat \nfile with select HL7 fields.\n") self.area.append("You can enter the path + file name for your output file or it will default to the current \nfile name in the text field above in your current working directory.") pane = JScrollPane() pane.getViewport().add(self.area) self.panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)) self.panel.add(pane) self.add(self.panel) self.add(toolbar, BorderLayout.NORTH) self.setTitle("HL7 ORU Results Reporter") self.setSize(600, 300) self.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) self.setLocationRelativeTo(None) self.setVisible(True) return outputTextField.getText()
def initComponents(self): self.panel = JPanel() self.panel.setLayout(BorderLayout()) toolbar = JToolBar() openb = JButton("Select", actionPerformed=self.onClick) toolbar.add(openb) self.area = JTextArea() self.area.setBorder(BorderFactory.createEmptyBorder(10, 100, 10, 100)) pane = JScrollPane() pane.getViewport().add(self.area) self.panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)) self.panel.add(pane) self.add(self.panel) self.add(toolbar)
def createToolbar(self): toolBar = JToolBar() margin = Insets(1, 1, 1, 1) [self.createButton(toolBar, i, t, f) for (i, t, f) in self.actions] return toolBar