mrred128 Active Member Licensed User Longtime User Jun 11, 2014 #1 I would like to know if it is possible to support GUI mode and Console mode in the same app? Ideally I would like to start in console mode and if there is a switch on the command line (ex /gui) to switch into a gui.
I would like to know if it is possible to support GUI mode and Console mode in the same app? Ideally I would like to start in console mode and if there is a switch on the command line (ex /gui) to switch into a gui.
Erel B4X founder Staff member Licensed User Longtime User Jun 12, 2014 #2 You can create a UI app and only call MainForm.Show when you want to show the form. Upvote 0
mrred128 Active Member Licensed User Longtime User Jul 16, 2014 #3 But if you have no X11 session running you get this..... Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207) at java.awt.Window.<init>(Window.java:535) at java.awt.Frame.<init>(Frame.java:420) at javax.swing.JFrame.<init>(JFrame.java:218) at com.javafx.main.Main$1.run(Main.java:882) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) What in the project gets set different when generated as a GUI or CUI? Upvote 0
But if you have no X11 session running you get this..... Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207) at java.awt.Window.<init>(Window.java:535) at java.awt.Frame.<init>(Frame.java:420) at javax.swing.JFrame.<init>(JFrame.java:218) at com.javafx.main.Main$1.run(Main.java:882) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) What in the project gets set different when generated as a GUI or CUI?
Erel B4X founder Staff member Licensed User Longtime User Jul 16, 2014 #4 Many things. The JavaFX engine must be initialized when the program starts. You will need to create two apps. However using the shared modules feature (and conditional compilation) you can share 99% of the code between the two products. Upvote 0
Many things. The JavaFX engine must be initialized when the program starts. You will need to create two apps. However using the shared modules feature (and conditional compilation) you can share 99% of the code between the two products.