O'Reilly logo

Swing for Jython: Graphical Jython UI and Scripts Development using Java Swing and WebSphere Application Server by Robert Gibson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4

image

Button Up! Using Buttons and Labels

Up to this point, the applications you built in this book have been kind of boring.1 They really haven’t done anything except display a message. But now it’s time to change that. In this chapter, you’re going to add a button to your application and then have it react when the user presses it. How does that sound?

To do this you’ll first take a look at the JButton class hierarchy and see the Java way to create a button and add it to the application frame. Then you’ll see a verbose way, in Jython, to do the same thing. Then you’ll see a more concise way to put a button on the frame and have an event ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required