我使用的是Debian 8.7.1。
我想使用Google Chrome Puppeteer。
我有一个名为script.js的文件,并且按照Puppeteer文档中的建议放置了获取屏幕截图命令。
为了运行JavaScript文件,我运行以下命令:
nodejs script.js
Run Code Online (Sandbox Code Playgroud)
但这有一些错误:
(node:929) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install"
(node:929) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Run Code Online (Sandbox Code Playgroud)
nodejs -v是v8.4.0并且npm -v是5.3.0。
请帮我解决这个问题。
我有木偶戏的问题。我无法在我的 debian 8.7.1 上安装它。这些是步骤:
1.安装镀铬:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get -f install
sudo dpkg -i google-chrome-stable_current_amd64.deb
Run Code Online (Sandbox Code Playgroud)
2.安装nodejs & puppeteer:
apt-get install curl
curl -sL https://deb.nodesource.com/setup_8.x | bash -
sudo apt-get install -y nodejs
npm i puppeteer
Run Code Online (Sandbox Code Playgroud)
当我运行时npm i puppeteer,错误是:
> puppeteer@0.11.0 install /root/node_modules/puppeteer
> node install.js
ERROR: Failed to download Chromium r499413! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Error: Download failed: server returned code 403. URL: https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/499413 /chrome-linux.zip
at ClientRequest.https.get.response (/root/node_modules/puppeteer/utils/ChromiumDownloader.js:195:21)
at Object.onceWrapper (events.js:316:30) …Run Code Online (Sandbox Code Playgroud) 我的项目使用了 javafx 和 sdk20。我在使用数据库时遇到一些警告。(我的IDE是eclipse)
警告是:
Description Resource Path Location Type
The type Connection from module java.sql may not be accessible to clients due to missing 'requires transitive' dbConnect.java /myProject/src/mypackage line 25 Java Problem
Run Code Online (Sandbox Code Playgroud)
db.java:
package mypackage;;
import java.io.IOException;
import java.sql.*; // Use classes in java.sql package
import java.util.Properties;
public class dbConnect {
// init database constants
static final String databaseDriver = "oracle.jdbc.driver.OracleDriver";
static final String databaseURL = "jdbc:oracle:thin:@localhost:1521:xe";
static final String username = "system";
static final String pass = "oracle"; …Run Code Online (Sandbox Code Playgroud) 我的 fxml 文件上有多个按钮。onAction通过单击任何按钮,将显示定义的 fxml 表单。问题是:
我是否应该使用例如 foreach 加载所有表单,并且当按钮单击正确的表单时仅显示或没有必要?
如果我应该加载所有表单,我应该在initialize函数中执行它吗?
我是新手JavaFx,不知道最好的方法是什么?
编辑:
例如,当 btn1 单击时,将显示“添加用户”表单,当单击“btn2”时,将显示“删除用户”表单,...
问题是:
我是否应该加载添加用户表单并删除用户表单,...当程序启动时以及当例如 btn1 单击添加用户表单时是否显示?
<BorderPane fx:controller="com.project.controller.eventcontroller" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<left>
<VBox prefHeight="400.0" prefWidth="110.0" style="-fx-background-color: #404040;" BorderPane.alignment="CENTER">
<children>
<Button fx:id="btn1" alignment="TOP_LEFT" mnemonicParsing="false" prefHeight="17.0" prefWidth="111.0" text="btn1" />
<Button fx:id="btn2" alignment="TOP_LEFT" layoutX="10.0" layoutY="10.0" mnemonicParsing="false" prefHeight="17.0" prefWidth="111.0" text="btn2">
<VBox.margin>
<Insets top="12.0" />
</VBox.margin>
</Button>
<Button fx:id="btn3" alignment="TOP_LEFT" layoutX="10.0" layoutY="47.0" mnemonicParsing="false" prefHeight="17.0" prefWidth="111.0" text="btn3">
<VBox.margin>
<Insets top="12.0" />
</VBox.margin> …Run Code Online (Sandbox Code Playgroud) 这是我的观点:
public class AdminPage extends VBox {
public AdminPage() {
Menu menu = new Menu("Optional");
int i;
ArrayList<String> items = new ArrayList<>();
items.add("Product");
items.add("Profile");
items.add("Home");
for (i = 0; i < items.size(); i++) {
menu.getItems().add(new MenuItem(items.get(i)));
}
MenuBar menuBar = new MenuBar();
menuBar.getMenus().add(menu);
this.getChildren().addAll(menuBar);
this.setAlignment(Pos.TOP_LEFT);
}
}
Run Code Online (Sandbox Code Playgroud)
我想编写控制器,但问题是我如何知道点击了哪个项目。
菜单是这样的:
Optional
----------
Product
Home
Run Code Online (Sandbox Code Playgroud)
我希望如果我单击产品,则会打开另一个表单。我认为这是通过点击操作完成的。