我正试图在JRE 8中显示一个标签,说明所有内容都是正确的3秒,因为我无法在JRE 7中使用DatePicker而且我发现了这个错误.
Exception in thread "Timer-2" java.lang.IllegalStateException: Not on FX application thread; currentThread = Timer-2
at com.sun.javafx.tk.Toolkit.checkFxUserThread(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(Unknown Source)
at javafx.scene.Scene.addToDirtyList(Unknown Source)
at javafx.scene.Node.addToSceneDirtyList(Unknown Source)
at javafx.scene.Node.impl_markDirty(Unknown Source)
at javafx.scene.Node$7.invalidated(Unknown Source)
at javafx.beans.property.BooleanPropertyBase.markInvalid(Unknown Source)
at javafx.beans.property.BooleanPropertyBase.set(Unknown Source)
at javafx.css.StyleableBooleanProperty.set(Unknown Source)
at javafx.scene.Node.setVisible(Unknown Source)
at Pantallas.PersonalContabilidad$1.run(PersonalContabilidad.java:221)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
correct是一个标签,我显示3秒,它失败,correct.setVisible(false);这是第221行
correct.setVisible(true);
timer.schedule(new TimerTask() {
@Override
public void run() {
correct.setVisible(false);
}
}, 3*1000);
Run Code Online (Sandbox Code Playgroud) 我正在设置我的Subversion post-commit钩子,以便在提交时远程触发Jenkins构建.
首先,我改post-commit.tmpl到post-commit.bat,然后:
我先试了一下:
SET REPOS=%1
SET REV=%2
C:/wget_for_win/wget http://localhost:8080/jenkins/job/my_project/build
Run Code Online (Sandbox Code Playgroud)
然后我提交了一些代码,它按预期工作.但这只会构建一个项目,但我希望它更灵活,所以我改为post-commit.bat我在Jenkins Subversion插件页面上找到的那个:
SET REPOS=%1
SET REV=%2
SET UUID=`svnlook uuid %REPOS%`
C:/wget_for_win/wget \
--header="Content-Type:text/plain;charset=UTF-8"
--post-data="svnlook changed --revision %REV% %REPOS%"
--output-document="-"
--timeout=2
http://localhost:8080/jenkins/subversion/%UUID%/notifyCommit?rev=%REV%
Run Code Online (Sandbox Code Playgroud)
但是这个不起作用.它没有触发Jenkins再建造.我在第二个脚本中做错了什么?
我认为在批处理文件中运行"svnlook"时存在问题.我svnlook uuid [REPO LOCATION]在cmd中运行,它显示了id.然后我把它放在一个批处理文件中:
SET UUID=svnlook uuid [REPO LOCATION]
ECHO %UUID%
Run Code Online (Sandbox Code Playgroud)
运行上面的批处理文件不会输出id.它只显示svnlook uuid [REPO LOCATION].
我正在创建JSF2自定义组件,并在类的第一行跟踪错误.
The type javax.el.ValueExpression cannot be resolved. It is indirectly referenced from required .class files
Run Code Online (Sandbox Code Playgroud)
错误只有当我的组件扩展像复选框相关的组件显示HtmlSelectBooleanCheckbox或HtmlSelectManyCheckbox.像其他组件HtmlSelectOneMenu,HtmlInputText都OK.我已经检查了项目构建路径,javax.faces-2.1.14.jar并且已经添加到构建路径中.

Java -> Code Style -> Code Templates -> Comments -> Methods -> Edit
Run Code Online (Sandbox Code Playgroud)
我已经删除了上面模板中的空格并保存了设置,但是当我按Ctrl+ Shift+F进行 Eclipse 自动格式化时没有删除空格。
Checkstyle 向我抱怨这个空间,我无法在每个 java 文件中手动删除。我需要使用正则表达式来代替吗?
offset=ftell(ptr)-sizeof(student1);
fseek(ptr,offset,SEEK_SET);
fwrite(&student1,sizeof(student1),1,ptr);
Run Code Online (Sandbox Code Playgroud)
该C代码意味着将指针从当前位置移动ftell(ptr)到刚刚读取的结构块的开始.我对吗?
如果我是对的,我可以使用SEEK_CUR而不是SEEK_SET回到文件中的结构块的开头吗?
请告诉我如何使用SEEK_CUR并向后开始结构块.
我是编程的新手.所以请帮助我.
编辑:谢谢你的回答.我正在试图做的是搜索关键字(学生的卷数),并更新该学生的信息(姓名,地址,...).更新的数据将成功替换以前的数据.请让我再问一个问题.有没有办法将新数据插入上一个数据之上,而不是用旧数据替换它?
我在sweetalert2中动态创建了文本框,如下所示:
swal({
title: 'Enter Info',
showCancelButton: true,
html: "<table>" +
"<tr>" +
"<td>name</td>" +
"<td><input type='text' id='name'/></td>" +
"</tr>"
"<tr>" +
"<td>email</td>" +
"<td><input type='text' id='email'/></td>" +
"</tr>"
"</table>"
}).then(function(){
// ajax
});
Run Code Online (Sandbox Code Playgroud)
和jQuery函数一起监听文本框更改事件.
$(document).ready(function () {
<script type="text/javascript">
$('#name').on('change', function(e) {
console.log($(this).val());
});
</script>
});
Run Code Online (Sandbox Code Playgroud)
但是在更改sweetalert2中的文本框值时不会触发事件.jQuery已正确加载,并且可以在sweetalert2模型之外的其他文本框上运行.我也尝试添加<script>...</script>后</table>在上面html:,但仍然没有运气.有人可以帮帮我吗?任何投入将不胜感激.
我是一个C++新手,我的第一个程序有问题.我试图乘以两个浮点数,结果总是显示为1.1111e + 1,其中1是随机数.以下是我写的小程序.
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
int main()
{
float bank;
float dollor;
cout<<"Enter amount of $ deposited at Bank: ";//the data to input is 5000
cin>>bank;
cout<<"Enter current $ price: ";//1usd = 800mmk: the data to input is 800
cin>>dollor;
bank*=dollor;//all deposited $ to local currency
cout<<"Result is "<<bank;
getch();
}
Run Code Online (Sandbox Code Playgroud)
这个程序的结果是4e + 006.
ps:我声明为float,以便在某个时候输入浮点数.我错了,请帮我解决这个问题.谢谢大家......
我使用Struts2框架.在jsp中,我在项目中显示一个登录框,当用户点击登录按钮时,我设置了一个名为"loggedin"的cookie,并在Action类中将其值设置为"true".
然后返回"success"将再次加载此登录页面.
在登录页面中:
<body>
<%
Cookie cookie[] = request.getCookies();
for( c : cookie )
{
if( c.getName().equals("loggedin") )
{
if( !c.getValue().equals("true") )
{
%>
//show login form here.
<%
}//end inner if
else //if cookie "loggedin" value is "true"
{
%>
//show username/profile picture/logout button here
<%
}//end else
}//end outer if
}/end for loop
%>
</body>
Run Code Online (Sandbox Code Playgroud)
我遇到了问题.当我单击登录表单中的登录按钮时,将设置cookie并重新加载页面.但是,在我手动重新加载页面之前,登录表单仍然显示,而不是用户名/个人资料图片.
java ×3
eclipse ×2
batch-file ×1
c ×1
c++ ×1
checkstyle ×1
custom-tags ×1
exception ×1
fseek ×1
javascript ×1
jenkins ×1
jquery ×1
jsf-2 ×1
struts2 ×1
svn ×1
sweetalert ×1
sweetalert2 ×1
timer ×1