JavaFX 可以读取并区分重复的键值对吗?
似乎有多种方法可以将参数传递给 JavaFX 应用程序。
这将使 arg_# 的键值对及其值可访问。
<script src="http://dl.javafx.com/1.1/dtfx.js"></script>
<script>
javafx(
{
archive: "JavaFXApplication.jar",
width: 1014,
height: 1024,
code: "javafxapplication.TestMain",
name: "JavaFXApplication"
arg_1: "value1",
arg_2: "value2"
}
);
</script>
上面的代码是有效的。下面的代码提供了完全相同的功能。
<script src="http://dl.javafx.com/1.1/dtfx.js"></script>
<script>
javafx(
{
archive: "JavaFXApplication.jar",
width: 1014,
height: 1024,
code: "javafxapplication.TestMain",
name: "JavaFXApplication"
},
{
arg_1: "value1",
arg_2: "value2"
}
);
</script>
但是将这些对括起来会得到什么。
这行得通吗?
<script src="http://dl.javafx.com/1.1/dtfx.js"></script>
<script>
javafx(
{
archive: "JavaFXApplication.jar",
width: 1014,
height: 1024,
code: "javafxapplication.TestMain",
name: "JavaFXApplication"
},
{
arg_1: "value1",
arg_2: "value2"
},
{
arg_1: "value3",
arg_2: "value4"
}
);
能否区分重复的键值对?
There seems to be multiple ways to pass parameters to a JavaFX application.
This will make the key value pairs for arg_# and their value accessible.
<script src="http://dl.javafx.com/1.1/dtfx.js"></script>
<script>
javafx(
{
archive: "JavaFXApplication.jar",
width: 1014,
height: 1024,
code: "javafxapplication.TestMain",
name: "JavaFXApplication"
arg_1: "value1",
arg_2: "value2"
}
);
</script>
The code above is valid. The code below provides the exact same functionality.
<script src="http://dl.javafx.com/1.1/dtfx.js"></script>
<script>
javafx(
{
archive: "JavaFXApplication.jar",
width: 1014,
height: 1024,
code: "javafxapplication.TestMain",
name: "JavaFXApplication"
},
{
arg_1: "value1",
arg_2: "value2"
}
);
</script>
But what do I get for bracketing the pairs.
Will this work?
<script src="http://dl.javafx.com/1.1/dtfx.js"></script>
<script>
javafx(
{
archive: "JavaFXApplication.jar",
width: 1014,
height: 1024,
code: "javafxapplication.TestMain",
name: "JavaFXApplication"
},
{
arg_1: "value1",
arg_2: "value2"
},
{
arg_1: "value3",
arg_2: "value4"
}
);
Can I distinguish between the repeating key value pairs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来这是执行此操作的合乎逻辑的方法
......
Looks like this is the logical way to do this...
.