Jump to content

Recommended Posts

Posted (edited)

Hi,

I am trying to set value in JTextField and click button in java application. I got JAB working. please refer below. I searched on forum related Java.au3. (_JavaObjValueGet) as well. Apart from setting focus on Java screen. i could not move forward. 

private JButton btnClose  = new JButton("Close");
  private JButton btnAdd = new JButton("Add"); 
  

  private JTextField txtA = new JTextField();  
  private JTextField txtB = new JTextField();
  private JTextField txtC = new JTextField();
;#RequireAdmin
#include "UIAWrappers.au3"
#include "Java.au3"
AutoItSetOption("MustDeclareVars", 1)
;MsgBox("","Hello","Hello")
WinWaitActive("Penjumlahan")
Local $oP3=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Penjumlahan;controltype:=UIA_WindowControlTypeId;class:=SunAwtFrame", $treescope_children)
_UIA_Action($oP3,"setfocus")
Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=Penjumlahan;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children)
;MsgBox("","Hello",$oP2)

_UIA_Action($oP2,"setfocus")

image.png.dc7b0343ffb449525e587dda4a868f47.png

Edited by KhalidAnsari
include java textbox and button code
Posted

Yes I have seen the post of Jab simplespy. When i set focus on my application n press ctrl+w i get info related to title window only. Please refer image below

When i keep my focus on text box of application. Press ctrl+ w focus goes to enitre monitor screen. 

image.thumb.png.f9aa2e86dfe53654c48bce954d9327d7.png

 

Posted

I have refer FAQ 31 and Download accessbridgeexplorer based on that I am getting following out put. 

Java Home: C:\Program Files\Java\jre1.8.0_221
  We are using OS X64 at cpu X64; Autoit 64 bit version @AutoItX64=0
  PASS: Windows accessbridge WindowsAccessBridge-32.dll opened returns: 1
0 Windows_run returns: 
_JAB_singleAction: Only applicable for single action element like button or check box, menu, menu item

Code

#include "UIAWrappers.au3"
#include "JavaInclude.au3"
global $wintitle = "Penjumlahan"
$winHandle = WinActivate($wintitle)
$result = __isJavaWindow($winHandle)
Sleep(5000)
Global $vmId
Global $ac

global $sName = "Add"
global $sRole = "push button"
__getAccessibleContextFromHWND($winHandle, $vmID, $ac)
 ;$re_ac = _JAB_getAccessibleContextByFindAll($vmId, $ac, $sName, $sRole) // This line closing Java application.
;_JAB_singleAction($vmId, $re_ac)
_JAB_singleAction("push button:Add", "click")

Not click on button getting below line. 

_JAB_singleAction: Only applicable for single action element like button or check box, menu, menu item

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...