Here is a simple "Hello World" example as a Cytoscape plugin where a Java Swing utility class is used to display the message in a dialog window. {{{#!java package helloworld; import java.awt.event.ActionEvent; import javax.swing.JOptionPane; import cytoscape.Cytoscape; import cytoscape.plugin.CytoscapePlugin; import cytoscape.util.CytoscapeAction; /** * A menu item "Hello World" will appear at Plugins menu. Click on the menu * item, a message dialog will show up. */ public class HelloWorldPlugin extends CytoscapePlugin { public HelloWorldPlugin() { MyPluginMenuAction menuAction = new MyPluginMenuAction(this); Cytoscape.getDesktop().getCyMenus().addCytoscapeAction((CytoscapeAction) menuAction); } public class MyPluginMenuAction extends CytoscapeAction { public MyPluginMenuAction(HelloWorldPlugin myPlugin) { super("Hello World"); setPreferredMenu("Plugins"); } public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(Cytoscape.getDesktop(),"Hello World is selected!"); } } } }}} [[attachment:HelloWorldPlugin.java]] [[attachment:helloworld.jar]] === Looking at the Plugin === Imports: {{{#!java import cytoscape.plugin.CytoscapePlugin; import cytoscape.Cytoscape; }}} * All plugins must extend the class {{{cytoscape.plugin.CytoscapePlugin}}}. The specific class that extends {{{CytoscapePlugin}}} doesn't need to stand alone; it can reference any number of other classes and libraries. This "main" class is simply Cytoscape's entry point to your code. * The static class {{{cytoscape.Cytoscape}}} provides access the data objects and utilities of the Cytoscape core. Here, the plugin gets a reference to a window created by Cytoscape for a parent of a new dialog window. Methods: {{{#!java public HelloWorldPlugin () }}} * All plugins must have a default constructor (that is, a constructor with no arguments). Cytoscape will call this constructor to create an instance of your plugin class. To load this plugin into Cytoscape, save the jar file at the above link to your local disk in the Cytoscape plugins folder. Then start Cytoscape which will then load the plugin from the jar. You should see the "Hello World" dialog appear above your main Cytoscape window.