Universal Robots Forum

ItemListener for Combo Box in Installation Node


I am currently working on developing a urcap for my application. I have successfully created a drop down menu for selection in the Installation Node, but on the selection of certain parameter i am unable to send the data back. How do i do this?

In the program node, it is easy to do it with and there are several examples of it, but in the installation node, i am unable to find such example too which returns the data after selection. Anyone with an answer for this?


Hello vinneth1,

i’m not quite sure if I understood your problem to the full extend. As far as I know you can create such a combobox just the same way as in the ProgramNode. Just make sure to use the InstallationNodeContribution instead of a ProgramNodeContribution.

You could take a look at how it’s done in the ProgramNode in this tutorial.:

Hello Lutter,

I cannot do this way because i do not use the ContributionProvider class. If i have to do that way, then i have to redo everything. I could create the combobox in the installation node, and i could see the drop down menu also. But upon a certain selection of the combobox items, i need to update the combobox items.

For eg:

Box box = Box.createHorizontalBox();

	JLabel label = new JLabel(" digital_out ");

	combo.setPreferredSize(new Dimension(104, 30));

	combo.addItemListener(new ItemListener() {
		public void itemStateChanged(ItemEvent e) {
			if(e.getStateChange() == ItemEvent.SELECTED) {
				//provider.get().onOutputSelection((Integer) e.getItem());///( How do i get this command with normal class and not using Contribution provider?)


	return box;

I could do all the commands except the provider.get() how do i do that? Thanks again

You don’t need to use a ContributionProvider in the InstallationNode. You can directly link your InstallationNodeContribution inside your InstallationNodeView.

Here is an example of a similar function inside the view:

   	private Box createFunctionalityEnabledBox(String text, final TCIInstallationNodeContribution contribution) {
	Box box = Box.createHorizontalBox();
	CHECKBOX_FUNCTIONALITY_ENABLED.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e) {
	return box;

Also make sure to link your contribution in the BuildUI method.

public void buildUI(JPanel panel, TCIInstallationNodeContribution contribution) {
	panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
	panel.add(createFunctionalityEnabledBox("Test", contribution));

I hope this helps you out.

Best Wishes,

Hello Florian,

I tried the code above, it does not work. May i know what is CHECKBOX_FUNCTIONALITY_ENABLED?

This code snippet doesn’t work as is. It’s from one of my projects. It’s supposed to give you a concept of how it’s done for your code, not to run it as is.

Your line:

Should be replaced with: contribution.onOutputSelection((Integer) e.getItem());

Also you need to change the Declaration where you define your combobox to accept a InstallationNodeContribution as argument instead of a ContributionProvider. Similar to:

private Box createFunctionalityEnabledBox(String text, final TCIInstallationNodeContribution contribution) {

Also in BuildUI you need to hand over the contribution instead of the provider.

I hope this helps.

Hello Florian,

It worked. Thank you so much for the help.