mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
get basic console info from web view
This commit is contained in:
@@ -10,6 +10,8 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import com.sun.javafx.webkit.WebConsoleListener;
|
||||
|
||||
import static javafx.concurrent.Worker.State.FAILED;
|
||||
|
||||
|
||||
@@ -90,6 +92,11 @@ public class WebFrame extends JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
// FireBug Lite is another option: https://stackoverflow.com/a/9405733
|
||||
WebConsoleListener.setDefaultListener((webView, message, lineNumber, sourceId) -> {
|
||||
System.out.println("console: " + message + " [" + sourceId + " - " + lineNumber + "]");
|
||||
});
|
||||
|
||||
jfxPanel.setScene(new Scene(view));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user