Code Editor
The Code Editor node () provides the possibility to enter coded methods in Java® to perform tasks that you cannot accomplish with the nodes in the Physics Builder tree. A Code Editor node works like a Component node, so you include it through a Component Link node. Use of the code editor requires knowledge of the Java programming language and the COMSOL Java API. Note that adding Java code usually makes it much harder to find and solve problems with your physics interface, so only use it when necessary. Click the Compile button () or press F8 to compile the Java code.
The following Java interfaces are supported by the Code Editor node:
Click the Variable provider button to create a VariableDefinitionProvider. Defines expressions and selections for a set of declared variables.
Click the Button handler button to create a ButtonPressedHandler. Defines an action to perform when a button has been pressed.
Click the User input handler button to create a UserInputProvider. Defines dynamic allowed values and default values for lists.
Click the Event handler provider button to create a ActionEventProvider. Defines an action that is triggered when a parameter value has been changed.