本文整理汇总了Python中javax.swing.BorderFactory类的典型用法代码示例。如果您正苦于以下问题:Python BorderFactory类的具体用法?Python BorderFactory怎么用?Python BorderFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BorderFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, cattr):
self.attr = cattr
self.cbox = JColorChooser(self.attr.color)
self.sym_panel = EditSymbolAttr(cattr.sym_prop)
self.thickness_field = JTextField(str(cattr.thickness),2)
self.draw_symbol_box = JCheckBox("Draw Symbol?",cattr.draw_symbol)
self.dps_field = JTextField(str(self.attr.data_per_symbol),2)
self.dash_box = JComboBox(CurveProps.DASH_TYPES.keys())
self.dash_box.setSelectedItem(self.attr.dash_type)
self.dash_box.setBorder(BorderFactory.createTitledBorder("Dash type: (Only JDK2 & Slow!)"))
tpanelx = JPanel()
tpanelx.add(self.thickness_field)
tpanelx.setBorder(BorderFactory.createTitledBorder("curve thickness (integer)"))
tpanely = JPanel()
tpanely.add(self.dps_field)
tpanely.setBorder(BorderFactory.createTitledBorder("data per symbol(integer)"))
tpanel = JPanel();tpanel.setLayout(GridLayout(2,2));
tpanel.add(self.draw_symbol_box); tpanel.add(tpanelx);
tpanel.add(tpanely); tpanel.add(self.dash_box);
panel1 = JPanel()
panel1.setLayout(BorderLayout())
panel1.add(self.cbox,BorderLayout.CENTER)
panel1.add(tpanel, BorderLayout.SOUTH)
panel2 = JPanel()
panel2.setLayout(BorderLayout())
panel2.add(self.sym_panel,BorderLayout.CENTER)
tp1 = JTabbedPane()
tp1.addTab("Curve Attributes",panel1)
tp1.addTab("Symbol Attributes",panel2)
tp1.setSelectedComponent(panel1)
self.setLayout(BorderLayout())
self.add(tp1,BorderLayout.CENTER)
示例2: __init__
def __init__(self, window, checks_disabled, runcode):
InputPane.__init__(self, window)
outside = BorderFactory.createLoweredBevelBorder()
self.component.border = BorderFactory.createCompoundBorder(
outside,
self.component.border
)
self.checks_disabled = checks_disabled
self.runcode = runcode
示例3: warn
def warn(self, e):
errorNumber = self.textfield.getText()
if errorNumber == "":
self.textfield.setBorder(self.defaultborder)
return
try:
Integer.parseInt(errorNumber)
except NumberFormatException:
self.textfield.setBorder(BorderFactory.createLineBorder(Color.RED, 1))
return
self.textfield.setBorder(BorderFactory.createLineBorder(Color.GREEN, 1))
示例4: __init__
def __init__(self):
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
size = Dimension(800, 800)
self.setPreferredSize(size)
screenSize = Toolkit.getDefaultToolkit().getScreenSize();
self.setLocation(screenSize.getSize().width/2 - size.width/2, 100)
self.setTitle("bashED Terminal HQ EXTREME");
self.setUndecorated(True)
self.getRootPane().setOpaque(False)
#self.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
self.setBackground(Color(0,128,0, 198))
#j = JDesktopPane()
#j.setOpaque(False)
self.setLayout(None)
self.setIconImage(ImageIcon('bin/gui/media/' + "icon.png").getImage())
mp = MainPanel()
self.add(mp)
mp.setBounds(0, 0, size.width, size.height)
imageTest = ImageIcon('bin/gui/media/' + "image.png")
imageTestLabel = JLabel(imageTest)
self.add(imageTestLabel)
imageTestLabel.setBounds(0, 0, size.width, size.height)
#self.getContentPane().add(mp)
#self.getContentPane().add(JLabel("Iglo"))
bb = BorderFactory.createLineBorder(Color.BLACK, 5)
bw1 = BorderFactory.createLineBorder(Color.WHITE, 1)
bw2 = BorderFactory.createLineBorder(Color.WHITE, 1)
mp.setBorder( BorderFactory.createCompoundBorder( bw1, BorderFactory.createCompoundBorder(bb, bw2) ))
#make the window viewable
self.defaultCloseOperation=JFrame.EXIT_ON_CLOSE
self.pack()
self.setVisible(True)
示例5: add_template
def add_template(self,name,constructor,image):
icon = ImageIcon(image)
if icon.iconWidth>self.max_icon_width:
icon = ImageIcon(icon.image.getScaledInstance(self.max_icon_width,icon.iconHeight*self.max_icon_width/icon.iconWidth,Image.SCALE_SMOOTH))
panel = JPanel(layout = BorderLayout(),opaque = False)
button = JButton(icon = icon,toolTipText = name.replace('\n',' '),
borderPainted = False,focusPainted = False,contentAreaFilled = False,margin = java.awt.Insets(0,0,0,0),
verticalTextPosition = AbstractButton.BOTTOM,horizontalTextPosition = AbstractButton.CENTER,
mousePressed = lambda e: e.source.transferHandler.exportAsDrag(e.source,e,TransferHandler.COPY))
button.transferHandler = self
panel.add(button)
text = '<html><center>%s</center></html>'%name.replace('\n','<br/>')
label = JLabel(text,horizontalAlignment = SwingConstants.CENTER,foreground = Color.WHITE)
self.labels.append(label)
panel.add(label,BorderLayout.SOUTH)
self.panels.append(panel)
panel.alignmentY = Component.CENTER_ALIGNMENT
panel.border = BorderFactory.createEmptyBorder(2,1,2,1)
panel.maximumSize = panel.preferredSize
self.panel.add(panel)
self.templates[button] = constructor
示例6: __init__
def __init__(self, controller):
'''
Creates default empty console-looking panel.
It should be separated from the rest of the GUI so that users can choose
to show or hide the console. Or should it be a split panel?
This panel will display log and validation/lemmatization messages.
It might need its own toolbar for searching, etc.
It will also accept commands in later stages of development, if need be.
'''
#Give reference to controller to delegate action response
self.controller = controller
#Make text area occupy all available space and resize with parent window
self.setLayout(BorderLayout())
#Create console-looking area
self.editArea = JTextArea()
self.editArea.border = BorderFactory.createEmptyBorder(4,4,4,4)
self.editArea.font = Font("Courier New", Font.BOLD, 14)
self.editArea.background = Color.BLACK
self.editArea.foreground = Color.WHITE
self.editArea.text = "Console started. Nammu's log will appear here.\n\n"
#Will need scrolling controls
scrollingText = JScrollPane(self.editArea)
scrollingText.setPreferredSize(Dimension(1,150))
#Make text area auto scroll down to last printed line
caret = self.editArea.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
#Add to parent panel
self.add(scrollingText, BorderLayout.CENTER)
示例7: initComponents
def initComponents(self):
self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
#self.setLayout(GridLayout(0,1))
self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
self.panel1 = JPanel()
self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS))
self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
self.checkbox = JCheckBox("Create Content View of Unique Event Id's", actionPerformed=self.checkBoxEvent)
self.checkbox4 = JCheckBox("Other - Input in text area below then check this box", actionPerformed=self.checkBoxEvent)
self.text1 = JLabel("*** Only run this once otherwise it adds it to the data again.")
self.text2 = JLabel(" ")
self.text3 = JLabel("*** Format is a comma delimited text ie: 8001, 8002")
self.panel1.add(self.checkbox)
self.panel1.add(self.text1)
self.panel1.add(self.text2)
self.panel1.add(self.checkbox4)
self.panel1.add(self.text3)
self.add(self.panel1)
self.area = JTextArea(5,25)
#self.area.addKeyListener(self)
self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0))
self.pane = JScrollPane()
self.pane.getViewport().add(self.area)
#self.pane.addKeyListener(self)
#self.add(self.area)
self.add(self.pane)
示例8: run
def run(self):
self.size = (200,300)
self.contentPane.layout = awt.BorderLayout()
line = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)
Panel1=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER))
Panel1.setBorder(line)
label=swing.JLabel("")
label.setText("Liste des Genes")
Panel1.add(label)
menu = swing.JMenuBar()
Panel1.add(menu)
Panel2=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER))
Panel2.setBorder(line)
self.__displistgenes = swing.JList(self.__listgenes)
self.__displistgenes.setVisibleRowCount(14)
self.__displistgenes.setFixedCellWidth(75)
Panel2.add(self.__displistgenes)
barre = swing.JScrollPane(self.__displistgenes)
Panel2.add(barre)
Panel3=swing.JPanel(awt.FlowLayout(awt.FlowLayout.RIGHT))
Panel3.setBorder(line)
self.contentPane.add(Panel1, awt.BorderLayout.NORTH)
self.contentPane.add(Panel2, awt.BorderLayout.CENTER)
self.contentPane.add(Panel3, awt.BorderLayout.SOUTH)
示例9: __init__
def __init__(self, parent, title, modal, app):
self.app = app
self.setSize(400, 450)
border = BorderFactory.createEmptyBorder(5, 7, 5, 7)
self.getContentPane().setBorder(border)
self.setLayout(BorderLayout(5, 5))
#Intro
introLbl = JLabel("<html>%s</html>" % self.app.strings.getString("error_info_intro"))
#Panel for displaying error info
self.infoPanel = HtmlPanel()
self.infoPanel.getEditorPane().addHyperlinkListener(self)
self.scrollPane = JScrollPane(self.infoPanel)
#OK button
btnPanel = JPanel(FlowLayout(FlowLayout.CENTER))
okBtn = JButton(self.app.strings.getString("OK"),
ImageProvider.get("ok"),
actionPerformed=self.on_okBtn_clicked)
btnPanel.add(okBtn)
#Layout
self.add(introLbl, BorderLayout.PAGE_START)
self.add(self.scrollPane, BorderLayout.CENTER)
self.add(btnPanel, BorderLayout.PAGE_END)
self.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE)
示例10: __init__
def __init__(self, controller):
'''
Creates default empty text area in a panel.
It will contain the ATF file content, and allow text edition.
It should highlight reserved words and suggest autocompletion or
possible typos, a la IDEs like Eclipse.
It might need refactoring so that there is a parent panel with two modes
or contexts, depending on user choice: text view or model view.
'''
#Give reference to controller to delegate action response
self.controller = controller
#Make text area occupy all available space and resize with parent window
self.setLayout(BorderLayout())
#Create text edition area
self.editArea = JTextArea()
self.editArea.border = BorderFactory.createEmptyBorder(4,4,4,4)
self.editArea.font = Font("Monaco", Font.PLAIN, 14)
#Will need scrolling controls
scrollingText = JScrollPane(self.editArea)
scrollingText.setPreferredSize(Dimension(1,500))
#Add to parent panel
self.add(scrollingText, BorderLayout.CENTER)
示例11: initComponents
def initComponents(self):
self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
#self.setLayout(GridLayout(0,1))
self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
self.panel1 = JPanel()
self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS))
self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
self.checkbox = JCheckBox("All Logs", actionPerformed=self.checkBoxEvent)
self.checkbox1 = JCheckBox("Application.Evtx", actionPerformed=self.checkBoxEvent)
self.checkbox2 = JCheckBox("Security.EVTX", actionPerformed=self.checkBoxEvent)
self.checkbox3 = JCheckBox("System.EVTX", actionPerformed=self.checkBoxEvent)
self.checkbox4 = JCheckBox("Other - Input in text area below then check this box", actionPerformed=self.checkBoxEvent)
self.panel1.add(self.checkbox)
self.panel1.add(self.checkbox1)
self.panel1.add(self.checkbox2)
self.panel1.add(self.checkbox3)
self.panel1.add(self.checkbox4)
self.add(self.panel1)
self.area = JTextArea(5,25)
#self.area.addKeyListener(self)
self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0))
self.pane = JScrollPane()
self.pane.getViewport().add(self.area)
#self.pane.addKeyListener(self)
#self.add(self.area)
self.add(self.pane)
示例12: run
def run(self):
self.size = (200, 300)
self.contentPane.layout = awt.BorderLayout()
line = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)
Panel1=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER))
Panel1.setBorder(line)
label=swing.JLabel("")
label.setText("Liste des noms de boites")
Panel1.add(label)
Panel2=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER))
Panel2.setBorder(line)
self.__displistnomb = swing.JList(self.__listnomb)
self.__displistnomb.setVisibleRowCount(14)
Panel2.add(self.__displistnomb)
barre = swing.JScrollPane(self.__displistnomb)
Panel2.add(barre)
Panel3=swing.JPanel(awt.FlowLayout(awt.FlowLayout.RIGHT))
Panel3.setBorder(line)
self.contentPane.add(Panel1, awt.BorderLayout.NORTH)
self.contentPane.add(Panel2, awt.BorderLayout.CENTER)
self.contentPane.add(Panel3, awt.BorderLayout.SOUTH)
示例13: render
def render(self):
'''Render on the frame the login panel with the fields needed to
authenticate with the Asterisk manager.'''
self.layout = GridLayout(0,2)
self.setBorder(BorderFactory.createTitledBorder('Asterisk account information'))
self.hostname = EnhancedTextField('localhost', 15)
self.add(JLabel('Hostname:'))
self.add(self.hostname)
self.username = EnhancedTextField('manager', 15)
self.add(JLabel('Username:'))
self.add(self.username)
self.password = EnhancedPasswordField('pa55word', 15)
self.add(JLabel('Password:'))
self.add(self.password)
self.extension = EnhancedTextField('SIP/John', 15)
self.add(JLabel('Extension:'))
self.add(self.extension)
self.login = JButton('Log in', actionPerformed=self.buttonAction)
self.add(self.login)
self.status = JLabel('Awaiting information...')
self.add(self.status)
示例14: run
def run(self):
self.size = (200, 400)
self.contentPane.layout = awt.BorderLayout()
line = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)
Panel1=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER))
Panel1.setBorder(line)
label=swing.JLabel("")
label.setText("Liste des numeros de boites")
Panel1.add(label)
Panel2=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER))
Panel2.setBorder(line)
self.__displistnumb = swing.JList(self.__listnumb)
Panel2.add(self.__displistnumb)
barre = swing.JScrollPane(self.__displistnumb)
Panel2.add(barre)
Panel3=swing.JPanel(awt.FlowLayout(awt.FlowLayout.RIGHT))
Panel3.setBorder(line)
select = swing.JButton("Select", actionPerformed=self.__select)
Panel3.add(select)
close = swing.JButton("Close", size=(100, 70), actionPerformed=self.__close)
Panel3.add(close)
self.contentPane.add(Panel1, awt.BorderLayout.NORTH)
self.contentPane.add(Panel2, awt.BorderLayout.CENTER)
self.contentPane.add(Panel3, awt.BorderLayout.SOUTH)
示例15: run
def run(self):
self.size = (800, 400)
self.contentPane.layout = awt.BorderLayout()
line = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)
Panel1=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER))
Panel1.setBorder(line)
label=swing.JLabel("")
label.setText("Liste des Images")
Panel1.add(label)
Panel2=swing.JPanel(awt.FlowLayout(awt.FlowLayout.CENTER))
Panel2.setBorder(line)
listtitles=[imp.getTitle() for imp in self.__listimp]
self.__listimages = swing.JList(listtitles)
self.__listimages.setFixedCellWidth(736)
self.__listimages.setVisibleRowCount(30)
barre = swing.JScrollPane(self.__listimages)
Panel2.add(barre)
Panel3=swing.JPanel(awt.FlowLayout(awt.FlowLayout.RIGHT))
Panel3.setBorder(line)
select = swing.JButton("Show Selected", actionPerformed=self.__select)
Panel3.add(select)
hide = swing.JButton("Hide Selected", size=(100, 70), actionPerformed=self.__hide)
Panel3.add(hide)
closeall = swing.JButton("Close All images", size=(100, 70), actionPerformed=self.__closeall)
Panel3.add(closeall)
self.contentPane.add(Panel1, awt.BorderLayout.NORTH)
self.contentPane.add(Panel2, awt.BorderLayout.CENTER)
self.contentPane.add(Panel3, awt.BorderLayout.SOUTH)