def init(self): bag = GridBag(self) self.framedArea = FramedArea(self) bag.addRow(self.framedArea, weighty=1.0, fill='BOTH') self.label = awt.Label('Click within the framed area') bag.addRow(self.label, weightx=1.0, weighty=0.0, fill='HORIZONTAL')
def init(self): self.spanish = awt.List(4, 1) self.fillList(self.spanish, ["uno", "dos", "tres", "cuatro", "cinco", "seis", "siete"]) self.italian = awt.List() self.fillList(self.italian, ["uno", "due", "tre", "quattro", "cinque", "sei", "sette"]) self.output = awt.TextArea(10, 40, editable=0) bag = GridBag(self) bag.add(self.output, fill="BOTH", weightx=1.0, weighty=1.0, gridheight=2) bag.addRow(self.spanish, fill="VERTICAL") bag.addRow(self.italian, fill="VERTICAL") self.language = {self.spanish: "Spanish", self.italian: "Italian"}
def init(self): self.spanish = awt.List(4, 1) self.fillList(self.spanish, ['uno', 'dos', 'tres', 'cuatro', 'cinco', 'seis', 'siete']) self.italian = awt.List() self.fillList(self.italian, ['uno', 'due', 'tre', 'quattro', 'cinque', 'sei', 'sette']) self.output = awt.TextArea(10, 40, editable=0) bag = GridBag(self) bag.add(self.output, fill='BOTH', weightx=1.0, weighty=1.0, gridheight=2) bag.addRow(self.spanish, fill='VERTICAL') bag.addRow(self.italian, fill='VERTICAL') self.language = {self.spanish:'Spanish', self.italian:'Italian'}
def __init__(self, title, units, controller): self.units = units self.controller = controller bag = GridBag(self, fill='HORIZONTAL') label = awt.Label(title, awt.Label.CENTER) bag.addRow(label) self.text = awt.TextField('0', 10, actionListener=self) bag.add(self.text, weightx=1.0) self.chooser = awt.Choice(itemListener=self) for name, multiplier in units: self.chooser.add(name) bag.addRow(self.chooser) self.slider = awt.Scrollbar(awt.Scrollbar.HORIZONTAL, maximum=self.max+10, blockIncrement=self.block, adjustmentListener=self) bag.add(self.slider)
def __init__(self, title, units, controller): self.units = units self.controller = controller bag = GridBag(self, fill='HORIZONTAL') label = awt.Label(title, awt.Label.CENTER) bag.addRow(label) self.text = awt.TextField('0', 10, actionListener=self) bag.add(self.text, weightx=1.0) self.chooser = awt.Choice(itemListener=self) for name, multiplier in units: self.chooser.add(name) bag.addRow(self.chooser) self.slider = awt.Scrollbar(awt.Scrollbar.HORIZONTAL, maximum=self.max + 10, blockIncrement=self.block, adjustmentListener=self) bag.add(self.slider)
def init(self): self.spanish = awt.List(4, 1) self.fillList( self.spanish, ['uno', 'dos', 'tres', 'cuatro', 'cinco', 'seis', 'siete']) self.italian = awt.List() self.fillList( self.italian, ['uno', 'due', 'tre', 'quattro', 'cinque', 'sei', 'sette']) self.output = awt.TextArea(10, 40, editable=0) bag = GridBag(self) bag.add(self.output, fill='BOTH', weightx=1.0, weighty=1.0, gridheight=2) bag.addRow(self.spanish, fill='VERTICAL') bag.addRow(self.italian, fill='VERTICAL') self.language = {self.spanish: 'Spanish', self.italian: 'Italian'}
def do_layout(self, optionsPanel): bag = GridBag(self.frame.contentPane, fill='BOTH', weightx=1.0, weighty=1.0) bag.add(swing.JLabel("Setup Code: ", RIGHT)) bag.addRow(swing.JScrollPane(self.execentry), weighty=10.0) bag.add(swing.JLabel("Expression: ", RIGHT)) bag.addRow(self.evalentry, weighty=2.0) bag.add(swing.JLabel("Output: ", RIGHT)) bag.addRow(self.chart, weighty=20.0) bag.add(swing.JLabel("Options: ", RIGHT)) bag.addRow(optionsPanel, weighty=2.0) self.update(None) self.frame.visible = 1 self.frame.size = self.frame.getPreferredSize() self.chooser = swing.JFileChooser() self.chooser.currentDirectory = java.io.File(os.getcwd())