# Is it possible to create a custom popup message

**URL:** <https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572>\
**Category:** URCap Development\
**Created:** [February 2, 2018, 8:43am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572 "2018-02-02T08:43:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon53917834](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anon53917834](https://forum.universal-robots.com/u/anon53917834)\
**Post date:** [February 2, 2018, 8:43am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/1 "2018-02-02T08:43:57Z")

</div>

Hello everyone.

As you can see in the title I want to create a popup who can work when the program is stop.

This popup will be used for confirm one action. In my case, I have created a Delete button for my parameters and I want a popup for saying " Would you really delete theses parameters" and I need a button OK and a button Cancel.

Is it possible ?

Thanks for the help, Defferrard Arnaud

---

<div class="post-metadata">

**Author:** ![sko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/sko/32/573_2.png) [@sko](https://forum.universal-robots.com/u/sko)\
**Post date:** [February 2, 2018, 8:56am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/2 "2018-02-02T08:56:35Z")

</div>

Hello Arnaud,  
you could use the script command: ‘var\_1 = request\_boolean\_from\_primary\_client("")’ for your problem.

---

<div class="post-metadata">

**Author:** ![anon53917834](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anon53917834](https://forum.universal-robots.com/u/anon53917834)\
**Post date:** [February 2, 2018, 9:03am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/3 "2018-02-02T09:03:00Z")

</div>

Thanks for this quick answer I will try .

---

<div class="post-metadata">

**Author:** ![anon53917834](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anon53917834](https://forum.universal-robots.com/u/anon53917834)\
**Post date:** [February 2, 2018, 9:28am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/4 "2018-02-02T09:28:27Z")

</div>

I have to put the script into “public void generateScript (ScriptWriter writer)” right?

if it’s the case how can I take a variable from my Java part and use this variable into the script?

---

<div class="post-metadata">

**Author:** ![sko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/sko/32/573_2.png) [@sko](https://forum.universal-robots.com/u/sko)\
**Post date:** [February 2, 2018, 10:42am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/5 "2018-02-02T10:42:55Z")

</div>

Yes, the script command belongs in the generateScript()-Method.

If you want to make the received variable displayed for the user you can take a look at the cyclecounter-example and read into the ‘working\_with\_variables.pdf’ manual.

---

<div class="post-metadata">

**Author:** ![anon88765119](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@anon88765119](https://forum.universal-robots.com/u/anon88765119)\
**Post date:** [March 5, 2018, 10:55am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/6 "2018-03-05T10:55:29Z")

</div>

Hello everyone!

Is it possible to create a custom popup message with custom buttons (e.g. Save and Cancel)?

Thanks in advance for any help!

---

<div class="post-metadata">

**Author:** ![anon53917834](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anon53917834](https://forum.universal-robots.com/u/anon53917834)\
**Post date:** [March 5, 2018, 10:59am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/7 "2018-03-05T10:59:07Z")

</div>

Hey I use the sendScriptWithButton samples for this .

If you have any question I am here for you.

Regards,

Arnaud

---

<div class="post-metadata">

**Author:** ![anon88765119](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@anon88765119](https://forum.universal-robots.com/u/anon88765119)\
**Post date:** [March 5, 2018, 11:20am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/8 "2018-03-05T11:20:10Z")

</div>

Thanks for your reply!

In the sendScriptWithButton sample a simple popup created. Is there a way to rename buttons on the popup?  
I need to create a popup with two custom buttons (Cancel and Start) and handle clicks on them.  
Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![anon53917834](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anon53917834](https://forum.universal-robots.com/u/anon53917834)\
**Post date:** [March 5, 2018, 11:38am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/9 "2018-03-05T11:38:42Z")

</div>

Mh… You will have to create your own custom popup for this . the sendscriptwithbutton is using the popup from polyscope and if I’m right you can’t “modify” this popup.

Your popup has to work when the program is running or not?  
If it’s not the case I can suggest you to create a div and show the div when your value is changed and once than you have pressed start or cancel the div will be hided.

I am using this functionality for having different window by example.

---

<div class="post-metadata">

**Author:** ![anon53917834](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anon53917834](https://forum.universal-robots.com/u/anon53917834)\
**Post date:** [March 5, 2018, 11:39am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/10 "2018-03-05T11:39:57Z")

</div>

And to be honest I don’t know how to create a custom popup. (I started working on JAVA one month ago).

---

<div class="post-metadata">

**Author:** ![anon88765119](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@anon88765119](https://forum.universal-robots.com/u/anon88765119)\
**Post date:** [March 5, 2018, 11:47am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/11 "2018-03-05T11:47:05Z")

</div>

I think hiding and showing a div is better option than creating my own custom popup.  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![tonyke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/tonyke/32/143_2.png) [@tonyke](https://forum.universal-robots.com/u/tonyke)\
**Post date:** [October 18, 2018, 7:02am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/12 "2018-10-18T07:02:22Z")

</div>

html 的按钮怎么绑定弹窗，我想点击按钮触发一个弹窗

---

<div class="post-metadata">

**Author:** ![anon81989367](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@anon81989367](https://forum.universal-robots.com/u/anon81989367)\
**Post date:** [August 23, 2019, 8:44am UTC](https://forum.universal-robots.com/t/is-it-possible-to-create-a-custom-popup-message/1572/13 "2019-08-23T08:44:26Z")

</div>

You can create it like this  
public static void setErrorPopup(String message, String title){  
JOptionPane pane=new JOptionPane();  
pane.showMessageDialog(new JFrame(),message,tittle,JOptionPane.ERROR\_MESSAGE);  
}  
it work fine but the grafic of the popup is horrible. If you can fix this you solved your problem
