Beispiel #1
0
    def _ensure_created(self):
        result = ComponentMixin._ensure_created(self)

        # More room for the button text, so it won't be hidden when the
        # button is a bit small.
        insets = awt.Insets(0, 0, 0, 0)
        self._java_comp.margin = insets

        return result
Beispiel #2
0
 def __init__(self):
     stable.DefaultTableCellRenderer.__init__(self)
     self._component = swing.JTextArea()
     self._component.setLineWrap(True)
     self._label = swing.JTextField()
     self._label.setMargin(awt.Insets(0, 0, 0, 0))
Beispiel #3
0
 def getInsets(self):
     return awt.Insets(5, 5, 5, 5)
Beispiel #4
0
    def showGui(self):
        self.rtvIntJobs()

        self.btnRef = swing.JButton("Refresh List", \
                                    actionPerformed = self.btnActRef, \
                                    minimumSize=(100,25), \
                                    preferredSize=(100, 25))
        self.btnRef.setMnemonic('R')
        self.btnSnd = swing.JButton("Send Message", \
                                    actionPerformed = self.btnActSnd)
        self.btnSnd.setMnemonic('S')
        self.label1 = swing.JLabel("Send To:", minimumSize=(50, 25), \
                                   preferredSize=(50, 25))
        self.rootPane.setDefaultButton(self.btnSnd)
        self.rpyTxt.setEditable(0)      # <Scrollable message reply text area>
        self.statusTxt = swing.JTextField(text='Welcome to CHAT400 - An AS/400 Instant Messenger',\
                                          editable=0, horizontalAlignment=swing.JTextField.CENTER)

        gbc = awt.GridBagConstraints()
        # Build the screen
        # Label 'send to'
        gbc.insets = awt.Insets(10, 10, 5, 5)
        self.contentPane.add(self.label1, gbc)
        # Combobox list of users
        gbc.insets = awt.Insets(10, 5, 5, 5)
        self.contentPane.add(self.users, gbc)
        # Refresh User-List Button
        gbc.insets = awt.Insets(10, 5, 5, 10)
        self.contentPane.add(self.btnRef, gbc)
        # Active Users checkbox
        gbc.gridx = 0
        gbc.gridwidth = 3
        gbc.insets = awt.Insets(0, 0, 5, 0)
        self.contentPane.add(self.chkActive, gbc)
        # Send Message Button
        gbc.gridx = 0
        gbc.gridwidth = 3
        gbc.insets = awt.Insets(5, 0, 5, 0)
        self.contentPane.add(self.btnSnd, gbc)
        # Build the SplitPane (2 scrollpanes)
        scrollPane1 = swing.JScrollPane(self.chatTxt, swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, \
        swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER)
        scrollPane1.setViewportView(self.chatTxt)
        scrollPane2 = swing.JScrollPane(self.rpyTxt, swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, \
        swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER)
        scrollPane2.setViewportView(self.rpyTxt)
        splitPane = swing.JSplitPane(swing.JSplitPane.VERTICAL_SPLIT, scrollPane1, scrollPane2)
        # Add the SplitPane
        gbc.gridx = 0
        gbc.gridwidth = 3
        gbc.fill = awt.GridBagConstraints.HORIZONTAL
        gbc.insets = awt.Insets(5, 10, 10, 10)
        self.contentPane.add(splitPane, gbc)
        # Add a status-textfield on the bottom, to display status or errors
        gbc.gridx = 0
        gbc.gridwidth = 3
        gbc.fill = awt.GridBagConstraints.HORIZONTAL
        gbc.insets = awt.Insets(0, 10, 10, 10)
        self.contentPane.add(self.statusTxt, gbc)

        self.pack()
        self.polchat.start()

        self.show()
 def getBorderInsets(self, c):
     insets = awt.Insets(0, 15, 0, 0)
     return insets
Beispiel #6
0
 def widgetSetUp(self):
     insets = awt.Insets(0, 0, 0, 0)
     self.widget.margin = insets
     self.widget.actionPerformed = self.clickHandler