JavaFX 2.0 :: Does WebEngine Support GeoLocation
Nov 11, 2014
I am building an application which needs to be able to get the user's location. In JavaScript I would use navigator.geolocation.getCurrentPosition()
Does WebEngine support this function? Obviously it will only work if the device has GPS. I am targeting windows tablets and phones which will have it.
Can I use the webEngine.executeJavascript() to call the javascript if it is supported.
View Replies
ADVERTISEMENT
Jun 2, 2014
I've searched everywhere but found no way to disable loading of images by Java WebEngineHow to do it?
Research done:
I found some ideas, such as using URL.setURLStreamHandlerFactory() to use my own URLStreamHandler, and having that analyze the URL to only return URLConnections for URL's that don't end in .jpg .png etc.
But that has many problems: Sometimes the image url doesn't end in .jpg, if it's a dynamic image, such as a captcha. So how can I disable automatic image loading from WebEngine?
View Replies
View Related
Apr 9, 2015
Like the title says: I'm loading a local HTML file in a WebView which contains Javascript. The script works without any problem when the page is first loaded, but when I reload it or load another local page, Javascript simply stops working silently for no apparent reason and with no error or exception of any kind.
View Replies
View Related
Sep 6, 2014
I have a WebView which displays a site. At a specific page I want to fill in some values into <input> elements. So i use such an event handler (browser is of WebView class)
browser.addEventHandler(MouseEvent.MOUSE_CLICKED,
new EventHandler<MouseEvent>(){
public void handle(MouseEvent e) {
Document doc = webEngine.getDocument();
if (doc == null) {
System.out.println("Doc is null");
[Code] ....
The handler sets the "value" but view doesn't reflect that, field is empty.
View Replies
View Related
Jul 6, 2015
I'm trying to open URL's that the WebView considers Popups (it triggers the PopupHandler installed through onCreatePopupHandler) in an external In the PopupHandler I return a Webengine on which I installed a StateChanged listene and when the State changes to SCHEDULED I run some code top get the location of the WebEngine and open that URL in an external browser and then cancel the loading of the URL by canceling the LoadWorker using the LoadWorker.cancel() method wrapped in a Platform.runLater(..) call (in order to not crash the JVM).
However, then the PopupHandler is invoked because a window.open(url) was called in JavaScript in the main WebEngine, something odd happens: while the canceling of the loadworker was successful (it returns true and the LoadWorker goes to state CANCELLED), all of a sudden the state goes back to scheduled and my StateListener is called again with a newState of SCHEDULED, to if I don't work around it, the URL is opened again in the external browser. I can work around this by keeping track if the URL was already opened in the external browser once, but from what I can tell, this is just a bug.
View Replies
View Related
Apr 27, 2015
I get this error when I load a HTML page with WebEngine. The HTML is getting generated by an own (Java-)ServerSocket. How can I figure out where the problem is? I can load the HTML file successfully when loading the(same) generated HTML file from the local filesystem. Maybe the http headers causing these problems ? On the other hand I can load the page without problems in Firefox. How to get more information ?
View Replies
View Related
Jun 23, 2014
On p.176 of EBJ 3 in Action (2nd edition),
MDS don't support all six transaction attributes. MDBs support only REQUIRE or NOT_SUPPORT.... There is no existing transaction to suspend or join when a message is delivered, The two options you have available are REQUIRE if you want a transaction.....
there is no existing transaction when a message is delivered from a queue to an MDB. Why we still need a transaction as it says " REQUIRE if you want a transaction"? When a message is delivered from the queue to the MDB, is this a transaction?
View Replies
View Related
Mar 3, 2014
I am new at JSF and i want to do some things.
->When the user request for a file that is not exists i want to redirect to a valid url where i can inform him that the file does not exists.
->I am trying to use the properties messages for the language that the user has. I want to use it cause i want to reuse some of the message and it is easier to translate the page to other languages. How when the browser has a default page English to let user change the language to Italian for example but for all page.
View Replies
View Related
Jun 18, 2015
When a JavaScript client attempts to open a socket, instead of the connection opening it immediately closes. The client is using:
webSocket = new WebSocket("ws://localhost/example");
The same thing happens for com.sun.net.httpserver.HttpsServer where client is using:
webSocket = new WebSocket("wss://localhost/example");
How can I enable websocket support?
If it's not possible, how can I request for it to be added as a new feature?
View Replies
View Related
Oct 20, 2014
I am working on this experiment code, I keep getting an exception:
run:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -256
at .MemoryManager.read(MemoryManager.java:68)
at .MemoryProcess.callMemory(MemoryProcess.java:39)
at .main(Lab3.java:29)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
The offending line is data=RAM[physicalAddress]; inside MemoryManager.java.
why this is exactly happening and thus correct my piece of code.
The code:
main.java
package experiment;
public class Main{
/**
* @param args the command line arguments
[Code].....
View Replies
View Related
Aug 16, 2014
I studied that java does not support multiple inheritance using classes. It is fine practically, but I have still a question in mind:Lets see the below code.
class Test{
------
------
}
class MyTest extends Test{
---------
---------
}
Here, as we know that that Object is Super class for every class in java. and I have already extends a Test class in MyTest.My question is: How is it possible to extend features of two class at the same time?
Theoretically,
MyTest extends Object &
MyTest extends Test.
View Replies
View Related
Feb 7, 2015
why Java does not support return type in method overloading. I coded following and it compiles and runs without any errors.
class Ideone
{
public static void main (String[] args) {
sum(3,5);
[code]....
If Java did not support overloading based on return type, this program should not work, right?
View Replies
View Related
Dec 26, 2013
I need to port asynchronous bean (provided by websphere) support in App servers like weblogic and jboss. Is this feature already part of J2EE specification? Or should I use some other external package to get this feature?If so what are those async bean like features for weblogic and jboss?
View Replies
View Related
Aug 14, 2014
I am developing JavaFX application. I have requirement like that javafx application should be always on top. I could not find an option to make it always on top.
View Replies
View Related
Jan 28, 2014
I know that oracle has released a statement saying that JavaFX will eventually replace Swing. What is the advantage of JavaFX? The new format, using "stage" instead of JFrame, seemed weird. Why is this change necessary? What benefit do we reap from JavaFX that Swing does not have?
View Replies
View Related
Oct 24, 2014
I am using netbeans scenebuilder and I am a little confused on how I would convert my state capitals java code to a javaFX app.
public class StateCapitals {
Scanner in;
public static void main(String[] args) {
readData();
}
public static void readData() { // Location of file to read
File file = new File("statecapitals.txt");
[code]....
View Replies
View Related
Oct 21, 2014
I've been on this for a while and for some reason I just can't seem to get this to work. I know my code is solid, but it won't display my image. I've tried swithcing the image to different directories and also using different image sizes and types. I even used Orcale's guide to display your image, but still no go! All I get is a blank canvas? There are no errors. I'm also running NetbeansIDE 8 that supports JavaFX and I made sure the project is a JavaFX Application project.
All I get is a blank new window, but no images.
Here's my code:
package javafxapplication3;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.image.Image;
[code]....
The homework called for me to display it three times - the first one regular, second resized, and the last one rotated. I even deleted the extra images in hope at least one appears.
View Replies
View Related
May 8, 2014
I'm working on a project right now in JavaFX, and got stuck. I am drawing a path consisting of CubicCurveTo's and I wonder if there's any way to get the X and Y coordinates from certain parts of that path.
Imagine following a curve (path) with a pencil slowly, and every second you take note the X and Y coordinate. I mean I'm not interested in the control points or start and end points, but the points "in between", preferably at a certain interval.
I've searched for many things online, but have trouble knowing exactly which words to search for. "Paths" often bring up file paths, traversing, coordinates etc. all fail to give me any good results.
I tried to be as specific I could, and I don't think my current code is of any interest in this matter.
(The point of it all is that the path should simulate the path a person walks, and I will store the coordinates in a database for every second).
View Replies
View Related
May 28, 2014
When i press a button, i want to create a new object in my window(that i have created using scenbuilder, so i have a FXML file and a Controller class). In the window where i have a create button, there are also some textfields where you are supposed to enter name and date.
What i want to do is take the input from the TextField and store is temporally in a String variable, Its this strings i want to take the data from when i create a new object on my View. When i try to do something with the TextFields i get multiple errors that i dont understand at all.
I know my code may be very un-structured the absolute right way, i know, but i dont have time reconstructing and trying to understanding new patterns .The object is the circle and the vertical line.
TimelineMainView Controller
public class TimelineController{
StageClass sc = new StageClass();
NewTimelineController nt = new NewTimelineController();
[code]....
View Replies
View Related
Jan 24, 2015
I'm quite new to JavaFX, and currently struggling with navigation between views. I'll post the code and the stacktrace.
public class MainApp extends Application {
private Stage primaryStage;
private AnchorPane overviewPage;
@Override
public void start(Stage primaryStage) {
this.primaryStage = primaryStage;
[Code] .....
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml.FXMLLoader$MethodHandler.invoke(Unknown Source)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown Source)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
[Code] ......
View Replies
View Related
May 26, 2014
I have noticed that you can style JavaFX controls using their sub-structure.
E.g. to style the label in a table column header to be left justified I can do this :
.table-view .column-header-background .label { -fx-alignment: center-left ; }
How can I style my own nodes/controls doing this? Basically it amounts to asking how the selectors like ".column-header-background" are associated with sub-structures of my Java control/node objects. So suppose I have something like
.fancy-node .fred .label { ... }
How does JavaFX associate fancy-node and fred with something in my implementation of a Node/Control?
View Replies
View Related
Jan 13, 2015
ToString()-Representation of KeyEvents. I was expecting '$' as text value, because Shift was pressed.
Unfortunately, KeyTyped is not fired in this case, so I am not able to get the information from this event.
How can I get the actually typed '$' from KeyPressed?
KeyEvent [source = BorderPane[id=cnt_borderPane], target = Button@1a3fc21a[styleClass=button]'', eventType = KEY_PRESSED, consumed = false, character = , text = , code = SHIFT, shiftDown]
KeyEvent [source = BorderPane[id=cnt_borderPane], target = Button@1a3fc21a[styleClass=button]'', eventType = KEY_PRESSED, consumed = false, character = , text = 4, code = DIGIT4, shiftDown]
KeyEvent [source = BorderPane[id=cnt_borderPane], target = Button@1a3fc21a[styleClass=button]'', eventType = KEY_RELEASED, consumed = false, character = , text = , code = SHIFT]
KeyEvent [source = BorderPane[id=cnt_borderPane], target = Button@1a3fc21a[styleClass=button]'', eventType = KEY_RELEASED, consumed = false, character = , text = 4, code = DIGIT4]
View Replies
View Related
Sep 5, 2014
I would like to extract text (String) from a TextFlow control.
View Replies
View Related
Jul 7, 2014
I'd like the GUI to be drawn based on definition file. Is it possible to "generate" fxml (like PHP does html) so I could do this:
for (...) {
command_to_generate (<button ....>);
}
?
Or is using legaxy javaFX code the only way to achieve it?
View Replies
View Related
Apr 10, 2015
My JavaFX code like this:
WritableImage image = scene.snapshot(null);
File outputFile = new File("C:PSBJavaFXApplication1src est0.jpg");
ImageIO.write(SwingFXUtils.fromFXImage(image, null), "jpg", outputFile);
When open this jpg, its background is in orange color. For png type, it works great.
View Replies
View Related
Mar 16, 2015
I am new to JavaFX and OpenCV. The Problem is, that JavaFX can't handle Mat objects. First I load an image as a BufferedImage. Then i have to convert this to Mat. Do my image Processing with OpenCV and again convert the result image to a BufferedImage to display in on my UI. Here are the methods for converting Buff to Mat and Mat to Buff I found on the internet:
public static Mat img2Mat(BufferedImage image)
{
byte[] data = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
Mat mat = new Mat(image.getHeight(), image.getWidth(), CvType.CV_8UC3);
mat.put(0, 0, data);
return mat;
[Code] ....
Next I do some OpenCV stuff:
public static BufferedImage hello(BufferedImage img) {
Mat source = img2Mat(img); //Convert Buff to Mat
BufferedImage outImg = null;
try{
System.loadLibrary( Core.NATIVE_LIBRARY_NAME );
[Code] ....
Finally I call the hello method in my controller:
void menuItemTestFired(ActionEvent event) {
try {
result = ImageProc.hallo(bImage);//bImage is an image I've loaded before.
imageView.setImage(SwingFXUtils.toFXImage(result, null));
[Code] .....
Unfortunately I get a lot of errors. Here are the first one:
Caused by: java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat(III)J
at org.opencv.core.Mat.n_Mat(Native Method)
at org.opencv.core.Mat.<init>(Mat.java:471)
[Code] ....
Can't figure out why this doesn't work. -.-
View Replies
View Related