我在舞台上有一个texfield:
@FXML
private TextField tfAdUsername;
tfAdUsername.setPromptText(userName);
tfAdUsername.setDisable(true);
Run Code Online (Sandbox Code Playgroud)
textcolor是lightgray,我想把它改成黑色:
.text-field:readonly {
-fx-background-color: #E0E0E2;
-fx-border-color: #94BBDA;
-fx-text-fill: #000000;
}
.text-field:disabled {
-fx-background-color: #E0E0E2;
-fx-border-color: #94BBDA;
-fx-text-fill: #000000;
}
Run Code Online (Sandbox Code Playgroud)
这不会改变文本颜色.什么是正确的CSS属性使用?
我有一个使用的Java解决方案Quartz 2.2.3,而我拥有的是:
@DisallowConcurrentExecution以避免并发,因此同一作业每次只能运行一次(确定)这是我的问题,如果前一个任务没有完成,我不想等待第二个任务,我想跳过第二个任务,并且当时间到时3pm该任务可以运行。阅读javadoc时,我添加了,withMisfireHandlingInstructionDoNothing()但是没有用。
我想我做错了什么或缺少了什么。
我的代码:
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
JobDetail job = JobBuilder.newJob(TestCronService.class).withIdentity("testA","testB").build();
CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity("testA","testB")
.withSchedule(CronScheduleBuilder.cronSchedule("0 0 * * * ?")
.withMisfireHandlingInstructionDoNothing())
.build();
scheduler.scheduleJob(job, trigger);
scheduler.start();
Run Code Online (Sandbox Code Playgroud) 我工作了GlassFish很多,现在当我尝试启动时GlassFish,当我设置用户名和密码时,我得到身份验证失败:
我tryed另一个GlassFish和另一个版本3.1.2.1和3.1.2,和Oracle GlassFish Server 3.1.2.2
我删除了我的域,我再次创建它,但我得到同样的问题,
jdk1.7.0.我觉得我的窗户有问题吗?
有人对这个问题有所了解,以及如何解决?
日志
[#|2016-11-06T08:54:21.111+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.ssl.security.com.sun.enterprise.security.ssl.impl|_ThreadID=94;_ThreadName=Thread-2;|SEC5054: Certificate has expired: [
[
Version: V3
Subject: CN=GTE CyberTrust Root 5, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US
Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
Key: Sun RSA public key, 2048 bits
modulus: 23741889829347261660812437366387754385443431973861114865490414153884050331745811968523116847625570146592736935209718565296053386842135985534863157983128812774162998053673746470782252407673402238146869994438729551246768368782318393878374421033907597162218758024581735139682087126982809511479059100617027892880227587855877479432885604404402435662802390484099065871430585284534529627347717530352189612077130606642676951640071336717026459037542552927905851171460589361570392199748753414855675665635003335769915908187224347232807336022456537328962095005323382940080676931822787496212635993279098588863972868266229522169377
public exponent: 65537
Validity: [From: Fri Aug 14 15:50:00 GMT+01:00 1998,
To: Thu Aug 15 00:59:00 GMT+01:00 2013]
Issuer: CN=GTE CyberTrust …Run Code Online (Sandbox Code Playgroud) 我正在使用JavaFX 8 Pagination控件.
页面导航显示在底部,但我希望它显示在顶部,显示在实际数据之上.
如何在顶部显示页面导航(数字行和箭头按钮)Pagination?
我正在尝试在我的表中插入一些值,这些值是在执行此查询时创建的
public static final String tableName = "ACCOUNT_TABLE";
statement.executeUpdate("CREATE TABLE "+ tableName +" (" +
" ID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY ("+
" START WITH 1, INCREMENT BY 1), username VARCHAR(15), password VARCHAR(100)" + ")");
Run Code Online (Sandbox Code Playgroud)
之后,当表成功创建时,我正在调用register方法将用户插入表中
public boolean registerAccount(final User user){
if (statement != null){
final String userName = user.getUserName();
final String password = user.getPassword();
try {
return statement.execute("INSERT INTO "+tableName +" VALUES (" + userName +"," + password +")");
} catch (SQLException e) { …Run Code Online (Sandbox Code Playgroud) 我有以下文字:
......,Niedersachsen,自2009年3月3日起不收费,类别:...,
现在我想提取NOT IN CHARGE SINCE:逗号后的日期.所以我只需要03.2009在我的子串中得到结果.
那我怎么办呢?
String substr = "not in charge since:";
String before = s.substring(0, s.indexOf(substr));
String after = s.substring(s.indexOf(substr),s.lastIndexOf(","));
Run Code Online (Sandbox Code Playgroud)
编辑
for (String s : split) {
s = s.toLowerCase();
if (s.contains("ex peps")) {
String substr = "not in charge since:";
String before = s.substring(0, s.indexOf(substr));
String after = s.substring(s.indexOf(substr), s.lastIndexOf(","));
System.out.println(before);
System.out.println(after);
System.out.println("PEP!!!");
} else {
System.out.println("Line ok");
}
}
Run Code Online (Sandbox Code Playgroud)
但这不是我想要的结果.
我必须删除项目中未使用的导入.以前我使用的是eclipse,但现在我正在使用STS.
在STS中," CTRL+ SHIFT+ o"无法删除未使用的导入.
我有String模板
xxxxxxxx xxxxx-xx: [{0}] xxxxxxx xxxxx xxxxxx xxxxxx [{1}] xxxxxx xxxx xxxxx'x xxxxx xxxxxx xxxx [{2}]
Run Code Online (Sandbox Code Playgroud)
即使我提供的所有三个参数仍然不起作用
public static void main(String[] args) {
String s = "xxxxxxxx xxxxx-xx: [{0}] xxxxxxx xxxxx xxxxxx xxxxxx [{1}] xxxxxx xxxx xxxxx'x xxxxx xxxxxx xxxx [{2}]";
System.out.println(MessageFormat.format(s,"1","2","3"));
}
Run Code Online (Sandbox Code Playgroud)
输出是:
xxxxxxxx xxxxx-xx: [1] xxxxxxx xxxxx xxxxxx xxxxxx [2] xxxxxx xxxx xxxxxx xxxxx xxxxxx xxxx [{2}]
Run Code Online (Sandbox Code Playgroud)
看输出,它输出{2}而不是3,我找不到为什么它不工作.这是一个错误还是我遗失了什么?
Spring Boot Test 是否可以根据活动配置文件设置 sql 脚本的条件执行?我的意思是,我对存储库进行了集成测试,并使用了一些 @sql 注释,例如:
@Sql(scripts = "/scripts/entity_test_clear.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
Run Code Online (Sandbox Code Playgroud)
对于配置文件 h2,我想执行entity_test_clear.sql
对于配置文件 mysql 我想执行entity_test_clear_mysql.sql
原因是我对这些数据库使用了不同的语法,尤其是这个:
ALTER TABLE organisation ALTER COLUMN org_id RESTART WITH 1;ALTER TABLE organisation AUTO_INCREMENT = 1;Mysql 不理解语法 #1,而 h2 不理解语法 #2(尽管设置了 mysql 模式,如 MODE=MYSQL)
默认情况下,我使用 h2 进行 IT 测试,但在一些罕见的情况下,我也想检查一切是否与 mysql 一起顺利运行。
PS我当然可以尝试一个直接的解决方案,@Profile并对h2和mysql的每个测试进行硬编码,但它与测试中的大量代码重复相结合,我想避免这种情况。
编辑: 测试用例如下所示:
@RunWith(SpringRunner.class)
@DataJpaTest
@AutoConfigureTestDatabase(replace= AutoConfigureTestDatabase.Replace.NONE)
public class EntityRepositoryTestIT {
@Autowired
private EntityRepository entityRepository;
@Test
@Sql(scripts = {"/scripts/entity_test_data.sql", "/scripts/entity_test_data_many.sql"}, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = …Run Code Online (Sandbox Code Playgroud) 这是我的
ResponseEntity<String> response= new ResponseEntity<String> (
"\"<200 OK OK,{\\\"status\\\":200,\\\"success\\\":true,\\\"info\\\":{\\\"mid\\\":{\\\"id\\\":\\\"95706\\\"}}},[]>\"", HttpStatus.OK);
Run Code Online (Sandbox Code Playgroud)
如何从这个响应中提取json?
尝试过response.getBody()但给了我整个字符串。
任何帮助,将不胜感激
response.getBody() but giving me entire string.
ResponseEntity<String> response= new ResponseEntity<String> (
"\"<200 OK OK,{\\\"status\\\":200,\\\"success\\\":true,\\\"info\\\":{\\\"mid\\\":{\\\"id\\\":\\\"95706\\\"}}},[]>\"", HttpStatus.OK);
Run Code Online (Sandbox Code Playgroud)
响应.getBody(); 给出整个字符串而不是 json