我有这样的项目结构:
src
|-main
|-java
|-com.abc.xyz
|-Login.java
Run Code Online (Sandbox Code Playgroud)
我必须向此添加资源文件并使用以下方式读取资源
InputStream is = getClass().getResourceAsStream("launchers.properties");
Run Code Online (Sandbox Code Playgroud)
这是空的.
在Intellij中,我无法在文件夹下添加新包src/main,resources因此项目结构如下所示.如何将launchers.properties资源文件加载到项目中?
src
|-main
|-java
|-com.abc.xyz
|-Login.java
|-resources
|-com.abc.xyz
|-Login
|-launcher.properties
Run Code Online (Sandbox Code Playgroud)
我尝试了@maba建议的解决方案,但仍然无法正常工作

我可能会遗漏一些非常明显的东西,但我无法找到如何为Dialog组件设置Icon(更准确的是ProgressDialog).我知道如何为舞台做这件事,__CODE__但我没有为Dialog家族找到任何东西.不知何故,设置舞台图标不会影响对话框图标.
谢谢
我为JavaFX8u40的JavaFX警报对话框创建了这个非常简单的示例.
public class MainApp extends Application
{
public static void main(String[] args)
{
Application.launch(args);
}
private Stage stage;
@Override
public void start(Stage primaryStage) throws Exception
{
Button create = new Button("Create Alert");
create.setTooltip(new Tooltip("Create an Alert Dialog"));
create.setOnAction(e ->
{
createAlert();
});
primaryStage.setScene(new Scene(create));
primaryStage.show();
stage = primaryStage;
}
protected Alert createAlert()
{
Alert alert = new Alert(AlertType.WARNING);
Image image1 = new Image("http://www.mcaprojecttraining.com/images/java-big-icon.png");
ImageView imageView = new ImageView(image1);
alert.setGraphic(imageView);
alert.initModality(Modality.APPLICATION_MODAL);
alert.initOwner(stage);
alert.getDialogPane().setContentText("Some text");
alert.showAndWait()
.filter(response -> response == ButtonType.OK)
.ifPresent(response …Run Code Online (Sandbox Code Playgroud)