Universal Robots Forum

Adding picture in a popup message

Hello everyone,

In order to guide the operators during their work, I want to add pictures and diagrams in my programs pop-pup.
Is there a way to do that ?


An inbuild polyscope popup cannot contain a picture I’m afraid. In order to implement a popup containing images, you would have to wtire a URCap which implements its own popups in java. The easiest thing to do is to use the popups supplied by the JOptionPane class. There are various methods availble to create different popups, including showOptionDialog which will allow you to specify a custom icon.

Hope this helps.

1 Like

It is possible to create the swing custom form with picture.

I have ever tried to this.

1 Like

Thanks for the answer !

I edit a pop-up by using HTML codes and it works pretty well.

Hello !

Thank you for the answer but how can I try this also ?
Do I have to follow a specific procedure ?
Where can I find it ?

This is a very easy task, you just need to use the script popup message, maybe the one from the teach pendant works too. Since the controllers just displaying HTML you can use the available HTML tags that URCap can use which is a limited set but gets the job done.

For instance, we store images on the controller in the programs folder and can use the following code to display it on the screen.

popup("<h1> Door Not Open </h1> <p> <img src=file:/programs/greenTouchButton.png height=200 width=257 > </p> <p> </p> <p> Please ensure it is safe to open the lathe door, and press green touch button </p>")

you can also use it to display an image from a website or a website

popup("<h1> Image from website </h1><p> <img src=https://aws1.discourse-cdn.com/business7/uploads/universal_robots/original/2X/c/c1fc4aee5c7b6fc24f41af09cd5a230ed3c732d0.jpeg height=200 width=200 /> </p>")

such as this…


Image from website