Design by Contract (DbC) is widely acknowledged to be a powerful technique for creating reliable software. DbC allows developers to specify the behavior of an operation precisely by pre- and post-conditions. Existing DbC approaches predominantly use textual representations of contracts to annotate the actual program code with assertions. In the Unified Modeling Language (UML), the textual Object Constraint Language (OCL) supports the specification of pre- and post-conditions by constraining the model elements that occur in UML diagrams. However, textual specifications in OCL can become complex and cumbersome, especially for software developers who are typically not used to OCL. In this paper, we propose to specify the preand post-conditions of an operation visually by a pair of UML object diagrams (visual contract). We define a mapping of visual contracts into Java classes that are annotated with behavioral interface specifications in the Java Modeling Language (JML). The mapping...