Display messages using javafx

Has anyone used the latter recently?

I included the jar file in the netbeans project

and execute the following code as indicated in the documentation here :

 MessageBox.show(primaryStage,
"Sample of error dialog.\n\nDialog option is below.\n[MessageBox.ICON_ERROR]",
"Error dialog",
MessageBox.ICON_ERROR);

But nothing happens in my code. At least I was expecting some kind of window to appear.

I imported jfx.messagebox.MessageBox;and javafx.stage.Window;in your code.

I am using javafx version: 2.2.50

+4
source share
2 answers

Update

Java 8u40 has added official support for JavaFX dialogs and warnings (message boxes).

Built-in alerts cover the most common message usage scenarios.

ControlsFX, , JavaFX JRE. . , , .., ControlsFX, , JavaFX.

Java 8 ControlsFX.

IMO ControlsFX ( jfxmessagebox), ControlsFX .

ControlsFX .

ControlsFX:

Action response = Dialogs.create()
  .owner( isOwnerSelected ? stage : null)
  .title("You do want dialogs right?")
  .masthead(isMastheadVisible() ? "Just Checkin'" : null)
  .message( "I was a bit worried that you might not want them, so I wanted to double check.")
  .showConfirm();

dialog

, Java 8

, JavaFX 8?

Windows " ", JDK. JDK (, jdk-8-windows-x64.exe) .

JavaFX 2.2

Java . , CSS, , , , - .

JavaFX 8 jdk 8?

. JavaFX Java 8.

+8

javaFX. ....: -)

+1

Source: https://habr.com/ru/post/1536003/


All Articles