请帮我。我有以下代码。
public class Main extends Application {
private static Locale locale = new Locale("de", "DE");
private Scene scene;
public static Stage stage;
@Override
public void start(Stage primaryStage) throws Exception {
stage = primaryStage;
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("FXMLDocument.fxml"));
ResourceBundle bundle = ResourceBundle.getBundle("bundles.lang", locale);
fxmlLoader.setResources(bundle);
Parent root = fxmlLoader.load();
scene = new Scene(root);
stage.setMaximized(true);
stage.setScene(scene);
stage.show();
}
public void reload() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("FXMLDocument.fxml"));
fxmlLoader.setResources(ResourceBundle.getBundle("bundles.lang", locale));
Parent root = fxmlLoader.load();
scene = new Scene(root);
stage.setMaximized(true);
stage.setScene(scene);
stage.show(); …Run Code Online (Sandbox Code Playgroud) 我想了解以下代码:
this.area[y][x + i] = tmp != null ? String.valueOf(tmp.charAt(i)) : " ";
Run Code Online (Sandbox Code Playgroud)
这是类似的代码吗?
if(tmp != null){
this.area[y][x + i] = String.valueOf(tmp.charAt(i));
} else {
this.area[y][x + i] = "";
}
Run Code Online (Sandbox Code Playgroud) 我有横幅,我不会把它放在我的javaFX应用程序中.当用户点击图片打开默认浏览器时.
try {
String path = "http://developer.am/webservice/banner728x90.gif";
URL url = new URL(path);
BufferedImage image = ImageIO.read(url);
label = new JLabel(new ImageIcon(image));
} catch (Exception exp) {
exp.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
我也试图在JavaFX中从awt转换上面的代码