Community Tip - You can change your system assigned username to something more personal in your community settings. X
How can i define a Default value for the UIReadStringMessage(true);
The command appears in my jlinkapp without a defaultvalue. On page 79 of the helpfile you can read the note.
A default value is displayed in the text box as Input.
When user presses the Enter key as input in the user interface, the default value is not passed to the
Creo Object TOOLKIT Java method; instead, the method returns a constant string use_default_string. When this string is returned, the application
must interpret that the user wants to use the default value.
I do not know how to display default value at the input, but the string use_default_string is just flag for using default value you define in your code, so you can do:
String myDefaultValue = "my_parameter_name";
String result = session.UIReadStringMessage(true);
if(result.equals("use_default_string");
result = myDefaultValue;
//rest of your code ...
If you need to inform user what is default string value you can display it in the message log using method UIDisplayMessage
Alternatively you can display default string using new process, which will create GUI and then dissapear, like the Android is displaying short messages e.g. when you set alarm.
HI
Thanks a lot.
But I'm looking for the to display a default value at the input or to define a Combobox at the input in Jlink.
Hi, if you want combobox you can easely create jDialog and fill it with combobox or listview. You can also fill jDialog with JFXPanel, which enable you to use JavaFX components into swing component. With JavaFX you can create really nice and modern looking GUI. I suppose you can create such thing as combobox in j-link. To create GUI is issue of java object toolkit.