home *** CD-ROM | disk | FTP | other *** search
- package sunw.demo.misc;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Font;
- import java.awt.Label;
- import java.beans.PropertyChangeEvent;
- import java.beans.PropertyVetoException;
-
- public class Voter extends Label {
- private boolean vetoAll = true;
-
- public Voter() {
- super("No");
- ((Component)this).setFont(new Font("Helvetica", 1, 36));
- ((Component)this).setBackground(Color.black);
- ((Component)this).setForeground(Color.red);
- }
-
- public void setVetoAll(boolean var1) {
- this.vetoAll = var1;
- if (this.vetoAll) {
- ((Label)this).setText("No");
- } else {
- ((Label)this).setText("Yes");
- }
- }
-
- public boolean getVetoAll() {
- return this.vetoAll;
- }
-
- public void vetoableChange(PropertyChangeEvent var1) throws PropertyVetoException {
- if (this.vetoAll) {
- throw new PropertyVetoException("NO!", var1);
- }
- }
- }
-