I realize this is an old question by now, but hopefully this is helpful to someone.
There are 2 issues worth talking about here
1) The error message about the expected number of arguments
In my opinion this is a swing library bug, but not one that is hard to work around. I submitted an issue on the swinglibrary github project for this, so we’ll see if it gets fixed down the road. Basically, the Run Keyword in Separate Thread keyword does not properly support keywords that have default parameters. It sees that Click On Component takes 3+ arguments (identifier, times, buttonString and *keyModifierStrings) but it ignores the fact that times and buttonString are optional arguments.
So you can fix this error by simply changing it to Run Keyword In Separate Thread Click on Component jButtonFirmSave 1 BUTTON1_MASK
2) Why it didn’t work originally: Modal dialogs will block the EDT
This is the original problem that you were trying to solve. All user interactions with swing GUI components should be handled by the Event Dispatch Thread (EDT). When the EDT displays a modal dialog, it should block until that dialog is closed. So ignoring robot framework for a second and just going back to plain old Java, if you have:
```
System.out.println(“About to show confirm dialog”);
JOptionPane.showConfirmDialog();
System.out.println(“Done”);
```
You would see that it prints out the first line, then shows the confirm dialog, and then does not print out “Done” until the dialog is closed. So you might wonder how the OK button on the dialog works if it must be executed on the EDT and the EDT is blocked. The way that works is actually pretty cool and it uses something called sub-loops, but basically the whole EDT isn’t blocked, it just goes into a new event dispatching loop and keeps going there until the dialog is closed. If that went over your head, that’s fine, it’s beyond the scope of this answer.
So this poses a problem for robot framework because robot framework must run the part of the Click On Component keyword that actually clicks on the component on the EDT, but then it gets blocked waiting for it.
Your solution is the right approach by running that keyword on a separate thread. It will still end up running the actual clicking part on the EDT, but you won’t have to wait for it so you can continue onto the next keyword which will eventually execute on the EDT, but inside an event sub-loop.
So, long story short: your solution is the right one but hopefully this helps explain why it is the right one. The actual error you saw has to do with the Run Keyword in Separate Thread keyword and how it handles optional arguments. The fix is to just add in the default values for each argument.