Bean Properties

With Jython, you can use JavaBeans properties like instance attributes, which makes it easy to interact with Java classes. You can also use them as keyword arguments to Java class constructors (like Tcl/Tk).

About JavaBeans

JavaBeans have properties and events, much like ActiveX controls, which are a lot like OLE controls (OCXs), which are like Visual Basic controls (VBX). To make a short story long, JavaBeans allow IDE (Integrated Development Environments) to do mundane things that you used to have to write code for.

In Java, you need the set() and get() methods to define a property. Let's say that you create a property called name that you want to be both read and write. You can define two methods for it.

 public void setName(String ...

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.