def __init__(self): WriterPanel.__init__(self) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.explabel = swing.JLabel(EXPRESSION) self.add(self.explabel) self.expfield = swing.JTextField() self.expfield.setMinimumSize(awt.Dimension(1, 0)) self.expfield.setPreferredSize(awt.Dimension(120, 0)) self.expfield.setMaximumSize(awt.Dimension(120, 50)) self.add(self.expfield) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.thrlabel = swing.JLabel(THRESHOLD) self.add(self.thrlabel) self.thrfield = swing.JTextField('1.0') # self.thrfield = swing.JFormattedTextField('1.0') self.thrfield.setMinimumSize(awt.Dimension(1, 0)) self.thrfield.setPreferredSize(awt.Dimension(50, 0)) self.thrfield.setMaximumSize(awt.Dimension(50, 50)) self.add(self.thrfield) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.argwriter = ArgWriterPanel('Reactions/Genes: ') self.add(self.argwriter)
def getParams(self): # GUI to get future % of subbasin redeveloped, curve number, and release rate # Initialize window for UI frame = swing.JFrame("Set conditions of redeveloped portion of subbasin", layout=awt.BorderLayout()) frame.setDefaultCloseOperation(swing.JFrame.EXIT_ON_CLOSE) # Create panel that includes three text entry fields for % redeveloped, curve number, and release rate futureparams = swing.JPanel(layout=awt.GridLayout(3,2)) inbutton = swing.JPanel() futureparams.add(swing.JLabel('Percent Redevelopment ')) rd = swing.JTextField('', 5) futureparams.add(rd) futureparams.add(swing.JLabel('Future Curve Number ')) cn = swing.JTextField('', 5) futureparams.add(cn) futureparams.add(swing.JLabel('Release Rate ')) rr = swing.JTextField('', 5) futureparams.add(rr) # Create panel for button that stores the values entered setButton = swing.JButton('Set parameters', actionPerformed=(lambda x: self.setParams(rd, cn, rr, frame))) self.setParams(rd, cn, rr, frame) # Add panels to the window and make the window visible frame.add(futureparams, awt.BorderLayout.NORTH) inbutton.add(setButton) frame.add(inbutton, awt.BorderLayout.SOUTH) # setButton.addMouseListener(awt.event.MouseListener.mouseClicked(self, self.setParams(rd, cn, rr, frame))) frame.pack()
def __init__(self): # Launches the login screen, initializes self.window, the primary frame self.done = False self.friendsData = [''] self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.chatHistory = {} self.usernameField = JTextField('guest', 20) self.status = JTextField(text='setStatus', editable=True) self.portNumber = "6666" self.IP = "127.0.0.1" self.window = swing.JFrame("Catchy Messenger Name") self.chatWindow = swing.JFrame() self.window.windowClosing = self.goodbye tempPanel = swing.JPanel() tempPanel = awt.BorderLayout() loginPage = JPanel(GridLayout(0, 2)) self.window.add(loginPage) loginPage.add(JLabel("Enter today's username", SwingConstants.RIGHT)) loginPage.add(self.usernameField) textIP = swing.JTextField(text=self.IP, editable=True) #chatHistory = swing.JTextArea(text = "new chat instance!", editable = False, lineWrap = True, size = (300,1)) loginButton = JButton('Log in', actionPerformed=self.login) loginPage.add(JLabel("")) loginPage.add(loginButton) loginPage.add(textIP) loginPage.add(JLabel("Change IP from default?", SwingConstants.LEFT)) loginPage.add(swing.JTextField(text=self.portNumber, editable=True)) loginPage.add(JLabel("Change Port from default?")) self.window.pack() self.window.visible = True return
def __init__(self, parent): self.parent = parent Panel = swing.JPanel() Panel.layout = awt.BorderLayout() Panel.border = swing.BorderFactory.createTitledBorder( "Payload Encoder") self.text = swing.JTextField(actionPerformed=self.encodePayload) Panel.add(self.text, Panel.layout.PAGE_START) self.textArea = swing.JTextArea() scrollPane = swing.JScrollPane(self.textArea) Panel.add(scrollPane, Panel.layout.CENTER) Panel1 = swing.JPanel() Panel1.layout = awt.BorderLayout() Panel1.border = swing.BorderFactory.createTitledBorder( "Payload Parser") self.text1 = swing.JTextField(actionPerformed=self.parsePayload) Panel1.add(self.text1, Panel1.layout.PAGE_START) self.textArea1 = swing.JTextArea() scrollPane1 = swing.JScrollPane(self.textArea1) Panel1.add(scrollPane1, Panel1.layout.CENTER) self.splitPane = swing.JSplitPane(swing.JSplitPane.VERTICAL_SPLIT) self.splitPane.setDividerLocation(250) self.splitPane.setLeftComponent(Panel) self.splitPane.setRightComponent(Panel1) self.parent.addTabPanel("Options", self.splitPane)
def initGui(self): self.sigv4ConfigurationTab = swing.JPanel() layout = swing.GroupLayout(self.sigv4ConfigurationTab) self.sigv4ConfigurationTab.setLayout(layout) self.addDomainInfo = swing.JLabel("Domain to test:") self.addDomainInfo.setFont(Font("Tahoma", 1, 12)) self.configurationLoadedInfo = swing.JLabel("") self.configurationLoadedInfo.setFont(Font("Tahoma", 1, 12)) self.isJsonCheck = swing.JCheckBox("JSON") self.isJsonCheck.setFont(Font("Tahoma", 1, 12)) self.parseCredsBtn = swing.JButton('Load configuration', actionPerformed=self.parseCreds) self.credsPanel = swing.JScrollPane() self.credsText = swing.JTextArea("Paste Creds Here.") self.credsText.setLineWrap(True) self.credsPanel.setViewportView(self.credsText) self.scopeUrlField = swing.JTextField("api.example.io") layout.setHorizontalGroup( layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(15) .addGroup(layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING) .addComponent(self.isJsonCheck) .addComponent(self.credsPanel, swing.GroupLayout.PREFERRED_SIZE, 525, swing.GroupLayout.PREFERRED_SIZE) .addComponent(self.addDomainInfo) .addComponent(self.scopeUrlField, swing.GroupLayout.PREFERRED_SIZE, 350, swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(swing.GroupLayout.Alignment.TRAILING) .addComponent(self.parseCredsBtn)) .addComponent(self.configurationLoadedInfo) .addPreferredGap(swing.LayoutStyle.ComponentPlacement.UNRELATED)) .addComponent(self.addDomainInfo)) .addContainerGap(26, lang.Short.MAX_VALUE))) layout.setVerticalGroup( layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(10) .addComponent(self.isJsonCheck) .addGap(10) .addComponent(self.credsPanel, swing.GroupLayout.PREFERRED_SIZE, 125, swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(10) .addComponent(self.addDomainInfo) .addGap(10) .addComponent(self.scopeUrlField, swing.GroupLayout.PREFERRED_SIZE, swing.GroupLayout.DEFAULT_SIZE, swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(10) .addComponent(self.parseCredsBtn) .addGap(10) .addComponent(self.configurationLoadedInfo) .addPreferredGap(swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(swing.LayoutStyle.ComponentPlacement.RELATED) .addContainerGap(swing.GroupLayout.DEFAULT_SIZE, lang.Short.MAX_VALUE))))))) return
def classify_image(image): """Displays a window that allows the user to view and classify an image.""" frame = swing.JFrame() frame.defaultCloseOperation = swing.JFrame.DO_NOTHING_ON_CLOSE frame.add(swing.JLabel(swing.ImageIcon(image))) frame.add(swing.JLabel("Enter one of " + ", ".join(CLASS_NAMES))) frame.layout = swing.BoxLayout(frame.contentPane, swing.BoxLayout.Y_AXIS) class_field = swing.JTextField() classify_button = swing.JButton("Classify") condition = threading.Condition() def listener(_event): if class_field.text in CLASS_NAMES: with condition: condition.notifyAll() else: swing.JOptionPane.showMessageDialog( frame, "Image type is not one of the recognized types", "Input error", swing.JOptionPane.ERROR_MESSAGE) class_field.addActionListener(listener) classify_button.addActionListener(listener) frame.add(class_field) frame.add(classify_button) frame.pack() frame.visible = True with condition: condition.wait() frame.dispose() return class_field.text
def __init__(self): self.myFrame = swing.JFrame.__init__(self, 'Fragments') self.mydlg = EditFragment(self) self.mySession = ActiveSession(_session) self.myListModel = swing.DefaultListModel() self.myList = swing.JList(self.myListModel) myMidPanel = swing.JScrollPane(self.myList) myTopPanel = swing.JPanel() self.myEntry = swing.JTextField(40) myTopPanel.add(self.myEntry) myTopPanel.add(swing.JButton('Add', actionPerformed=self.AddValue)) myTopPanel.add(swing.JButton('Trim', actionPerformed=self.TrimValue)) myTopPanel.add( swing.JButton('[Enter]', actionPerformed=self.EnterValue)) myPanel = swing.JPanel() myPanel.add(swing.JButton('Edit', actionPerformed=self.EditValue)) myPanel.add(swing.JButton('Remove', actionPerformed=self.RemoveValue)) myPanel.add(swing.JButton('Use', actionPerformed=self.UseValue)) myPanel.add( swing.JButton('Refresh', actionPerformed=self.RefreshSessions)) myPanel.add(swing.JButton('Save', actionPerformed=self.SaveValue)) myPanel.add(swing.JButton('Restore', actionPerformed=self.RstValue)) self.contentPane.add(myTopPanel, awt.BorderLayout.NORTH) self.contentPane.add(myMidPanel, awt.BorderLayout.CENTER) self.contentPane.add(myPanel, awt.BorderLayout.SOUTH) self.pack()
def __init__(self): self.frame=swing.JFrame(title="My Frame", size=(300,300)) self.frame.defaultCloseOperation=swing.JFrame.EXIT_ON_CLOSE; self.frame.layout=awt.BorderLayout() self.panel1=swing.JPanel(awt.BorderLayout()) self.panel2=swing.JPanel(awt.GridLayout(4,1)) self.panel2.preferredSize = awt.Dimension(10,100) self.panel3=swing.JPanel(awt.BorderLayout()) self.title=swing.JLabel("Text Rendering") self.button1=swing.JButton("Print Text", actionPerformed=self.printMessage) self.button2=swing.JButton("Clear Text", actionPerformed=self.clearMessage) self.textField=swing.JTextField(30) self.outputText=swing.JTextArea(4,15) self.panel1.add(self.title) self.panel2.add(self.textField) self.panel2.add(self.button1) self.panel2.add(self.button2) self.panel3.add(self.outputText) self.frame.contentPane.add(self.panel1, awt.BorderLayout.PAGE_START) self.frame.contentPane.add(self.panel2, awt.BorderLayout.CENTER) self.frame.contentPane.add(self.panel3, awt.BorderLayout.PAGE_END)
def __init__(self, reaclabel=REACTINV, scalelabel=SCALEFAC): WriterPanel.__init__(self) self.reacpanel = swing.Box(swing.BoxLayout.LINE_AXIS) self.reacpanel.add(swing.JLabel(reaclabel)) self.reacfield = swing.JTextField() self.reacpanel.add(self.reacfield) self.reacpanel.add( swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.add(self.reacpanel, awt.BorderLayout.CENTER) self.numscalepanel = swing.Box(swing.BoxLayout.LINE_AXIS) self.add(self.numscalepanel, awt.BorderLayout.EAST) self.numpanel = swing.Box(swing.BoxLayout.LINE_AXIS) self.numpanel.add(swing.JLabel(NUMBER)) self.numfield = swing.JFormattedTextField(value=lang.Float(1.0)) self.numfield.setPreferredSize( awt.Dimension(FIELDWIDTH, self.numfield.getHeight())) self.numpanel.add(self.numfield) self.scalepanel = swing.Box(swing.BoxLayout.LINE_AXIS) self.scalepanel.add(swing.JLabel(scalelabel)) self.scalefield = swing.JFormattedTextField( value=lang.Float(Data.Problem.VMAX)) self.scalefield.setPreferredSize( awt.Dimension(FIELDWIDTH, self.scalefield.getHeight())) self.scalepanel.add(self.scalefield) self.optLayout()
def registerExtenderCallbacks(self, callbacks): # keep a reference to our callbacks object self._callbacks = callbacks # set our extension name self._callbacks.setExtensionName("Payload Parser") # build UI self._jPanel = swing.JPanel() self._jPanel.layout = awt.BorderLayout() self._jPanel.border = swing.BorderFactory.createTitledBorder( "Input characters to display payload strings with characters included or excluded" ) inputPanel = swing.JPanel() inputPanel.layout = awt.BorderLayout() radioPanel = swing.JPanel() self.text1 = swing.JTextField(actionPerformed=self.radioCallback) inputPanel.add(self.text1, inputPanel.layout.CENTER) buttonGroup = swing.ButtonGroup() self._radioButtonInclude = swing.JRadioButton("Include") buttonGroup.add(self._radioButtonInclude) radioPanel.add(self._radioButtonInclude) self._radioButtonExclude = swing.JRadioButton("Exclude") buttonGroup.add(self._radioButtonExclude) radioPanel.add(self._radioButtonExclude) self._radioButtonInclude.setSelected(True) inputPanel.add(radioPanel, inputPanel.layout.LINE_END) self._jPanel.add(inputPanel, self._jPanel.layout.PAGE_START) self.textArea = swing.JTextArea() scrollPane = swing.JScrollPane(self.textArea) self._jPanel.add(scrollPane, self._jPanel.layout.CENTER) boxVertical = swing.Box.createVerticalBox() saveLabel = swing.JLabel( "Save Payloads (In Burp Root Dir): Can be Imported into Intruder") boxVertical.add(saveLabel) boxHorizontal = swing.Box.createHorizontalBox() saveLabel2 = swing.JLabel("Save As:") boxHorizontal.add(saveLabel2) self._saveTextField = swing.JTextField('', 30) boxHorizontal.add(self._saveTextField) submitSaveButton = swing.JButton('Save', actionPerformed=self.savePayload) boxHorizontal.add(submitSaveButton) boxVertical.add(boxHorizontal) self._jPanel.add(boxVertical, self._jPanel.layout.PAGE_END) # add the custom tab to Burp's UI self._callbacks.addSuiteTab(self) return
def __init__( self, c ): self.c = c self.browser = browser.WebBrowser() self.base = swing.JPanel( java.awt.BorderLayout() ) self.base.add( self.browser ) bf = swing.JToolBar() path = g.os_path_join( g.app.loadDir,"..","Icons/webbrowser", "left.png" ) ii = swing.ImageIcon( path ) self.bbutton = back = swing.JButton( ii ) back.setText( "Back" ) back.setHorizontalTextPosition( swing.SwingConstants.CENTER ) back.setVerticalTextPosition( swing.SwingConstants.BOTTOM ) back.actionPerformed = lambda event : self.back() bf.add( back ) path = g.os_path_join( g.app.loadDir,"..","Icons/webbrowser", "right.png" ) ii = swing.ImageIcon( path ) self.fbutton = forward = swing.JButton( ii ) forward.setText( "Forward" ) forward.setHorizontalTextPosition( swing.SwingConstants.CENTER ) forward.setVerticalTextPosition( swing.SwingConstants.BOTTOM ) forward.actionPerformed = lambda event: self.forward() bf.add( forward ) path = g.os_path_join( g.app.loadDir,"..","Icons/webbrowser", "reload.png" ) ii = swing.ImageIcon( path ) refresh = swing.JButton( ii ) refresh.setText( "Reload" ) refresh.setHorizontalTextPosition( swing.SwingConstants.CENTER ) refresh.setVerticalTextPosition( swing.SwingConstants.BOTTOM ) refresh.actionPerformed = lambda event: self.browser.refresh() bf.add( refresh ) self.base.add( bf, java.awt.BorderLayout.NORTH ) jp2 = swing.JPanel( java.awt.BorderLayout()) self.jtf = swing.JTextField() CutCopyPaste( self.jtf ) jp2.add( self.jtf ) path = g.os_path_join( g.app.loadDir,"..","Icons", "do-it.gif" ) ii = swing.ImageIcon( path ) self.jb = swing.JButton( ii ) self.jb.actionPerformed = self.go jp2.add( self.jb, java.awt.BorderLayout.EAST ) jp3 = swing.JPanel( java.awt.GridLayout( 2, 1 ) ) jp3.add( jp2 ) jp4 = swing.JPanel() headline = swing.JButton( "Goto Headline" ) headline.actionPerformed = self.goToHeadline jp4.add( headline ) store = swing.JButton( "Store Page In Node" ) store.actionPerformed = self.storePage jp4.add( store ) feed = swing.JButton( "Feed Tree To Browser" ) feed.actionPerformed = self.feedNodesBodyContents jp4.add( feed ) jp3.add( jp4 ) self.base.add( jp3, java.awt.BorderLayout.SOUTH ) self.history = [] self.historypointer = -1 self.ignore = 0 self.enableButtons() self.browser.addWebBrowserListener( self )
def __init__(self): WriterPanel.__init__(self) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.explabel = swing.JLabel(EXPRESSION) self.add(self.explabel) self.expfield = swing.JTextField() self.add(self.expfield)
def __init__(self): GNIWriterPanel.__init__(self) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.samlabel = swing.JLabel(Util.SAMSIZE) self.add(self.samlabel) self.samfield = swing.JTextField() self.samfield.setMinimumSize(awt.Dimension(1, 0)) self.samfield.setPreferredSize(awt.Dimension(80, 0)) self.samfield.setMaximumSize(awt.Dimension(80, 50)) self.add(self.samfield)
def __init__(self, c, parent=None): self.c = c self.parent = parent p = c.currentPosition() self.p = p self.ignore_insert = 0 self.pattern = pattern = java.util.regex.Pattern.compile("<" + "<" + "[^<>]*" + ">" + ">") self.jtp = jtp = swing.JTextPane() #self.jtp.addFocusListener( self ) jtf = swing.JTextField() mlabel = swing.JLabel() jp = swing.JPanel(java.awt.BorderLayout()) jp.add(mlabel, java.awt.BorderLayout.WEST) jp.add(jtf, java.awt.BorderLayout.CENTER) self.swingmacs = SwingMacs.SwingMacs(jtp, jtf, mlabel, p.c) self.swingmacs.kcb.addTabForColon(1) self._nodesyncher = self.NodeSyncher(p.copy(), jtp, self.swingmacs, self) doc = jtp.getDocument() doc.addDocumentListener(self._nodesyncher) bt = p.bodyString() if bt == "": bt = " " p.v.t._bodyString.insert(0, bt) self._nodesyncher.ignore = 1 self.ignore_insert = 1 jtp.setText(bt) self._nodesyncher.ignore = 0 #s = time.time() self.scanNode(p, jtp) self.ignore_insert = 0 #s2 = time.time() #print "Time was %s" %( s2 - s ) jtp.setCaretPosition(0) jsp = swing.JScrollPane(jtp) if parent: parent.add(jsp) parent.add(jp, java.awt.BorderLayout.SOUTH) else: jf = swing.JFrame() cp = jf.getContentPane() cp.setLayout(java.awt.BorderLayout()) cp.add(jsp) #jtf = swing.JTextField() cp.add(jp, java.awt.BorderLayout.SOUTH) jf.pack() jf.visible = 1 wm1 = WeakMethod(self, "sync") leoPlugins.registerHandler("select1", wm1)
def buildTopPane( self, startUrl ): label = swing.JLabel( "Go To" ) self.field = swing.JTextField( preferredSize = (500, 20 ), text=startUrl, actionPerformed=self.goToUrl ) button = swing.JButton( "Go", size=(100,100), actionPerformed=self.goToUrl ) topPane = swing.JPanel() topPane.add( label ) topPane.add( self.field ) topPane.add( button ) return topPane
def GUI_start(): window = swing.JFrame("Test", size=(300, 300)) text_field = swing.JTextField(preferredSize=(300, 20)) text_field.text = "Welcome to test sample!" window.contentPane.add(text_field) window.visible = 1 button = swing.JButton("View", preferredSize=(300, 20)) window.contentPane.add(button) window.visible = 1 window.pack() window.visible = 1
def __init__(self, dialogparent): swing.JDialog.__init__(self, dialogparent, 'Edit the fragment', modal=1) myPanel = swing.JPanel() self.myText = swing.JTextField(20) myPanel.add(self.myText) myPanel.add(swing.JButton('OK', actionPerformed=self.__ok)) myPanel.add(swing.JButton('Cancel', actionPerformed=self.__cancel)) self.contentPane.add(myPanel) self.pack()
def __init__(self): WriterPanel.__init__(self) self.dirlabel = swing.JLabel(DIRECTION) self.add(self.dirlabel) self.dirbox = swing.JComboBox(DIRORDER) self.add(self.dirbox) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.objlabel = swing.JLabel(OBJECTIVE) self.add(self.objlabel) self.objfield = swing.JTextField() self.add(self.objfield)
def __init__( self ): swing.JPanel.__init__( self ) slayout = swing.SpringLayout() self.setLayout( slayout) schemes = [ 'svn://', 'svn+ssh://', 'http://', 'https://' ] self.scheme_widget = scheme_widget = swing.JComboBox( schemes) scheme_widget.setEditable( 0 ) setBorderToTitle( scheme_widget, "scheme:") self.add( scheme_widget) slayout.putConstraint( slayout.NORTH, scheme_widget, 5, slayout.NORTH, self) slayout.putConstraint( slayout.WEST, scheme_widget, 5, slayout.WEST, self ) self.host = host = swing.JTextField( 15 ) setBorderToTitle( host, "host:") self.add( host ) slayout.putConstraint( slayout.NORTH, host, 5, slayout.NORTH, self) slayout.putConstraint( slayout.WEST, host, 5, slayout.EAST, scheme_widget) slayout.putConstraint( slayout.EAST, self, 5, slayout.EAST, host) pmodel = swing.SpinnerNumberModel( 3690, 0, 5000, 1) self.port = port = swing.JSpinner( pmodel ) dformat = java.text.DecimalFormat() dformat.setGroupingSize( 8 ) editor = swing.JSpinner.NumberEditor( port, dformat.toPattern() ) port.setEditor( editor) port.revalidate() # port.setEditor( port.getEditor()) setBorderToTitle( port, "port:") self.add( port ) slayout.putConstraint( slayout.NORTH, port, 5, slayout.SOUTH, scheme_widget) slayout.putConstraint( slayout.WEST, port, 5, slayout.WEST, self) self.path = path = swing.JTextField( 15 ) setBorderToTitle( path, "path:") self.add( path ) slayout.putConstraint( slayout.NORTH, path, 5, slayout.SOUTH, scheme_widget ) slayout.putConstraint( slayout.WEST, path, 0, slayout.WEST, host ) slayout.putConstraint( slayout.SOUTH, self, 5, slayout.SOUTH, path )
def __init__(self): swing.JFrame.__init__(self) self.title = 'Chat' self.windowClosing = self.onExit self.text = swing.JTextArea(editable=0, lineWrap=1, wrapStyleWord=1) self.contentPane.add(swing.JScrollPane(self.text)) self.input = swing.JTextField(actionPerformed=self.onEnter) self.contentPane.add(self.input, 'South') self.size = 300, 200 self.show() self.input.requestFocus()
def registerExtenderCallbacks(self, callbacks): # obtain an extension helpers object self._helpers = callbacks.getHelpers() self._textKey = "" self._base64Key = "" # set our extension name callbacks.setExtensionName("Serialized input scan insertion point") self._jPanel = swing.JPanel() boxVertical = swing.Box.createVerticalBox() boxHorizontal = swing.Box.createHorizontalBox() boxHorizontal.add(swing.JLabel("Key of base64 value:")) boxVertical.add(boxHorizontal) boxHorizontal = swing.Box.createHorizontalBox() self._textKeyField = swing.JTextField('',30) boxHorizontal.add(self._textKeyField) boxVertical.add(boxHorizontal) boxHorizontal = swing.Box.createHorizontalBox() boxHorizontal.add(swing.JLabel("Key in base64 value (injection point)")) boxVertical.add(boxHorizontal) boxHorizontal = swing.Box.createHorizontalBox() self._base64KeyField = swing.JTextField('',30) boxHorizontal.add(self._base64KeyField) boxVertical.add(boxHorizontal) boxHorizontal = swing.Box.createHorizontalBox() submitQueryButton = swing.JButton('Submit Keys',actionPerformed=self.runSubmit) boxHorizontal.add(submitQueryButton) boxVertical.add(boxHorizontal) self._jPanel.add(boxVertical) # add the custom tab to Burp's UI callbacks.addSuiteTab(self) # register ourselves as a scanner insertion point provider callbacks.registerScannerInsertionPointProvider(self) return
def createGui( self ): self.jd = jd = swing.JDialog() self.jd.setName( "Leodialog" ) jd.setTitle( "Libraries" ) jdc = jd.getContentPane() self.libs = lib = swing.JList() self.libs.setName( "Autolist" ) lib.setVisibleRowCount( 5 ) view = swing.JScrollPane( lib ) jdc.add( view, awt.BorderLayout.NORTH ) create = swing.JButton( "Create" ) create.actionPerformed = self.create add = swing.JButton( "Add" ) add.actionPerformed = self.add move = swing.JButton( "Move" ) move.actionPerformed = self.move remove = swing.JButton( "Remove" ) remove.actionPerformed = self.remove _open = swing.JButton( "Open" ) _open.actionPerformed = self.open close = swing.JButton( "Close" ) close.actionPerformed = self.close topjp = swing.JPanel() topjp.setLayout( awt.GridLayout( 2, 1 ) ) jdc.add( topjp, awt.BorderLayout.SOUTH ) self.message = swing.JTextField() mp = swing.JPanel() gbl = awt.GridBagLayout() mp.setLayout( gbl ) gbc = awt.GridBagConstraints() gbc.weightx = 1.0 gbc.weighty = 1.0 gbc.fill = 1 gbl.setConstraints( self.message, gbc ) mp.add( self.message ) topjp.add( mp )# , awt.BorderLayout.NORTH ) jp = swing.JPanel() jp.setLayout( awt.GridLayout( 1, 6 ) ) jp.add( create ) jp.add( add ) jp.add( move ) jp.add( remove ) jp.add( _open ) jp.add( close ) topjp.add( jp )#, awt.BorderLayout.SOUTH )
def __init__(self): #self.value=200 swing.JFrame.__init__(self, title="Video Maker", size=(200,200)) self.contentPane.layout=java.awt.FlowLayout() self.field=swing.JTextField(size=(200,60)) self.field.text="200" self.contentPane.add(self.field) setSize = swing.JButton("Create Size", size=(65,30), actionPerformed=self.checkContents) self.contentPane.add(setSize) self.visible=1
def __init__(self): WriterPanel.__init__(self) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.objlabel = swing.JLabel(OBJECTIVE) self.add(self.objlabel) self.objfield = swing.JTextField() self.objfield.setMinimumSize(awt.Dimension(1, 0)) self.objfield.setPreferredSize(awt.Dimension(120, 0)) self.objfield.setMaximumSize(awt.Dimension(120, 50)) self.add(self.objfield) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.explabel = swing.JLabel(EXPRESSION) self.add(self.explabel) self.expfield = swing.JTextField() self.expfield.setMinimumSize(awt.Dimension(1, 0)) self.expfield.setPreferredSize(awt.Dimension(50, 0)) self.expfield.setMaximumSize(awt.Dimension(50, 50)) self.add(self.expfield) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.argwriter = ArgWriterPanel('Reactions: ') self.add(self.argwriter)
def __init__(self): WriterPanel.__init__(self) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH, 0))) self.bmlabel = swing.JLabel('Biomass: ') self.add(self.bmlabel) self.bmfield = swing.JTextField() self.bmfield.setMinimumSize(awt.Dimension(1, 0)) self.bmfield.setPreferredSize(awt.Dimension(120, 0)) self.bmfield.setMaximumSize(awt.Dimension(120, 50)) self.add(self.bmfield) self.add(swing.Box.createRigidArea(awt.Dimension(BORDERWIDTH * 2, 0))) self.argwriter = ArgWriterPanel('Genes: ') self.add(self.argwriter)
def create_option_panel(self, mode, table_name, colomn_names): option_panel = swing.JOptionPane() main = self.create_y_axis_layout_panel() panel = self.create_y_axis_layout_panel() title = swing.JLabel(table_name) panel.add(title) texts = [] for i in range(len(colomn_names)): title = swing.JLabel(colomn_names[i] + " : \n") if mode == 'Add': texts.append(swing.JTextField()) elif mode == 'Edit': texts.append( swing.JTextField( ContentData.content_data[table_name].getValueAt( self._select_table["row"], i))) minipanel = self.create_y_axis_layout_panel() minipanel.add(title) minipanel.add(texts[i]) panel.add(minipanel) main.add(panel) option_panel.showMessageDialog(option_panel, main, table_name, swing.JOptionPane.PLAIN_MESSAGE) return texts
def createGui (self): # build the GUI self.layout = awt.BorderLayout() progB = self.__progressBar = \ swing.JProgressBar(0, 100, stringPainted=1); inf = self.__inputField = swing.JTextField(5) inl = swing.JLabel("Calculate value of:", swing.JLabel.RIGHT) inl.labelFor = inf outf = self.__outputArea = swing.JTextArea() outl = swing.JLabel("Result:", swing.JLabel.RIGHT) outl.labelFor = outf calcb = self.__calcButton = \ swing.JButton("Calculate", actionPerformed=self.doCalc, enabled=1, mnemonic=awtevent.KeyEvent.VK_C) cancelb = self.__cancelButton = \ swing.JButton("Cancel", actionPerformed=self.doCancel, enabled=0, mnemonic=awtevent.KeyEvent.VK_L) vl = ValueLayout(5, 5) inp = swing.JPanel(vl) vl.setLayoutAlignmentX(inp, 0.2) inp.add(inl); inp.add(inf, inl) self.add(inp, awt.BorderLayout.NORTH) vl = ValueLayout(5, 5) outp = swing.JPanel(vl) vl.setLayoutAlignmentX(outp, 0.2) outp.add(outl); outp.add(swing.JScrollPane(outf), outl) xoutp = swing.JPanel(awt.BorderLayout()) xoutp.add(progB, awt.BorderLayout.NORTH) xoutp.add(outp, awt.BorderLayout.CENTER) self.add(xoutp, awt.BorderLayout.CENTER) sp = swing.JPanel(awt.BorderLayout()) bp = swing.JPanel() bp.add(calcb) bp.add(cancelb) sp.add(bp, awt.BorderLayout.NORTH) sl = self.__statusLabel = swing.JLabel(" ") sp.add(sl, awt.BorderLayout.SOUTH) self.add(sp, awt.BorderLayout.SOUTH)
def initUI(self): self.tab = swing.JPanel() # UI for Output self.outputLabel = swing.JLabel("LinkFinder Log:") self.outputLabel.setFont(Font("Tahoma", Font.BOLD, 14)) self.outputLabel.setForeground(Color(255, 102, 52)) self.logPane = swing.JScrollPane() self.outputTxtArea = swing.JTextArea() self.outputTxtArea.setFont(Font("Consolas", Font.PLAIN, 12)) self.outputTxtArea.setLineWrap(True) self.logPane.setViewportView(self.outputTxtArea) self.clearBtn = swing.JButton("Clear Log", actionPerformed=self.clearLog) self.exportBtn = swing.JButton("Export Log", actionPerformed=self.exportLog) self.parentFrm = swing.JFileChooser() self.exclusionLabel = swing.JLabel( "Exclusion list (separated by by comma):") self.exclusionInput = swing.JTextField(focusLost=self.save_config) # Layout layout = swing.GroupLayout(self.tab) layout.setAutoCreateGaps(True) layout.setAutoCreateContainerGaps(True) self.tab.setLayout(layout) layout.setHorizontalGroup(layout.createParallelGroup().addGroup( layout.createSequentialGroup().addGroup( layout.createParallelGroup().addComponent( self.exclusionLabel).addComponent( self.exclusionInput).addComponent( self.outputLabel).addComponent( self.logPane).addComponent( self.clearBtn).addComponent( self.exportBtn)))) layout.setVerticalGroup(layout.createParallelGroup().addGroup( layout.createParallelGroup().addGroup( layout.createSequentialGroup().addComponent( self.exclusionLabel).addComponent( self.exclusionInput).addComponent( self.outputLabel).addComponent( self.logPane).addComponent( self.clearBtn).addComponent( self.exportBtn))))
def __init__(self): swing.JFrame.__init__(self, title="Video Maker", size=(200, 200)) self.contentPane.layout = java.awt.FlowLayout() self.field = swing.JTextField(size=(200, 60)) self.field.text = "sample.jpg" self.contentPane.add(self.field) fileView = swing.JButton("Create Video", size=(65, 30), actionPerformed=self.checkContents) self.contentPane.add(fileView) setFolder = swing.JButton("Set Folder", size=(65, 40), actionPerformed=self.setFolder) self.contentPane.add(setFolder) self.visible = 1
def buildTopPane(self, startUrl): label = swing.JLabel("Go To:") self.field = swing.JTextField(startUrl, 20, actionPerformed=self.goToUrl) go = swing.JButton("Go", actionPerformed=self.goToUrl) self.back = swing.JButton(u"◀", actionPerformed=self.goBack, toolTipText="Back") self.forward = swing.JButton(u"▶", actionPerformed=self.goForward, toolTipText="Forward") topPane = swing.JPanel() topPane.add(self.back) topPane.add(self.forward) topPane.add(label) topPane.add(self.field) topPane.add(go) return topPane