我们已经用Java创建了一个内部工具 - >罐。它是在JavaFX中创建的。
.jar在11个人的计算机中有9个可以正常工作,但在其中2个.jar的大小不同。由于某种原因,这两个人的窗户缩小了。我将附上图像以显示差异。
首先,工作PC中的.jar(您可以清楚地看到.jar的边缘,所有字段都清晰可见:
其次,破坏的.jar(我已经绘制了可以看到字段/窗口被剪切的区域,只是因为某些原因框架中的东西不适合那里):
如果需要,我可以提供其他信息。但是目前看来,对于那两台计算机,这些字段不适合框架,它可能是java版本或操作系统的差异吗?
编辑: 添加一些有关布局等的信息(所有元素都在网格中):
@Override
public void start(final Stage stage) throws Exception {
final Group root = new Group();
GridPane grid0 = new GridPane();
final Scene scene = new Scene(root, 1030, 768);
final GridPane grid = new GridPane();
grid.setHgap(5); //The gap properties manage the spacing between the rows and columns.
grid.setVgap(5); //Vahe iga rea ja veeru vahel pmst.
grid.setPadding(new Insets(40, 20, 20, 20)); //while the padding property manages the space around the edges of the grid pane. Ehk kogu raami sisu vahe ��rtest.
//In this example, there are 10 pixels of padding on each side.
//grid.setGridLinesVisible(true); //N�itab t�pselt joonduse �ra
GridPane grid2 = new GridPane();
grid2.setHgap(5); //The gap properties manage the spacing between the rows and columns.
grid2.setVgap(5); //Vahe iga rea ja veeru vahel pmst.
grid2.setPadding(new Insets(40, 20, 20, 20)); //while the padding property manages the space around the edges of the grid pane. Ehk kogu raami sisu vahe ��rtest.
final GridPane grid3 = new GridPane();
grid3.setHgap(5); //The gap properties manage the spacing between the rows and columns.
grid3.setVgap(5); //Vahe iga rea ja veeru vahel pmst.
grid3.setPadding(new Insets(40, 20, 20, 20)); //while the padding property manages the space around the edges of the grid pane. Ehk kogu raami sisu vahe ��rtest.**strong text**
grid0.add(grid, 0, 0);
Line joon2 = new Line(0, 0, 0, 800);
grid0.add(joon2, 1, 0);
grid0.add(grid2, 2, 0);
final Line joon3 = new Line(0, 0, 0, 800);
grid0.add(joon3, 3, 0);
grid0.add(grid3, 4, 0);
root.getChildren().
add(grid0);
root.getChildren().
add(menuBar);
stage.setResizable(false); //Cannot resize the Bit!
stage.setScene(scene);
stage.show();
答案 0 :(得分:1)
谢谢大家的回复,我设法找出了问题!
有两种方法可以解决这个问题: