View unanswered posts | View active topics It is currently Sat May 27, 2017 9:12 am



Reply to topic  [ 6 posts ] 
 JavaFX2 debug causes multi layout to not respond 
Author Message

Joined: Wed Apr 25, 2012 1:02 am
Posts: 1
Post JavaFX2 debug causes multi layout to not respond
I registered just to share the behavior that I'm seeing. If you have multiple MigPanes with buttons, and turn on debug, some of your button's do not respond. Nodes in the Pane seem to be unresponsive.

Here is an example:

Code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import org.tbee.javafx.scene.layout.MigPane;

public class MigTest extends Application {

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

    @Override
    public void start(final Stage stage) throws InterruptedException {
         stage.setTitle("MigPane example");
        Button newBtn = new Button("New");
 
        MigPane layout = new MigPane();
 
        layout.add(newBtn);
       
        MigPane mp = new MigPane("debug");
        mp.add(new Button("FOOO1"));
        layout.add(mp);
        MigPane mp2 = new MigPane();
        mp2.add(new Button("FOOO2"));
        layout.add(mp2);
       
        Scene scene = new Scene(layout);       
        stage.setScene(scene);
        stage.show();
    }
}


The "debug" constraint causes button "New" to not work. If I remove the "debug" constraint things work as you would expect, "New" responds to clicks.


Wed Apr 25, 2012 1:11 am
Profile

Joined: Thu Oct 25, 2007 3:18 pm
Posts: 96
Post Re: JavaFX2 debug causes multi layout to not respond
Ah, debug places rectangles over the layout to visualize the borders. That probably is the cause. Now I need to figure out how to make these rectangles "borders only".


Wed Apr 25, 2012 10:00 pm
Profile

Joined: Thu Oct 25, 2007 3:18 pm
Posts: 96
Post Re: JavaFX2 debug causes multi layout to not respond
Turns out the problem seems to be what I expect (it is caused by the rectangles put on top to show the layout borders), only the fix appears not to be as simple as I hoped. Also the rectangles seem incorrect. Need to do some research on what is going on.


Thu Apr 26, 2012 11:00 am
Profile

Joined: Thu Oct 25, 2007 3:18 pm
Posts: 96
Post Re: JavaFX2 debug causes multi layout to not respond
I'm still busy trying to figure out what is going wrong here. But first let me ask the obvious (that I didn't see at first): why are you nesting two MigPanes in another? Generally you should try to use a single layout as much as possible, that is why miglayout has such powerful layout constraints. So for three buttons I would expect this:


MigPane layout = new MigPane("debug");

Button newBtn = new Button("New");
layout.add(newBtn);

layout.add(new Button("FOOO1"));

layout.add(new Button("FOOO2"));

And this works exactly as it should.


Sat Apr 28, 2012 10:04 am
Profile

Joined: Thu Oct 25, 2007 3:18 pm
Posts: 96
Post Re: JavaFX2 debug causes multi layout to not respond
I found the problem; the nested MigPane is too big; it is not placed in the cell the outer MigPane makes available to it. Now I need to find out how to solve it.


Sat Apr 28, 2012 11:08 am
Profile

Joined: Thu Oct 25, 2007 3:18 pm
Posts: 96
Post Re: JavaFX2 debug causes multi layout to not respond
Fixed the problem. Need to build a new Maven release.


Sun Apr 29, 2012 12:57 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.