O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

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

A Rubberband Panel

RubberbandPanel is an abstract extension of Panel that maintains an association with an instance of Rubberband. RubberbandPanel implements no constructors, so a default constructor (with no arguments) is generated for it.

RubberbandPanel provides a setRubberband method for associating a rubberband with the panel. If a rubberband was previously associated with the panel, it is made inactive. Next, if the rubberband passed to setRubberband() is non-null, it is made active, and the rubberband's component is set to the rubberband panel.

 public void setRubberband(Rubberband rb) { if(rubberband != null) { rubberband.setActive(false); } rubberband = rb; if(rubberband != null) { rubberband.setActive(true); rubberband.setComponent(this); ...

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