本文整理汇总了Python中javax.swing.JTextField.setText方法的典型用法代码示例。如果您正苦于以下问题:Python JTextField.setText方法的具体用法?Python JTextField.setText怎么用?Python JTextField.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTextField
的用法示例。
在下文中一共展示了JTextField.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ConversationWindow
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class ConversationWindow(Conversation):
"""A GUI window of a conversation with a specific person"""
def __init__(self, person, chatui):
"""ConversationWindow(basesupport.AbstractPerson:person)"""
Conversation.__init__(self, person, chatui)
self.mainframe = JFrame("Conversation with "+person.name)
self.display = JTextArea(columns=100,
rows=15,
editable=0,
lineWrap=1)
self.typepad = JTextField()
self.buildpane()
self.lentext = 0
def buildpane(self):
buttons = JPanel(doublebuffered)
buttons.add(JButton("Send", actionPerformed=self.send))
buttons.add(JButton("Hide", actionPerformed=self.hidewindow))
mainpane = self.mainframe.getContentPane()
mainpane.setLayout(BoxLayout(mainpane, BoxLayout.Y_AXIS))
mainpane.add(JScrollPane(self.display))
self.typepad.actionPerformed = self.send
mainpane.add(self.typepad)
mainpane.add(buttons)
def show(self):
self.mainframe.pack()
self.mainframe.show()
def hide(self):
self.mainframe.hide()
def sendText(self, text):
self.displayText("\n"+self.person.client.name+": "+text)
Conversation.sendText(self, text)
def showMessage(self, text, metadata=None):
self.displayText("\n"+self.person.name+": "+text)
def contactChangedNick(self, person, newnick):
Conversation.contactChangedNick(self, person, newnick)
self.mainframe.setTitle("Conversation with "+newnick)
#GUI code
def displayText(self, text):
self.lentext = self.lentext + len(text)
self.display.append(text)
self.display.setCaretPosition(self.lentext)
#actionlisteners
def hidewindow(self, ae):
self.hide()
def send(self, ae):
text = self.typepad.getText()
self.typepad.setText("")
if text != "" and text != None:
self.sendText(text)
示例2: HumanDetailPanel
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class HumanDetailPanel(DetailPanel):
""" generated source for class HumanDetailPanel """
moveTable = JZebraTable()
moveTextField = JTextField()
selectButton = JButton()
selection = Move()
timerBar = JTimerBar()
def __init__(self):
""" generated source for method __init__ """
super(HumanDetailPanel, self).__init__(GridBagLayout())
model = DefaultTableModel()
model.addColumn("Legal Moves")
self.moveTable = JZebraTable(model)
self.selectButton = JButton(selectButtonMethod())
self.moveTextField = JTextField()
self.timerBar = JTimerBar()
self.selection = None
self.moveTable.setShowHorizontalLines(True)
self.moveTable.setShowVerticalLines(True)
self.moveTextField.setEditable(False)
self.add(JScrollPane(self.moveTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, Insets(5, 5, 5, 5), 5, 5))
self.add(self.selectButton, GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, Insets(5, 5, 5, 5), 0, 0))
self.add(self.moveTextField, GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, Insets(5, 5, 5, 5), 5, 5))
self.add(self.timerBar, GridBagConstraints(0, 2, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, Insets(5, 5, 5, 5), 5, 5))
@overloaded
def observe(self, event):
""" generated source for method observe """
if isinstance(event, (HumanNewMovesEvent, )):
self.observe(event)
elif isinstance(event, (HumanTimeoutEvent, )):
self.observe(event)
elif isinstance(event, (PlayerTimeEvent, )):
self.observe(event)
@observe.register(object, HumanNewMovesEvent)
def observe_0(self, event):
""" generated source for method observe_0 """
model = self.moveTable.getModel()
model.setRowCount(0)
for move in event.getMoves():
model.addRow([None]*)
self.selection = event.getSelection()
self.moveTextField.setText(self.selection.__str__())
@observe.register(object, HumanTimeoutEvent)
def observe_1(self, event):
""" generated source for method observe_1 """
event.getHumanPlayer().setMove(self.selection)
@observe.register(object, PlayerTimeEvent)
def observe_2(self, event):
""" generated source for method observe_2 """
self.timerBar.time(event.getTime(), 500)
def selectButtonMethod(self):
""" generated source for method selectButtonMethod """
return AbstractAction("Select")
示例3: PrefsPanel
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class PrefsPanel(JPanel):
"""JPanle with gui for tool preferences
"""
def __init__(self, app):
strings = app.strings
self.setLayout(GridLayout(3, 2, 5, 5))
userLbl = JLabel(strings.getString("osmose_pref_username"))
self.userTextField = JTextField(20)
self.userTextField.setToolTipText(strings.getString("osmose_pref_username_tooltip"))
levelLbl = JLabel(strings.getString("osmose_pref_level"))
self.levels = ["1", "1,2", "1,2,3", "2", "3"]
self.levelsCombo = JComboBox(self.levels)
self.levelsCombo.setToolTipText(strings.getString("osmose_pref_level_tooltip"))
limitLbl = JLabel(strings.getString("osmose_pref_limit"))
self.limitTextField = JTextField(20)
self.limitTextField.setToolTipText(strings.getString("osmose_pref_limit_tooltip"))
self.add(userLbl)
self.add(self.userTextField)
self.add(levelLbl)
self.add(self.levelsCombo)
self.add(limitLbl)
self.add(self.limitTextField)
def update_gui(self, preferences):
"""Update preferences gui
"""
self.userTextField.setText(preferences["username"])
self.levelsCombo.setSelectedIndex(self.levels.index(preferences["level"]))
self.limitTextField.setText(str(preferences["limit"]))
def read_gui(self):
"""Read preferences from gui
"""
username = self.userTextField.getText()
level = self.levelsCombo.getSelectedItem()
limit = self.limitTextField.getText()
try:
limit = Integer.parseInt(limit)
if limit > 500:
limit = 500
limit = str(limit)
except NumberFormatException:
limit = ""
preferences = {"username": username.strip(),
"level": level,
"limit": limit}
return preferences
示例4: getGUI
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
def getGUI(sym_dict):
global frame, outCheckbox, fillCheckbox, slider, colorTF, widthTF
frame = JFrame("Border Symbology", defaultCloseOperation=JFrame.DISPOSE_ON_CLOSE,
bounds=(100, 100, 450, 200), layout=FlowLayout(), resizable=0)
colorL = JLabel('Color: ')
colorTF = JTextField(20)
color = sym_dict["color"]
color = Color(color.getRed(), color.getGreen(), color.getBlue(), sym_dict["alpha"])
colorTF.setBackground(color)
colorTF.setText(color.toString())
colorB = JButton('...', actionPerformed=colorChooser)
frame.add(colorL)
frame.add(colorTF)
frame.add(colorB)
widthL = JLabel('Width: ')
widthTF = JTextField(3)
widthTF.setText(str(sym_dict["width"]))
frame.add(widthL)
frame.add(widthTF)
alphaL = JLabel('Transparency: ')
frame.add(alphaL)
# Create a horizontal slider with min=0, max=100, value=50
slider = JSlider()
slider.setPreferredSize(Dimension(200, 50))
slider.setValue(sym_dict["alpha"]*100/255)
slider.setMajorTickSpacing(25)
slider.setMinorTickSpacing(5)
slider.setPaintTicks(1)
slider.setPaintLabels(1)
applyButton = JButton("Apply", actionPerformed=action)
acceptButton = JButton("Accept", actionPerformed=accept)
frame.add(slider)
frame.add(applyButton)
frame.add(acceptButton)
frame.show()
示例5: SeniorDesign
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class SeniorDesign(JFrame):
startTime =0
endTime =0
global timeTextField
global end
def __init__(self):
self.timeTextField = JTextField("00:00")
self.end = True
pass
def drawChart(self):
data = [(10, 20, 30), (20, 65, 33),
(30, 55, 30), (40, 45, 51),
(50, 25, 27), (60, 75, 30)]
ar = area.T(size = (150,120),
y_grid_interval=10,
x_axis=axis.X(label="X label", label_offset=(0,-7)),
y_axis=axis.Y(label="Y label"),
legend = legend.T(), y_range = (0, None))
ar.add_plot(bar_plot.T(label="foo", data=data),
line_plot.T(label="bar", data=data, ycol=2))
ar.draw()
def createChart(self):
ds = XYDataset()
data = { {0.1, 0.2, 0.3}, {1, 2, 3} }
ds.addSeries("series1", data)
chart = ChartFactory.createXYLineChart("DemoChart", "x", "y", PlotOrientation.VERTICAL, ds, True, True, False)
chartPanel= ChartPanel()
return chartPanel
def createMenuBar(self):
#JMenuBar menuBar;
#JMenu soccerHub, subscriptions,skin,suggestions,help;
menuBar = JMenuBar();
#SoccerHub menu
seniorDesign = JMenu("SeniorDesign");
#seniorDesign.setMnemonic(KeyEvent.VK_0);
menuBar.add(seniorDesign);
#subscription menu
statistics = JMenu("Statistics");
#subscriptions.setMnemonic(KeyEvent.VK_1);
menuBar.add(statistics);
return menuBar;
def mytimer(self,timeTextField):
timer = Timer()
while(True):
timeTextField.setText(timer.getTime())
def getTimeElapsed(self,elapsed):
global startTime
millis = int(round(time.time()*1000))
#elapsedTime = millis - startTime;
elapsedTime = elapsed
#elapsedTime = elapsedTime / 1000;
seconds = str((int)((elapsedTime/1000) % 60));
minutes = str((int)((elapsedTime/(1000*60)) % 60));
hours = str((int)((elapsedTime/(1000*60*60)) % 24));
if (len(seconds) < 2):
seconds = "0" + seconds;
if (len(minutes) < 2):
minutes = "0" + minutes;
if (len(hours) < 2):
hours = "0" + hours;
return hours+":"+minutes+":"+seconds;
def startTimer(self,event):
global startTime
#startTime = time.time()
startTime = int(Calendar.getInstance().getTimeInMillis())
self.updateTextField("Running")
timer = Timer()
def stopTimer(self,event):
global endTime
endTime = int(Calendar.getInstance().getTimeInMillis())
self.updateTextField(self.getTimeElapsed(endTime-startTime))
def timerListener(self,textfield):
time = self.getTimeElapsed()
textfield.setText(time)
def printTime(self):
print "Current time"+ self.getTimeElapsed(time.time()*1000)
#.........这里部分代码省略.........
示例6: range
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
for i in range(n):
zx = random.random()
zy = random.random()
if zx * zx + zy * zy < 1:
hits = hits + 1
setColor("red")
else:
setColor("green")
point(zx, zy)
return hits
lbl1 = JLabel("Number of drops: ")
lbl2 = JLabel(" PI = ")
tf1 = JTextField(6)
tf2 = JTextField(10)
btn1 = JButton("OK", actionListener = actionCallback)
makeGPanel("Monte Carlo Simulation", -0.1, 1.1, -0.1, 1.1)
createGUI()
tf1.setText("10000")
init()
while True:
putSleep()
init()
n = int(tf1.getText())
k = doIt(n)
pi = 4 * k / n
tf2.setText(str(pi))
示例7: VolatilitySettingsWithUISettingsPanel
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class VolatilitySettingsWithUISettingsPanel(IngestModuleIngestJobSettingsPanel):
# Note, we can't use a self.settings instance variable.
# Rather, self.local_settings is used.
# https://wiki.python.org/jython/UserGuide#javabean-properties
# Jython Introspector generates a property - 'settings' on the basis
# of getSettings() defined in this class. Since only getter function
# is present, it creates a read-only 'settings' property. This auto-
# generated read-only property overshadows the instance-variable -
# 'settings'
# We get passed in a previous version of the settings so that we can
# prepopulate the UI
# TODO: Update this for your UI
def __init__(self, settings):
self.local_settings = settings
self.initComponents()
self.customizeComponents()
# When button to find file is clicked then open dialog to find the file and return it.
def Find_Dir(self, e):
chooseFile = JFileChooser()
filter = FileNameExtensionFilter("All", ["*.*"])
chooseFile.addChoosableFileFilter(filter)
#chooseFile.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
ret = chooseFile.showDialog(self.panel0, "Find Volatility Directory")
if ret == JFileChooser.APPROVE_OPTION:
file = chooseFile.getSelectedFile()
Canonical_file = file.getCanonicalPath()
#text = self.readPath(file)
self.local_settings.setSetting('Volatility_Directory', Canonical_file)
self.Program_Executable_TF.setText(Canonical_file)
def keyPressed(self, event):
self.local_settings.setProcessIDs(self.Process_Ids_To_Dump_TF.getText())
#self.Error_Message.setText(self.Process_Ids_To_Dump_TF.getText())
def checkBoxEvent(self, event):
if self.Check_Box.isSelected():
self.local_settings.setSetting('Flag', 'true')
else:
self.local_settings.setSetting('Flag', 'False')
# Create the initial data fields/layout in the UI
def initComponents(self):
self.panel0 = JPanel()
self.rbgPanel0 = ButtonGroup()
self.gbPanel0 = GridBagLayout()
self.gbcPanel0 = GridBagConstraints()
self.panel0.setLayout( self.gbPanel0 )
self.Error_Message = JLabel( "")
self.Error_Message.setEnabled(True)
self.gbcPanel0.gridx = 2
self.gbcPanel0.gridy = 15
self.gbcPanel0.gridwidth = 1
self.gbcPanel0.gridheight = 1
self.gbcPanel0.fill = GridBagConstraints.BOTH
self.gbcPanel0.weightx = 1
self.gbcPanel0.weighty = 0
self.gbcPanel0.anchor = GridBagConstraints.NORTH
self.gbPanel0.setConstraints( self.Error_Message, self.gbcPanel0 )
self.panel0.add( self.Error_Message )
self.Label_1 = JLabel("Volatility Executable Directory")
self.Label_1.setEnabled(True)
self.gbcPanel0.gridx = 2
self.gbcPanel0.gridy = 1
self.gbcPanel0.gridwidth = 1
self.gbcPanel0.gridheight = 1
self.gbcPanel0.fill = GridBagConstraints.BOTH
self.gbcPanel0.weightx = 1
self.gbcPanel0.weighty = 0
self.gbcPanel0.anchor = GridBagConstraints.NORTH
self.gbPanel0.setConstraints( self.Label_1, self.gbcPanel0 )
self.panel0.add( self.Label_1 )
self.Program_Executable_TF = JTextField(10)
self.Program_Executable_TF.setEnabled(True)
self.gbcPanel0.gridx = 2
self.gbcPanel0.gridy = 3
self.gbcPanel0.gridwidth = 1
self.gbcPanel0.gridheight = 1
self.gbcPanel0.fill = GridBagConstraints.BOTH
self.gbcPanel0.weightx = 1
self.gbcPanel0.weighty = 0
self.gbcPanel0.anchor = GridBagConstraints.NORTH
self.gbPanel0.setConstraints( self.Program_Executable_TF, self.gbcPanel0 )
self.panel0.add( self.Program_Executable_TF )
self.Find_Program_Exec_BTN = JButton( "Find Dir", actionPerformed=self.Find_Dir)
self.Find_Program_Exec_BTN.setEnabled(True)
self.rbgPanel0.add( self.Find_Program_Exec_BTN )
self.gbcPanel0.gridx = 6
self.gbcPanel0.gridy = 3
self.gbcPanel0.gridwidth = 1
self.gbcPanel0.gridheight = 1
#.........这里部分代码省略.........
示例8: Config
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
#.........这里部分代码省略.........
labels.add(clear_butt)
labels.add(spider_butt)
labels.add(JLabel(""))
labels.add(save_butt)
labels.add(rest_butt)
labels.add(load_plug_butt)
# Tool tips!
self.delim.setToolTipText("Use to manipulate the final URL. "
"See About tab for example.")
self.ext_white_list.setToolTipText("Define a comma delimited list of"
" file extensions to parse. Use *"
" to parse all files.")
self.url.setToolTipText("Enter the target URL")
checkbox.setToolTipText("Parse files line by line using plugins"
" to enumerate language/framework specific"
" endpoints")
parse_butt.setToolTipText("Attempt to enumerate application endpoints")
clear_butt.setToolTipText("Clear status window and the parse results")
spider_butt.setToolTipText("Process discovered endpoints")
save_butt.setToolTipText("Saves the current config settings")
rest_butt.setToolTipText("<html>Restores previous config settings:"
"<br/>-Input Directory<br/>-String Delim"
"<br/>-Ext WL<br/>-URL<br/>-Plugins")
source_butt.setToolTipText("Select the application's "
"source directory or file to parse")
self.path_vars.setToolTipText("Supply a JSON object with values"
"for dynamically enumerated query"
"string variables")
return labels
def set_url(self, menu_url):
"""Changes the configuration URL to the one from the menu event"""
self.url.setText(menu_url)
# Event functions
def set_parse(self, event):
"""
Handles the click event from the UI checkbox
to attempt code level parsing
"""
self.parse_files = not self.parse_files
if self.parse_files:
if not self.loaded_plugins:
self._plugins_missing_warning()
def restore(self, event):
"""Attempts to restore the previously saved configuration."""
jdump = None
try:
jdump = loads(self._callbacks.loadExtensionSetting("config"))
except Exception as exc: # Generic exception thrown directly to user
self.update_scroll(
"[!!] Error during restore!\n\tException: %s" % str(exc))
if jdump is not None:
self.url.setText(jdump.get('URL'))
# self.cookies.setText(jdump.get('Cookies'))
# self.headers.setText(jdump.get("Headers"))
ewl = ""
for ext in jdump.get('Extension Whitelist'):
ewl += ext + ", "
self.ext_white_list.setText(ewl[:-2])
self.delim.setText(jdump.get('String Delimiter'))
self.source_input = jdump.get("Input Directory")
self.config['Plugin Folder'] = jdump.get("Plugin Folder")
if (self.config['Plugin Folder'] is not None and
示例9: DemultiplexGUI
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class DemultiplexGUI(Runnable):
global SampleSheet
def __init__(self):
self.f = JFrame("Demultiplex the data")
self.f.setSize(1250, 1000)
self.f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
#Progress Monitor
self.pm=JProgressBar(100,100)
#Lane Area
self.LaneAre=JPanel()
self.lane1=JCheckBox("Lane 1", True)
self.lane2=JCheckBox("Lane 2", True)
self.lane3=JCheckBox("Lane 3", True)
self.lane4=JCheckBox("Lane 4", True)
self.lane5=JCheckBox("Lane 5", True)
self.lane6=JCheckBox("Lane 6", True)
self.lane7=JCheckBox("Lane 7", True)
self.lane8=JCheckBox("Lane 8", True)
self.LaneAre.add(self.lane1)
self.LaneAre.add(self.lane2)
self.LaneAre.add(self.lane3)
self.LaneAre.add(self.lane4)
self.LaneAre.add(self.lane5)
self.LaneAre.add(self.lane6)
self.LaneAre.add(self.lane7)
self.LaneAre.add(self.lane8)
self.txtArea = JPanel(GridLayout(15,0))
#self.txtArea.setPreferredSize(Dimension(150, 150))
self.textAreaForSheet = JTextField(30)
self.textAreaInputForFolder = JTextField(30)
self.textAreaOutPutFolder= JTextField(30)
self.txtArea.add(self.textAreaForSheet)
self.txtArea.add(self.textAreaInputForFolder)
self.txtArea.add(self.textAreaOutPutFolder)
self.txtArea.add(self.LaneAre)
self.buttonArea = JPanel(GridLayout(15,0))
#self.buttonArea.setPreferredSize(Dimension(150, 150))
self.sampleSheetBtn = JButton("SampleSheet", actionPerformed=self.onClickSample)
self.runOutPutFolder = JButton("RUN Folder",actionPerformed=self.onClickRun)
self.DemultiplexOutPutFolder = JButton("Output Folder",actionPerformed=self.onClickOut)
self.buttonArea.add(self.sampleSheetBtn)
self.buttonArea.add(self.runOutPutFolder)
self.buttonArea.add(self.DemultiplexOutPutFolder)
self.CheckBox = JPanel(GridLayout(15,0))
#self.buttonArea.setPreferredSize(Dimension(150, 150))
self.Iter1 = JCheckBox("01_0M_NY", True,)
self.Iter2 = JCheckBox("02_0M_N", True,)
self.Iter3 = JCheckBox("03_1M_NY", True,)
self.Iter4 = JCheckBox("04_1M_N", True,)
self.CheckBox.add(self.Iter1)
self.CheckBox.add(self.Iter2)
self.CheckBox.add(self.Iter3)
self.CheckBox.add(self.Iter4)
self.ExecutePanel = JPanel()
self.console=JTextArea(20,100)
self.sp = JScrollPane(self.console);
self.RunBtn = JButton("Demultiplex",actionPerformed= self.performDemultiplex)
self.CanBtn = JButton("Cancel",actionPerformed= self.CancelJob)
self.ExecutePanel.add(self.RunBtn)
self.ExecutePanel.add(self.CanBtn)
self.ExecutePanel.add(self.sp, BorderLayout.CENTER)
self.f.add(self.txtArea, BorderLayout.CENTER)
self.f.add(self.buttonArea, BorderLayout.WEST)
self.f.add(self.CheckBox, BorderLayout.EAST)
self.f.add(self.ExecutePanel, BorderLayout.NORTH)
self.f.add(self.pm,BorderLayout.SOUTH)
def run(self):
self.f.setVisible(True)
def onClickRun(self,event=""):
self.DirName= FolderChooser(self.f)
self.textAreaInputForFolder.setText(str(self.DirName))
def onClickOut(self,event=""):
self.OutDirName= FolderChooser(self.f)
self.textAreaOutPutFolder.setText(str(self.OutDirName))
def onClickSample(self,event):
self.sampleSheet=FileChooser(self.f)
self.textAreaForSheet.setText(str(self.sampleSheet))
def performDemultiplex(self,event):
NumberOfIterations=[self.Iter1.selected,self.Iter2.selected,self.Iter3.selected,self.Iter4.selected]
LaneNumber=[self.lane1.selected,self.lane2.selected,self.lane3.selected,self.lane4.selected,self.lane5.selected,self.lane6.selected,self.lane7.selected,self.lane8.selected]
selectedLanes = [str(i+1) for i, x in enumerate(LaneNumber) if x==True]
lanes=','.join(selectedLanes)
#.........这里部分代码省略.........
示例10: VolatilitySettingsWithUISettingsPanel
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class VolatilitySettingsWithUISettingsPanel(IngestModuleIngestJobSettingsPanel):
# Note, we can't use a self.settings instance variable.
# Rather, self.local_settings is used.
# https://wiki.python.org/jython/UserGuide#javabean-properties
# Jython Introspector generates a property - 'settings' on the basis
# of getSettings() defined in this class. Since only getter function
# is present, it creates a read-only 'settings' property. This auto-
# generated read-only property overshadows the instance-variable -
# 'settings'
# We get passed in a previous version of the settings so that we can
# prepopulate the UI
# TODO: Update this for your UI
_logger = Logger.getLogger(VolatilityIngestModuleFactory.moduleName)
def log(self, level, msg):
self._logger.logp(level, self.__class__.__name__, inspect.stack()[1][3], msg)
def __init__(self, settings):
self.local_settings = settings
self.initComponents()
self.customizeComponents()
# Check the checkboxs to see what actions need to be taken
def checkBoxEvent(self, event):
if self.Exclude_File_Sources_CB.isSelected():
self.local_settings.setSetting('Exclude_File_Sources', 'true')
else:
self.local_settings.setSetting('Exclude_File_Sources', 'false')
def get_plugins(self):
head, tail = os.path.split(os.path.abspath(__file__))
settings_db = os.path.join(head, "GUI_Settings.db3")
try:
Class.forName("org.sqlite.JDBC").newInstance()
dbConn = DriverManager.getConnection("jdbc:sqlite:%s" % settings_db)
self.Error_Message.setText("Database opened")
except SQLException as e:
self.Error_Message.setText("Error Opening Settings DB!")
try:
stmt = dbConn.createStatement()
SQL_Statement = "select plugin_name from plugins where volatility_version = '" + self.Version_CB.getSelectedItem() + "';"
resultSet = stmt.executeQuery(SQL_Statement)
plugin_list = []
while resultSet.next():
plugin_list.append(resultSet.getString("plugin_name"))
stmt.close()
dbConn.close()
return plugin_list
except SQLException as e:
self.Error_Message.setText("Error Reading plugins")
stmt.close()
dbConn.close()
return "Error"
def get_profiles(self):
head, tail = os.path.split(os.path.abspath(__file__))
settings_db = os.path.join(head, "GUI_Settings.db3")
try:
Class.forName("org.sqlite.JDBC").newInstance()
dbConn = DriverManager.getConnection("jdbc:sqlite:%s" % settings_db)
self.Error_Message.setText("Database opened")
except SQLException as e:
self.Error_Message.setText("Error Opening Settings DB!")
try:
stmt = dbConn.createStatement()
SQL_Statement = "select profile_name from profiles where volatility_version = '" + self.Version_CB.getSelectedItem() + "';"
resultSet = stmt.executeQuery(SQL_Statement)
profile_list = []
while resultSet.next():
profile_list.append(resultSet.getString("profile_name"))
stmt.close()
dbConn.close()
return profile_list
except SQLException as e:
self.Error_Message.setText("Error Reading plugins")
stmt.close()
dbConn.close()
return "Error"
# When button to find file is clicked then open dialog to find the file and return it.
def Find_Dir(self, e):
chooseFile = JFileChooser()
filter = FileNameExtensionFilter("All", ["*.*"])
chooseFile.addChoosableFileFilter(filter)
#chooseFile.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
ret = chooseFile.showDialog(self.panel0, "Find Volatility Directory")
if ret == JFileChooser.APPROVE_OPTION:
file = chooseFile.getSelectedFile()
Canonical_file = file.getCanonicalPath()
#text = self.readPath(file)
self.local_settings.setSetting('Volatility_Directory', Canonical_file)
#.........这里部分代码省略.........
示例11: BurpExtender
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class BurpExtender(IBurpExtender,ITab,IHttpListener):
def registerExtenderCallbacks(self,callbacks):
self.callbacks = callbacks
self.helpers = callbacks.getHelpers()
self.callbacks.setExtensionName("KkMultiProxy")
self.PROXY_LIST = []
self.jPanel = JPanel()
boxVertical = Box.createVerticalBox()
boxHorizontal = Box.createHorizontalBox()
boxHorizontal.add(JButton("File",actionPerformed=self.getFile))
self.FileText = JTextField("")
boxHorizontal.add(self.FileText)
boxVertical.add(boxHorizontal)
TableHeader = ('IP','PORT')
TableModel = DefaultTableModel(self.PROXY_LIST,TableHeader)
self.Table = JTable(TableModel)
boxVertical.add(self.Table)
boxHorizontal = Box.createHorizontalBox()
boxHorizontal.add(JButton("Add",actionPerformed=self.addIP))
boxHorizontal.add(JButton("Delete",actionPerformed=self.deleteIP))
boxHorizontal.add(JButton("Save",actionPerformed=self.saveIP))
boxVertical.add(boxHorizontal)
self.jPanel.add(boxVertical)
self.callbacks.addSuiteTab(self)
self.callbacks.registerHttpListener(self)
return
def getFile(self,button):
dlg = JFileChooser()
result = dlg.showOpenDialog(None)
if result == JFileChooser.APPROVE_OPTION:
f = dlg.getSelectedFile()
path = f.getPath()
self.FileText.setText(path)
try:
self.getIPList(path)
except:
exit(0)
def addIP(self,button):
#chooser = JFileChooser()
#chooser.showOpenDialog(None)
demo = DialogDemo(self.Table)
def deleteIP(self,button):
selectRows = len(self.Table.getSelectedRows())
TableModel = self.Table.getModel()
if selectRows:
selectedRowIndex = self.Table.getSelectedRow()
TableModel.removeRow(selectedRowIndex)
def saveIP(self,button):
TableModel = self.Table.getModel()
rowCount = TableModel.getRowCount()
result_str = ""
for i in range(rowCount):
if i == 0:
result_str+=TableModel.getValueAt(i,0)+':'+TableModel.getValueAt(i,1)
else:
result_str+='|'+TableModel.getValueAt(i,0)+':'+TableModel.getValueAt(i,1)
print result_str
f = open(self.FileText.getText(),'w+')
f.write(result_str)
f.close()
def getTabCaption(self):
return "MultiProxy"
def getUiComponent(self):
return self.jPanel
def processHttpMessage(self,toolFlag,messageIsRequest,messageInfo):
if messageIsRequest:
httpService = messageInfo.getHttpService()
print httpService.getHost()
# if the host is HOST_FROM, change it to HOST_TO
i = randint(0,len(self.TableDatas)-1)
messageInfo.setHttpService(self.helpers.buildHttpService(self.PROXY_LIST[i]['ip'], self.PROXY_LIST[i]['port'], httpService.getProtocol()))
print messageInfo.getHttpService().getHost()
def getIPList(self,path):
f = open(path,'r+')
content = f.read()
f.close()
if content:
ip_array = content.split('|')
for _ip in ip_array:
ip = _ip.split(':')[0]
port = _ip.split(':')[1]
self.PROXY_LIST.append([ip,port])
print self.PROXY_LIST
示例12: ConfigurableConfigPanel
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class ConfigurableConfigPanel(ConfigPanel, ActionListener, DocumentListener, ChangeListener):
""" generated source for class ConfigurableConfigPanel """
serialVersionUID = 1L
associatedFile = File()
associatedFileField = JTextField()
params = JSONObject()
savedParams = str()
loadButton = JButton()
saveAsButton = JButton()
saveButton = JButton()
name = JTextField()
strategy = JComboBox()
metagameStrategy = JComboBox()
stateMachine = JComboBox()
cacheStateMachine = JCheckBox()
maxPlys = JSpinner()
heuristicFocus = JSpinner()
heuristicMobility = JSpinner()
heuristicOpponentFocus = JSpinner()
heuristicOpponentMobility = JSpinner()
mcDecayRate = JSpinner()
rightPanel = JPanel()
def __init__(self):
""" generated source for method __init__ """
super(ConfigurableConfigPanel, self).__init__(GridBagLayout())
leftPanel = JPanel(GridBagLayout())
leftPanel.setBorder(TitledBorder("Major Parameters"))
self.rightPanel = JPanel(GridBagLayout())
self.rightPanel.setBorder(TitledBorder("Minor Parameters"))
self.strategy = JComboBox([None]*)
self.metagameStrategy = JComboBox([None]*)
self.stateMachine = JComboBox([None]*)
self.cacheStateMachine = JCheckBox()
self.maxPlys = JSpinner(SpinnerNumberModel(1, 1, 100, 1))
self.heuristicFocus = JSpinner(SpinnerNumberModel(1, 0, 10, 1))
self.heuristicMobility = JSpinner(SpinnerNumberModel(1, 0, 10, 1))
self.heuristicOpponentFocus = JSpinner(SpinnerNumberModel(1, 0, 10, 1))
self.heuristicOpponentMobility = JSpinner(SpinnerNumberModel(1, 0, 10, 1))
self.mcDecayRate = JSpinner(SpinnerNumberModel(0, 0, 99, 1))
self.name = JTextField()
self.name.setColumns(20)
self.name.setText("Player #" + Random().nextInt(100000))
self.loadButton = JButton(loadButtonMethod())
self.saveButton = JButton(saveButtonMethod())
self.saveAsButton = JButton(saveAsButtonMethod())
self.associatedFileField = JTextField()
self.associatedFileField.setEnabled(False)
buttons = JPanel()
buttons.add(self.loadButton)
buttons.add(self.saveButton)
buttons.add(self.saveAsButton)
nRow = 0
leftPanel.add(JLabel("Name"), GridBagConstraints(0, nRow, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, Insets(5, 5, 5, 5), 5, 5))
__nRow_0 = nRow
nRow += 1
leftPanel.add(self.name, GridBagConstraints(1, __nRow_0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, Insets(5, 5, 5, 5), 5, 5))
leftPanel.add(JLabel("Gaming Strategy"), GridBagConstraints(0, nRow, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, Insets(5, 5, 5, 5), 5, 5))
__nRow_1 = nRow
nRow += 1
leftPanel.add(self.strategy, GridBagConstraints(1, __nRow_1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, Insets(5, 5, 5, 5), 5, 5))
leftPanel.add(JLabel("Metagame Strategy"), GridBagConstraints(0, nRow, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, Insets(5, 5, 5, 5), 5, 5))
__nRow_2 = nRow
nRow += 1
leftPanel.add(self.metagameStrategy, GridBagConstraints(1, __nRow_2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, Insets(5, 5, 5, 5), 5, 5))
leftPanel.add(JLabel("State Machine"), GridBagConstraints(0, nRow, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, Insets(5, 5, 5, 5), 5, 5))
__nRow_3 = nRow
nRow += 1
leftPanel.add(self.stateMachine, GridBagConstraints(1, __nRow_3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, Insets(5, 5, 5, 5), 5, 5))
__nRow_4 = nRow
nRow += 1
leftPanel.add(buttons, GridBagConstraints(1, __nRow_4, 2, 1, 1.0, 1.0, GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, Insets(5, 5, 0, 5), 0, 0))
leftPanel.add(self.associatedFileField, GridBagConstraints(0, nRow, 2, 1, 1.0, 0.0, GridBagConstraints.SOUTHEAST, GridBagConstraints.HORIZONTAL, Insets(0, 5, 5, 5), 0, 0))
layoutRightPanel()
add(leftPanel, GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, Insets(5, 5, 5, 5), 5, 5))
add(self.rightPanel, GridBagConstraints(1, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, Insets(5, 5, 5, 5), 5, 5))
self.params = JSONObject()
syncJSONtoUI()
self.strategy.addActionListener(self)
self.metagameStrategy.addActionListener(self)
self.stateMachine.addActionListener(self)
self.cacheStateMachine.addActionListener(self)
self.maxPlys.addChangeListener(self)
self.heuristicFocus.addChangeListener(self)
self.heuristicMobility.addChangeListener(self)
self.heuristicOpponentFocus.addChangeListener(self)
self.heuristicOpponentMobility.addChangeListener(self)
self.mcDecayRate.addChangeListener(self)
self.name.getDocument().addDocumentListener(self)
def layoutRightPanel(self):
""" generated source for method layoutRightPanel """
nRow = 0
self.rightPanel.removeAll()
self.rightPanel.add(JLabel("State machine cache?"), GridBagConstraints(0, nRow, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, Insets(5, 5, 5, 5), 5, 5))
__nRow_5 = nRow
nRow += 1
self.rightPanel.add(self.cacheStateMachine, GridBagConstraints(1, __nRow_5, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, Insets(5, 5, 5, 5), 5, 5))
if self.strategy.getSelectedItem().__str__() == "Heuristic":
__nRow_6 = nRow
#.........这里部分代码省略.........
示例13: BurpExtender
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
#.........这里部分代码省略.........
.addComponent(self.grpSTSSettings, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
)
.addComponent(self.cbXCTO)
.addComponent(self.cbXXP)
.addComponent(self.cbRedirToHTTPS)
.addComponent(self.grpConfig, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
)
self.domXSSSourcesRE = re.compile("(location\s*[\[.])|([.\[]\s*[\"']?\s*(arguments|dialogArguments|innerHTML|write(ln)?|open(Dialog)?|showModalDialog|cookie|URL|documentURI|baseURI|referrer|name|opener|parent|top|content|self|frames)\W)|(localStorage|sessionStorage|Database)")
# NOTE: done some optimizations here, original RE caused too much noise
# - added leading dot in the first part - original recognized "<a href=..." etc.
# - removed "value" in first part
self.domXSSSinksRE = re.compile("(\.(src|href|data|location|code|action)\s*[\"'\]]*\s*\+?\s*=)|((replace|assign|navigate|getResponseHeader|open(Dialog)?|showModalDialog|eval|evaluate|execCommand|execScript|setTimeout|setInterval)\s*[\"'\]]*\s*\()")
self.domXSSjQuerySinksRE = re.compile("after\(|\.append\(|\.before\(|\.html\(|\.prepend\(|\.replaceWith\(|\.wrap\(|\.wrapAll\(|\$\(|\.globalEval\(|\.add\(|jQUery\(|\$\(|\.parseHTML\(")
self.headerSTSRE = re.compile("^Strict-Transport-Security:.*?max-age=\"?(\d+)\"?", re.I) # TODO: multiple max-age directives cause confusion!
self.headerXCTORE = re.compile("^X-Content-Type-Options:\s*nosniff\s*$", re.I)
self.headerXXP = re.compile("^X-XSS-Protection:\s*(\d)(?:\s*;\s*mode\s*=\s*\"?(block)\"?)?", re.I)
self.headerLocationHTTPS = re.compile("^(?:Content-)?Location:\s*(https://.*)$", re.I)
callbacks.registerScannerCheck(self)
callbacks.addSuiteTab(self)
def defineCheckBox(self, caption, selected=True, enabled=True):
checkBox = JCheckBox(caption)
checkBox.setSelected(selected)
checkBox.setEnabled(enabled)
return checkBox
def setSTSMinimum(self, e=None):
val = self.inSTSMin.text
if re.match("^\d+$", val):
STSMinimum = int(val)
else:
self.inSTSMin.setText(str(STSMinimum)) # TODO: doesn't works as desired
def saveConfig(self, e=None):
config = {
'passiveChecks': self.cbPassiveChecks.isSelected(),
'DOMXSS': self.cbDOMXSS.isSelected(),
'DOMXSSSources': self.cbDOMXSSSources.isSelected(),
'DOMXSSSinks': self.cbDOMXSSSinks.isSelected(),
'DOMXSSjQuerySinks': self.cbDOMXSSjQuerySinks.isSelected(),
'STS': self.cbSTS.isSelected(),
'STSMin': self.inSTSMin.text,
'XCTO': self.cbXCTO.isSelected(),
'XXP': self.cbXXP.isSelected(),
'RedirToHTTPS': self.cbRedirToHTTPS.isSelected(),
}
self.callbacks.saveExtensionSetting("config", pickle.dumps(config))
def restoreConfig(self, e=None):
storedConfig = self.callbacks.loadExtensionSetting("config")
if storedConfig != None:
try:
config = pickle.loads(storedConfig)
self.cbPassiveChecks.setSelected(config['passiveChecks'])
self.cbDOMXSS.setSelected(config['DOMXSS'])
self.cbDOMXSSSources.setSelected(config['DOMXSSSources'])
self.cbDOMXSSSinks.setSelected(config['DOMXSSSinks'])
self.cbDOMXSSjQuerySinks.setSelected(config['DOMXSSjQuerySinks'])
self.cbSTS.setSelected(config['STS'])
self.inSTSMin.text = config['STSMin']
self.cbXCTO.setSelected(config['XCTO'])
self.cbXXP.setSelected(config['XXP'])
self.cbRedirToHTTPS.setSelected(config['RedirToHTTPS'])
self.setSTSMinimum()
示例14: GroupConversationWindow
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class GroupConversationWindow(GroupConversation):
"""A GUI window of a conversation witha group of people"""
def __init__(self, group, chatui):
GroupConversation.__init__(self, group, chatui)
self.mainframe = JFrame(self.group.name)
self.headers = ["Member"]
self.memberdata = UneditableTableModel([], self.headers)
self.display = JTextArea(columns=100, rows=15, editable=0, lineWrap=1)
self.typepad = JTextField()
self.buildpane()
self.lentext = 0
def show(self):
self.mainframe.pack()
self.mainframe.show()
def hide(self):
self.mainframe.hide()
def showGroupMessage(self, sender, text, metadata=None):
self.displayText(sender + ": " + text)
def setGroupMembers(self, members):
GroupConversation.setGroupMembers(self, members)
self.updatelist()
def setTopic(self, topic, author):
topictext = "Topic: " + topic + ", set by " + author
self.mainframe.setTitle(self.group.name + ": " + topictext)
self.displayText(topictext)
def memberJoined(self, member):
GroupConversation.memberJoined(self, member)
self.updatelist()
def memberChangedNick(self, oldnick, newnick):
GroupConversation.memberChangedNick(self, oldnick, newnick)
self.updatelist()
def memberLeft(self, member):
GroupConversation.memberLeft(self, member)
self.updatelist()
#GUI code
def buildpane(self):
buttons = JPanel(doublebuffered)
buttons.add(JButton("Hide", actionPerformed=self.hidewindow))
memberpane = JTable(self.memberdata)
memberframe = JScrollPane(memberpane)
chat = JPanel(doublebuffered)
chat.setLayout(BoxLayout(chat, BoxLayout.Y_AXIS))
chat.add(JScrollPane(self.display))
self.typepad.actionPerformed = self.send
chat.add(self.typepad)
chat.add(buttons)
mainpane = self.mainframe.getContentPane()
mainpane.setLayout(BoxLayout(mainpane, BoxLayout.X_AXIS))
mainpane.add(chat)
mainpane.add(memberframe)
def displayText(self, text):
self.lentext = self.lentext + len(text)
self.display.append(text)
self.display.setCaretPosition(self.lentext)
def updatelist(self):
self.memberdata.setDataVector([self.members], self.headers)
#actionListener
def send(self, ae):
text = self.typepad.getText()
self.typepad.setText("")
if text != "" and text != None:
GroupConversation.sendText(self, text)
def hidewindow(self, ae):
self.hide()
示例15: TimesketchSettingsWithUISettingsPanel
# 需要导入模块: from javax.swing import JTextField [as 别名]
# 或者: from javax.swing.JTextField import setText [as 别名]
class TimesketchSettingsWithUISettingsPanel(IngestModuleIngestJobSettingsPanel):
# Note, we can't use a self.settings instance variable.
# Rather, self.local_settings is used.
# https://wiki.python.org/jython/UserGuide#javabean-properties
# Jython Introspector generates a property - 'settings' on the basis
# of getSettings() defined in this class. Since only getter function
# is present, it creates a read-only 'settings' property. This auto-
# generated read-only property overshadows the instance-variable -
# 'settings'
# We get passed in a previous version of the settings so that we can
# prepopulate the UI
def __init__(self, settings):
self.local_settings = settings
self.tag_list = []
self.initComponents()
self.customizeComponents()
self.path_to_Timesketch_exe = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Timesketch_api.exe")
# Check to see if the Timesketch server is available and you can talk to it
def Check_Server(self, e):
pipe = Popen([self.path_to_Timesketch_exe, self.Protocol_TF.getText(),self.IP_Address_TF.getText(), self.Port_Number_TF.getText(), "Timesketch_status" ], stdout=PIPE, stderr=PIPE)
out_text = pipe.communicate()[0]
self.Error_Message.setText("Timesketch Status is " + out_text)
#self.log(Level.INFO, "Timesketch Status is ==> " + out_text)
def setIPAddress(self, event):
self.local_settings.setSetting('ipAddress', self.IP_Address_TF.getText())
def setPortNumber(self, event):
self.local_settings.setSetting('portNumber', self.Port_Number_TF.getText())
def setUserName(self, event):
self.local_settings.setSetting('userName', self.userName_TF.getText())
def setPassword(self, event):
self.local_settings.setSetting('password', self.password_TF.getText())
def setsketchName(self, event):
self.local_settings.setSetting('sketchName', self.sketchName_TF.getText())
def setsketchDescription(self, event):
self.local_settings.setSetting('sketchDescription', self.sketchDescription_TF.getText())
# Create the initial data fields/layout in the UI
def initComponents(self):
self.panel0 = JPanel()
self.rbgPanel0 = ButtonGroup()
self.gbPanel0 = GridBagLayout()
self.gbcPanel0 = GridBagConstraints()
self.panel0.setLayout( self.gbPanel0 )
self.Label_2 = JLabel("Timesketch IP Address")
self.Label_2.setEnabled(True)
self.gbcPanel0.gridx = 2
self.gbcPanel0.gridy = 5
self.gbcPanel0.gridwidth = 1
self.gbcPanel0.gridheight = 1
self.gbcPanel0.fill = GridBagConstraints.BOTH
self.gbcPanel0.weightx = 1
self.gbcPanel0.weighty = 0
self.gbcPanel0.anchor = GridBagConstraints.NORTH
self.gbPanel0.setConstraints( self.Label_2, self.gbcPanel0 )
self.panel0.add( self.Label_2 )
self.IP_Address_TF = JTextField(20, focusLost=self.setIPAddress)
self.IP_Address_TF.setEnabled(True)
self.gbcPanel0.gridx = 4
self.gbcPanel0.gridy = 5
self.gbcPanel0.gridwidth = 1
self.gbcPanel0.gridheight = 1
self.gbcPanel0.fill = GridBagConstraints.BOTH
self.gbcPanel0.weightx = 1
self.gbcPanel0.weighty = 0
self.gbcPanel0.anchor = GridBagConstraints.NORTH
self.gbPanel0.setConstraints( self.IP_Address_TF, self.gbcPanel0 )
self.panel0.add( self.IP_Address_TF )
self.Blank_2 = JLabel( " ")
self.Blank_2.setEnabled(True)
self.gbcPanel0.gridx = 2
self.gbcPanel0.gridy = 7
self.gbcPanel0.gridwidth = 1
self.gbcPanel0.gridheight = 1
self.gbcPanel0.fill = GridBagConstraints.BOTH
self.gbcPanel0.weightx = 1
self.gbcPanel0.weighty = 0
self.gbcPanel0.anchor = GridBagConstraints.NORTH
self.gbPanel0.setConstraints( self.Blank_2, self.gbcPanel0 )
self.panel0.add( self.Blank_2 )
self.Label_3 = JLabel("Port Number")
self.Label_3.setEnabled(True)
self.gbcPanel0.gridx = 2
self.gbcPanel0.gridy = 9
self.gbcPanel0.gridwidth = 1
#.........这里部分代码省略.........