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); ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition 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.