def __init__(self): super(AboutDialog, self).__init__() # Open the files and build a tab pane self.tabbedPane = tabs = JTabbedPane() for title, path in self.INFO_FILES: textPane = JTextPane() textPane.editable = False scrollPane = JScrollPane(textPane) scrollPane.preferredSize = (32767, 32767) # just a large number with open(path, 'r') as fd: infoText = fd.read().decode('utf8') textPane.text = infoText textPane.caretPosition = 0 tabs.addTab(title, scrollPane) # Load this tabbed pane into the layout self.add(tabs, BorderLayout.CENTER) # Add a label at the top versionLabel = JLabel(JESVersion.TITLE + " version " + JESVersion.RELEASE) versionLabel.alignmentX = Component.CENTER_ALIGNMENT versionPanel = JPanel() versionPanel.add(versionLabel) self.add(versionPanel, BorderLayout.PAGE_START) # Make an OK button self.okButton = JButton(self.ok) self.buttonPanel.add(self.okButton)
def timeline(self, username): timeline = self.api.GetFriendsTimeline(username) self.resultPanel = JPanel() self.resultPanel.layout = BoxLayout(self.resultPanel, BoxLayout.Y_AXIS) for s in timeline: self.showTweet(s) scrollpane = JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) scrollpane.preferredSize = 400, 800 scrollpane.viewport.view = self.resultPanel self.frame.add(scrollpane)
def __init__(self): super(IntroDialog, self).__init__() # Open the text file and make a text pane textPane = JTextPane() textPane.editable = False scrollPane = JScrollPane(textPane) scrollPane.preferredSize = (32767, 32767) # just a large number with open(self.INFO_FILE, 'r') as fd: infoText = fd.read().decode('utf8').replace( "@version@", JESVersion.VERSION ) textPane.text = infoText # Load the scroll pane into the layout self.add(scrollPane, BorderLayout.CENTER) # Make an OK button self.okButton = JButton(self.ok) self.buttonPanel.add(self.okButton)
def __init__(self): super(BugReportDialog, self).__init__() # Add a message textPane = JTextPane() textPane.editable = False version = "\n".join(" " + line for line in JESVersion.getMessage().splitlines()) textPane.text = MESSAGE % version scrollPane = JScrollPane(textPane) scrollPane.preferredSize = (32767, 32767) # just a large number # Load it into the layout self.add(scrollPane, BorderLayout.CENTER) # Make buttons self.sendButton = JButton(self.send) self.buttonPanel.add(self.sendButton) self.closeButton = JButton(self.close) self.buttonPanel.add(self.closeButton)
def menuItemClicked(self, caption, messageInfo): response = messageInfo[0].getResponse() strResponse = ''.join([chr(c%256) for c in response]) frame = JFrame('DOM XSS',size = (300,300)) parentPanel = JPanel() #printedCode = JTextPane(text = strResponse) #''' #colored code printedCode = JTextPane() styledDoc = printedCode.getStyledDocument() style = printedCode.addStyle('ColoredCode',None) self.filter2(strResponse,styledDoc,style) #''' #Scroll Bar scrollPanel = JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) scrollPanel.preferredSize = 1500,800 scrollPanel.viewport.view = printedCode #Final Inclusion of Panels parentPanel.add(scrollPanel) frame.add(parentPanel) frame.visible = True
from com.clt.dialog.client import Client from javax.swing import JPanel, JFrame, JTextArea, JScrollPane from java.awt import Color frame = JFrame( 'Vokabeltrainer', defaultCloseOperation=JFrame.EXIT_ON_CLOSE, size=(500, 500), ) scrollpane = JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) scrollpane.preferredSize = 400, 800 scrollpane.visible = True frame.add(scrollpane) pnl = JPanel() feld = JTextArea() feld.editable = False pnl.add(feld) frame.add(pnl) frame.visible = True class Main(Client): def __init__(self): pass def stateChanged(self, cs): print "new state: " + str(cs) def sessionStarted(self):