How to locate UI Button for AppleScript using Accessibility Inspector
To get information about UI elements in Accessibility Inspector, you just need to hover the mouse over whichever UI element you want to know more about. For the purposes of closing this security warning, you need to be able to identify which button and which window. So if you hover the mouse over the title bar of the window you can see the AXValue is "Security Warning". And if you hover over the Continue button you can see the AXTitle value is "Continue".

From this you can create the following AppleScript which will close this dialog...

tell application "System Events" to tell process "java"
    click button "Continue" of window "Security Warning"
end tell


Also you can get AppleScript to tell you the actual names of the buttons in the window with. Please note that it will list the three standard Close, Minimise, Maximise traffic light buttons in the top left corner as well.

tell application "System Events" to tell process "java"
    get name of every button of window "Security Warning"
end tell


Hope that helps.