1 | To associate colors with their names: Hashtable colors = new Hashtable(); colors.put( "black", Color.black ); colors.put( "brown", new Color( 0xA5, 0x2A, 0x2A ) ); |
2 | Access the hashtable as follows: c = ( Color ) colors.get( "brown" ); |
3 | Note: The Color cast above is required since a hashtable holds objects of any type |