小编hsc*_*hsc的帖子

获取Java FX中给定日期的周数

我有一个javafx.scene.control.DatePicker.我想从所选日期中提取(区域设置)周数.到目前为止,我还没有找到解决方案,我不想编写自己的算法.我使用Java8并希望它可以在新的Java时间库中使用.

java javafx java-8 javafx-8

6
推荐指数
2
解决办法
3879
查看次数

JavaFX在CSS中更改禁用文本字段的文本颜色

我在舞台上有一个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 javafx

5
推荐指数
1
解决办法
9774
查看次数

Android使用FirebaseUI和FirebaseListOptions填充ListView不会调用populateView

我在build.gradle中使用以下依赖项:

compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.firebaseui:firebase-ui-database:3.1.0'
compile 'com.firebaseui:firebase-ui-auth:3.1.0' 
Run Code Online (Sandbox Code Playgroud)

我的目标是Listview使用Firebase数据库填充数据.我正在关注Github Firebase上的指南 以下方法应该将数据绑定到listview:

private void showMessages() {

        Query query = FirebaseDatabase.getInstance()
                .getReference("notfication/unread/" + userMailAddress.replace(".", ","))
                .orderByKey();


        FirebaseListOptions<Message> options = new FirebaseListOptions.Builder<Message>()
                .setLayout(R.layout.fbmessage_listitem)//Note: The guide doesn't mention this method, without it an exception is thrown that the layout has to be set.
                .setQuery(query, Message.class)
                .build();


        FirebaseListAdapter<Message> adapter = new FirebaseListAdapter<Message>(options) {
            @Override
            protected void populateView(View v, Message model, int position) {

                TextView tvMessage = v.findViewById(R.id.tv_message);
                tvMessage.setText(model.getDateTimeCreated());

            }
        };

        ListView readMessageList …
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-realtime-database firebaseui

5
推荐指数
2
解决办法
3032
查看次数