Creo™ Schematics 4.0 Help Center > Customizing Creo Schematics Using Java APIs > To Call Java from Customizable Java Buttons
  
To Call Java from Customizable Java Buttons
To call Java from a custom Java button you must first select a predefined command or create a new custom command and then add the command to a custom group.
Defining the Custom Command
1. Click File > Options > Environment.
2. Click Custom Command Settings. The Define Custom Command dialog box opens.
3. Select Custom Java from the Categories list. Predefined custom commands display.
* 
The method to call must be declared as public static void, taking zero or more parameters of type String. Ensure that the number of String parameters in this syntax is the same as the number of parameters in the method declaration. Otherwise, the Java system does not find the required method.
4. Select a custom command from the list or create a new one. By default all Java commands have the button
* 
Click the Related Link for more information on defining custom commands and custom buttons.
5. Click OK. The new command is added to the list of commands not in the ribbon.
Adding a Custom Java Button
1. Right-click the ribbon and choose Customize the Ribbon. The Creo Schematics Options dialog box opens.
2. Click Custom Commands from the Category list.
3. Choose the tab and group to add the command from the tab tree in the right pane.
* 
A custom command can only be added to a custom group.
4. Choose the custom command from the list of commands and click Add. The command is added to the selected group.
5. To modify the button, click Modify and select an option form the list.
6. Click OK. The custom command is added to the selected group.