View unanswered posts | View active topics It is currently Sun Mar 26, 2017 6:18 am



Reply to topic  [ 3 posts ] 
 JavaFX: Label refreshing problem when using "-fx-effect" 
Author Message

Joined: Wed Aug 18, 2010 11:48 am
Posts: 4
Post JavaFX: Label refreshing problem when using "-fx-effect"
Hi,

I found the following bug in MigLayout for JavaFX:

I built a digital clock. So I have a Label and a table view. The value of the label is changed within a timeline every second.I'm using MigLayout to position the label above the table view. All works fine. But if I use "-fx-effect" on table view, the label is not updated anymore! Very strange. If I remove the -fx-effect css definition from table view, the label is refreshing correctly. When I'm using VBox instead of MigLayout, the label refreshs correctly - even I use "-fx-effect" on table view...

Here is the example code to reproduce the bug:

public class TestDigitalClock extends Application
{

private Scene scene;
private StringProperty clockLabelTextProperty;

@Override
public void start(Stage stage) throws Exception
{
stage.setTitle("TestDigitalClock");

//VBox root = new VBox(); //it works with VBox
MigPane root = new MigPane("flowy","[]","[][]");

TableView tableView = new TableView();
tableView.setStyle("-fx-effect: dropshadow(one-pass-box, #000, 10, 1.0, 0, 0);"); //remove this line to "fix" the bug

Label clockLabel = new Label("Time: ");
this.clockLabelTextProperty = clockLabel.textProperty();

root.getChildren().addAll(tableView, clockLabel);

this.scene = new Scene(root, 800, 600);
stage.setScene(scene);

stage.show();

createDigitalClock();
}


public void createDigitalClock()
{
final Timeline timeline = new Timeline();
timeline.setCycleCount(Timeline.INDEFINITE);
final KeyFrame kf = new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent actionEvent)
{
Calendar calendar = GregorianCalendar.getInstance();
clockLabelTextProperty.setValue(calendar.getTime().toString());
}
});
timeline.getKeyFrames().add(kf);
timeline.play();
}

public static void main(String[] args)
{
launch(args);
}
}


Mon Feb 11, 2013 1:13 pm
Profile

Joined: Thu Oct 25, 2007 3:18 pm
Posts: 96
Post Re: JavaFX: Label refreshing problem when using "-fx-effect"
Hm. Interesting. You provided an example, so I'll take a peek this week, see if I can spot what is the problem.

Tom


Mon Feb 11, 2013 11:04 pm
Profile

Joined: Thu Oct 25, 2007 3:18 pm
Posts: 96
Post Re: JavaFX: Label refreshing problem when using "-fx-effect"
I've started your example and for me the label is updated both with and without the setStyle line. I'm using JDK1.7.13 with the JavaFX version that is included.


Thu Feb 14, 2013 6:46 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.