1 33 34 package edu.rice.cs.drjava.ui; 35 36 import java.awt.Component ; 37 import java.awt.Color ; 38 39 import edu.rice.cs.drjava.config.*; 40 import edu.rice.cs.drjava.*; 41 42 43 class BackgroundColorListener implements OptionListener<Color > { 44 final Component _target; 45 46 public BackgroundColorListener(Component target) { 47 _target = target; 48 49 Color color = DrJava.getConfig().getSetting(OptionConstants.DEFINITIONS_BACKGROUND_COLOR); 50 _target.setBackground(color); 51 52 DrJava.getConfig().addOptionListener(OptionConstants.DEFINITIONS_BACKGROUND_COLOR, this); 53 } 54 55 public void optionChanged(OptionEvent<Color > oce) { _target.setBackground(oce.value); } 56 } | Popular Tags |