Display variable inside operator input assignment popup

Hi! This is my first time develloping a URCap. I need to make a Dialog like the one who @m.birkholz suggested. I’ve been readding a lot and following the tutorials on URCaps GettingStarted. I’ve succesfully developed a URCap like the LightsUp one of the video but featuring ComboBox.

But now i need to open a DialogBox every time the program start, for allow the operator to select a item from a combox.

My questions,

  1. Where should I put this dialogBox? Should I use a eventlistener to display it at a program start?
  2. From the example of DialogBox:

final JOptionPane optionPane = new JOptionPane(
“The only way to close this dialog is by\n”
+ “pressing one of the following buttons.\n”
+ “Do you understand?”,
JOptionPane.QUESTION_MESSAGE,
JOptionPane.YES_NO_OPTION);

Should i create a JOpetionPane inside of BuildUI?

Maybe I’m little confused right now, but I’ve several years of programming Industrial Robots, PLC and Pyhton, but just a few codes in Java.

Any help or guide will be most welcome.