last day (17 days later) » 

10:50 AM
0
A: How to select particular region of image by mouse event in webview and crop by key event by using space?

IR Emonget the coordinates by this private int x,y,w,h; public void getCordinates() { img.setOnMousePressed(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { x = (int) event.getX(); y = (int) event...

 
thnks @IR but by adding this my key listener also stop working.please tell me the problem. this is a exception Exception in thread "JavaFX Application Thread" java.lang.ExceptionInInitializerError at verticalseperator.HV.lambda$start$0(HV.java:83)
 
This seems like some initialization exception which is in line number 83 of HV.java. And i have no idea what you have written in that line. Don't know how to help you out @Narendra.kr .
 
img.setOnMousePressed( (MouseEvent event) -> { int x = (int) event.getX(); int y = (int) event.getY(); }); this is on 81 ,82,83 line
either u can help me over chat as i can see u had hide your chat section.
 
Don't it will work or not but try intializing x and y globally
 
im getting compile time error globally thats why i had use like this
 
10:50 AM
I think the problem is with the 'img'. Try sorting out that if you have initialized and set correctly. Because i just tried with a imageView and it worked perfectly for me. You are using webView and may be you haven't used that correctly
 
hi thnks first of all for helping
if there is some prob with webview so why key listener is using correctly
and as i have notice that mouse listener is by default working in webview in starting so may be thats the reason or wht?
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package verticalseperator;

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author biznis
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
 
11:52 AM
and i had debug the problem why ur not dragging the mouse u have just tell me to take mousepressed and released but to select we have to drag also am i right
 
12:18 PM
As you are calculating the starting and end point you don't need to listen for mouseDrag event (the way i suggested). And your webView may have been correctly implemented. I just mentioned because you haven't posted the full code
 
but i have to show the selected area so for that i have drag?
 

  last day (17 days later) »