Image of a violet flower Violet

new The latest version of Violet is on the SourceForge site.

new Martin Dawson has produced a Mac bundle of the classic version.

Impatient? Try it out with Java Web Start.

Note: The Web Start version is functional and safe without requiring you to accept any certificate. However, there are a few limitations.

Once you are confident that you like Violet, you should download it and run it locally.

What is it?

Violet is a UML editor with these benefits:

Violet is intended for students, teachers, and authors who need to produce simple UML diagrams quickly. It is not intended as an industrial strength tool. There are several capable high-end UML editors available, such as

Those are fine programs for serious users of UML. However students and casual users may not like them because they are too slow, too expensive, or too hard to learn. Mike Godfrey coined the slogan: Roses are rational, violets are GNU.

Here are some of the features that industrial-strength UML programs have and that Violet does not have

If you just want to draw simple UML diagrams without too much fuss, chances are you'll like Violet. If you have more serious needs, check out one of the other programs.

My book "Object-Oriented Design & Patterns" (John Wiley & Sons, 2003) discusses the graph editor framework that underlies Violet. One reason to keep the program simple is to limit the size of the source code so that it won't overwhelm students.

.Note: Another simple UML program is UMLet.

Downloading and Installation

  1. The modern version of Violet runs on any platform that has a Java SE 6.0 Runtime Environment. If you don't have it, download and install the SDK or the JRE. Use the classic version if you have an older version of Java.
  2. Download the JAR file:
  3. Save the JAR file at a location of your choice. With some browsers, you need to right click (or click and hold) on the link and select "Save file as..." from the context menu. 
  4. Open a command shell and run
    java -jar
    Replace jarfilename with the actual JAR file name, such as com.horstmann.violet-0.21.0 or violet-0.16a. On some operating systems, you may be able to double-click on the jar file instead. 
  5. The classic version contains the source code in the JAR file. The source for the modern version is in the SourceForge CVS repository.

Classic Version Usage Guide

When the program starts, pick a diagram type from the File->New menu. The following types are currently available:

Each diagram window has a diagram-specific toolbar at the top.  The first tool button (with the four "grabbers") is the "Select" tool. 

The other tool buttons let you add nodes and edges to the diagram. Mouse over each node and read the tool tips to see what they do.

You can also right-click or double-click on an empty part of the diagram to get a popup menu with the tools.

A diagram is composed of nodes (for example, classes or objects) and edges (for example, inheritance arrows or call arrows).

To add a node, first click on the matching button, then click anywhere on the diagram to add it.

To connect two nodes with an edge, first select an edge tool. Then click on the first node and hold down the left mouse button. Drag the mouse to the second node and release the mouse button. The edge is inserted between the two nodes.

(There is one exception: You insert a "note connector" simply by dragging from a "note" node. An invisible point node is automatically inserted at the position where you release the mouse button.)

You use the select tool (with the four "grabbers") whenever you want to select an existing object (node or edge) There are three reasons why you would want to do that:

When you edit the properties of a node or edge, a property popup appears. It lists the properties of the objects in a table. Each property has a name and a value.

For example, the Note node has a property whose name is "color" and whose value is a color value. When you edit the value field, the value in the diagram is instantly updated.

When you are done with a diagram, save it with the File->Save or File->Save as menu option. You can give it any name you like, but I recommend you use an extension .violet.

To include a diagram in a document, export to PNG or JPEG format with the File->Export Image option. Here is a sample:

Tip: If you use Violet in a classroom setting, you may want to use the View->Zoom menu option. You can zoom in or out of the diagram. Zooming only affects the diagram display, not the size of saved images.

Tip: If you use Violet on a slow computer, hide the grid. The nodes still snap to the grid, but the drawing is faster.


Thanks to Avi Bercovich, Andrew Brandt, Lars Arne Brekken, Chandler Burgess, Jørgen Cederberg, Robert Colburn, Piyush Devnani, Jeremy Driver, Jay Dunning, Morten Elling, Cris Fuhrman, Igor Garcia, Mark George, Mike Godfrey, Daniel Guerrero, Stefan Gründel, Wee Jin Goh, Laurent Hayoun, Graham King , Peter Kehl, Sebastian Kurt, Raymund J. Lin, Kevin McConnell, Matijs Moest, Tri Nguyen, Evelyn Obaid, Norbert Oertel, Johannes Päivinen, Bill Pine, Bruce Raggett, Zack Rubinstein, Grant Talarico, Jordan Thompson, Simon Tokumine, Jesper Trägårdh, Trygve Utstumo, Glenn Vanmarcke, Sam Watkins, Martin Wehner, Raphael Wimmer, Ed Zaron and (your name might go here) for their help, bug fixes, suggestions for improvement, and code submissions.



Newer versions are on the SourceForge site.

Version 0.16a (2005-07-01)

Version 0.15 (2005-06-16)

Version 0.14 (2003-09-11)

Version 0.12 (2002-12-16)


Why Violet?

It's the Very Intuitive Object Layout Editing Tool. Also, various violets are the official state flowers of Rhode Island , New Jersey , Wisconsin and Illinois.

Why is it a Java program?

The Java library makes it easy to write attractive and highly graphical programs that run on multiple platforms. I wrote the first version of Violet in about 10 days.

Why are the class and object names multi-line text fields and not single-line text?

Often, a diagram looks better when you distribute a class or object name on multiple lines, such as


It is difficult for a program to make an aesthetic judgment, so Violet leaves you in control.

Why are the method and attribute compartments multi-line text fields? In other UML tools, you specify the names, types, and visibilities in a series of dialog boxes. 

Indeed you do, and what a drudgery it is. Select the "Add method" command. Type method name into text field. Type return type into another text field. Click on "public" radio button. Select the "Add parameter" command. Type parameter name into text field. Type parameter type into another text field. Select the "Add parameter" command again...

In Violet, you just type

+foo(x:int, y:int):int

Or, if you prefer


Of course, professional UML tools build up a model of your design, so they need that information. Violet just produces a graph...

How do I move the end of a note connector?

When you insert a node connector, an invisible end point is automatically inserted. You can select it by clicking on the end point of the node line. Then drag it anywhere you like.

How do I make a connection from a node to itself (e.g. a self-call or a class with an association to itself)

Drag a line inside the connector, moving it by a moderate amount. The self-connection will be added. If you don't move the mouse enough, then the connector won't be added. That way, an accidental mouse click won't add unwanted connections.

What are the "HV" and "HVH" bent styles in the property popup for class diagram arrows?

HV = Horizontal, then Vertical. HVH = Horizontal, Vertical, then Horizontal. You may want to vary these if you have too many arrows terminating at one node.

How do I enter bold, italic or underlined text?

Use the HTML <b> , <i> , or <u> tags in the text.

How do I change the font size or color?

Use an HTML tag such as <font size="+1"> or <font color="red">

How do I add a ► symbol to an arrow label?

Use the HTML entity &#9658; in the label text.

How do I make a multi-line arrow label?

Add the HTML tag <br> .

When I try to export an image, I get an OutOfMemoryError.

This can be a problem with large images. The solution is to use the -Xm option to increase the maximum heap size. For example,

java -Xmx256m -jar /home/cay/web/com/violet/violet-0.16a.jar.

This particular invocation gives the Java virtual machine 256MB of heap space, four times its default of 64MB.

What are these object diagrams and the funny curved connector? That doesn't seem to be standard UML

It's not standard UML, but I find these diagrams very handy for showing object references in Java. Here is an example:

The file format looks like some crazy kind of XML. What is it?

Violet uses the "long term bean persistence" feature of JDK 1.4. The file format happens to be XML, but it is not very suitable for interchange of information with other programs.

Why the Gnu General Public License? Isn't that some kind of virus that undermines free enterprise?

Well, if you define "free enterprise" as "everyone who uses software pays money to Microsoft", then I guess it is. But seriously, the GPL does not restrict you to you if you merely use the software. If you design other programs with it, those other programs are not affected at all by the license. The license restricts you only if you redistribute this software or a modification of it.

Is there any design documentation?

Not much, unfortunately. This chapter from my Design & Patterns book contains some useful information.

I found a bug. What should I do?

Please report it using the SourceForge tracker. Attach a sample Violet file and screen shot when appropriate.

I have a request for improvement. What should I do?

Please request it using the SourceForge tracker. If you want a visual enhancement, attach a sample image or a URL where we can see what you want.

I fixed a bug or implemented an improvement. What should I do?

Thank you!!! Please submit a patch using the SourceForge tracker.

Cay Horstmann's home page