Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get a window handler from/through java  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I have faced a problem in Java.
An application has written in C. I want to change the GUI of the application to Java. Currently its in VB. I used JNI to link the DLLs of C.
In the GUI, first i created a frame. In the frame, i placed two textfields in North using a panel; i created a panel and simply placed it in Center ; i placed two buttons in South of the Borderlayout using a panel.
In the native side, native method ask a parameter HWND(If we give a HWND of a window to the native method of the application , it automatically draw a picture in the window)
My aim is, if i click a button it interact with a native method in the dll and the method draw a picture in the panel placed in Center of the frame. (ie) the window handle of the panel, so that it can fully draw the picture in the corresponding window handler panel.

My problem is to get the handle of the panel / any awt object placed inside a frame.
I usually check the window handler using the Finder tool in VC++(spy++) which gives a hexadecimal value
kumar
 
paul wheaton
Trailboss
Posts: 22521
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this: http://www.javaranch.com/name.html - your account name does not follow our naming guidelines because it contains an underscore.
Also, I am moving this thread to "Java in General (intermediate)"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!