简体   繁体   English

JavaFX PopUp拖放

[英]JavaFX PopUp Drag and Drop

first i use JavaSE 1.7 -> The product i develop for is setting this standard. 首先,我使用JavaSE 1.7- >我开发的产品正在设置该标准。 So i can not use the Functions of JavaFX8! 所以我不能使用JavaFX8的功能!

I developed a Custom Menu Item like this: http://de.share-your-photo.com/7f2f7d74d8 我开发了这样的自定义菜单项: http : //de.share-your-photo.com/7f2f7d74d8

There you can see some triangels! 在那里,您可以看到一些三角龙! If the triangle shows to the right side i want to get a PopUp on the right hand side next to the Menu Item. 如果三角形显示在右侧,则我在菜单项旁边的右侧获得弹出窗口 My Problem is that the popup should be dragable and it should not be possible that the PopUp leaves the Main Stage. 我的问题是,在弹出的应该是dragable和弹出窗口离开主舞台,应该是不可能的。

Could you please help me with this Problem? 您能帮我解决这个问题吗? What kind of class should i use to develop the PopUp? 我应该使用哪种类来开发PopUp?

Maybe is it possible to make a PopUp Object Draggabel? 也许可以制作一个PopUp对象Draggabel吗?

I solve the problem, by myself. 我自己解决问题。 I added a container (VBox) to the popup and makes this one draggable! 我在弹出窗口中添加了一个容器(VBox),并使该容器可拖动! With every new Koordinate, i set the x&y coordinates to the new position! 使用每个新的坐标,我将x&y坐标设置为新位置!

container.setOnMouseDragged(new EventHandler<MouseEvent>() {

            @Override
            public void handle(MouseEvent event) {
                // TODO Auto-generated method stub
                if(dragAct==true){
                    //DRAG HANDLING
                }
            }
        });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM