Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/jython
- from javax.swing import JButton, JFrame, JPanel, WindowConstants, JTextArea
- from java.awt import GridLayout, Component, BorderLayout, FlowLayout
- class Display(object):
- def __init__(self):
- self.frame = JFrame('COBOL Code Analyzer',
- defaultCloseOperation = WindowConstants.EXIT_ON_CLOSE)
- self.frame.size = (800,300)
- self.frame.layout = GridLayout(0,2,10,10)
- self.codePanel = JPanel(BorderLayout(), visible=True)
- self.outputPanel = JPanel(BorderLayout(), visible=True)
- self.codeArea = JTextArea(text = 'Insert code here..', alignmentX = Component.LEFT_ALIGNMENT, wrapStyleWord = True)
- self.outputArea = JTextArea(text = 'Hello world', editable = False, alignmentX = Component.LEFT_ALIGNMENT)
- self.outputArea.editable = False
- self.testButton = JButton('Test code', actionPerformed = self.test)
- self.clearButton = JButton('Clear', actionPerformed = self.clear)
- self.codePanel.add(self.codeArea, BorderLayout.CENTER)
- self.codePanel.add(self.clearButton, BorderLayout.SOUTH)
- self.outputPanel.add(self.outputArea, BorderLayout.CENTER)
- self.outputPanel.add(self.testButton, BorderLayout.SOUTH)
- self.frame.add(self.codePanel)
- self.frame.add(self.outputPanel)
- #self.frame.pack()
- self.show()
- def test(self,event):
- print 'testing button works'
- def clear(self,event):
- self.codeArea.text = ''
- def show(self):
- self.frame.visible = True
- if __name__ == '__main__':
- Display()
Add Comment
Please, Sign In to add comment