Home www.python.org
Download Documentation
Home
Overview
License
Jython 2.0
Jython 2.1
Installing
JVM Compatibility
 
Applets
Demos
ButtonDemo
CheckboxDemo
ChoiceDemo
LabelDemo
ListDemo
CoordinatesDemo
ConvertDemo
 
Applet Problems
Here's what to do
Other applet issues
 
Email Us
jython-dev@lists.sourceforge.net
 
 
SourceForge Logo
  

Using Labels

This example shows how to use Labels from Jython.

Something has gone wrong loading this applet.

The complete source code for this example is included below.


from java import applet from java.awt import Label, GridLayout class LabelDemo(applet.Applet): def init(self): self.setLayout(GridLayout(0,1)) self.add(Label('Left')) self.add(Label('Center', Label.CENTER)) self.add(Label('Right', Label.RIGHT))
Three labels are created with different alignments. The first has the default left alignment and the other two are centered and right aligned.