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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.