내 코드는 내가 다른 화면에 대해 다른 클래스를 만들고자바 FX 렌더링되지는 제대로
을 필요로 할 때 내가가 가지고있는 현재의 코드를 렌더링하려는 두 개의 클래스 중 하나를 MainGUI.java과 Screen.java 구성 MainGUI.java는
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
public class MainGUI extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage pStage) throws Exception {
Screen firstScreen = new Screen();
Scene mainScene = new Scene(firstScreen);
pStage.setScene(mainScene);
pStage.setTitle("TestProg");
pStage.show();
}
}
이
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
public class Screen extends VBox{
private final Label L1 = new Label("Label 1");
private final Label L2 = new Label("Label 2");
private final TextField F1 = new TextField();
private final TextField F2 = new TextField();
private final Button B1 = new Button("This is a button");
Screen(){
super();
showStuff();
}
private void showStuff(){
this.setSpacing(5);
this.setAlignment(Pos.CENTER);
this.setPadding(new Insets(10,0,0,10));
HBox Box1 = new HBox(L1,F1);
HBox Box2 = new HBox(L2,F2);
this.getChildren().addAll(Box1,Box2,B1);
}
}
이를 Screen.java
코드입니다 내가 도움이 될 것이지만, 그러나 나는 jre1.8.0_25를 사용하고 어떤 정보를 아무 생각
: 내가 코드를 실행 한 후 얻을 GUI의 스크린 샷이 있습니다 이미지에서 볼 수 있듯이 Forms는 텍스트를 올바르게 표시하지 않으며 아래에 회색 사각형이 있습니다.
이-Dprism.order=sw
(자바 8로) 위의 명령 줄 스위치가 문서화되지 않은 인 것으로 도시 :
제 PC에서 똑같은 jre + Win7에서 잘 작동합니다. – Prometheus
jre1.8.0_20 - 저에게 효과적입니다. 문제가 무엇입니까? 창의 크기 또는이 이상한 유물? –
유물, 그리고 크기를 조정 한 후에 더 이상 양식에 텍스트를 입력 할 수 없습니다. – LearnTitan