### MessageDialog JFrame

B4J HowTo Project - Non-UI application showing HelloWorld with a JFrame and JLabel
@run: From the commandline: java -jar helloworld.jar
`Sub Process_Globals
Private joInlineJava As JavaObject = Me
End Sub`
`Sub AppStart (Args() As String)
Log("App Startet " & DateTime.Date(DateTime.Now) & " " & DateTime.Time(DateTime.Now))
Dim msg As String = "

# Hello World!

Try to run this example from a Raspberry Pi

"
joInlineJava.RunMethod("MessageDialog", Array(msg))
'StartMessageLoop
End Sub`
'Show a swing message dialog in a B4J nonui app
If JAVA
import javax.swing.JFrame;
import javax.swing.JLabel;
public static void MessageDialog(String msg) {
JFrame f = new JFrame("Message");
JLabel l = new JLabel(msg, JLabel.CENTER);
f.setType(javax.swing.JFrame.Type.UTILITY);
f.setSize(300,300);
f.add(l);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
End If

Changed: , Category: B4J UI Applications on ARM Boards, File: T6C163M1206.htm, ID: 1206