B4J Library JBetterDialogs

Hi Guys, Im pleased, to introduce jBetterDialog v1.0.

The zip include a demo and the library and a text file to translate it in other languages.

It's already translated in 5 languages ( EN, IT, DE, FR, ES ).

Author OpenJFX
Author Marco Jakob
Modified as library for B4J by Giuseppe Salvi


Any comment will be appreciated.
jBetterDialog
Author:
Giuseppe Salvi
Version: 1

  • Methods:
    • Initialize (EventName As String)
      Initialize Object
    • ShowConfirm (message As String, info As String, title As String) As Int
      Show Confirm Dialog
      Yes = -1
      No = -2
      Cancel = -3
      Close Dialog = 0
    • ShowConfirmWithOptions (message As String, info As String, title As String) As Int
      Show Confirm Dialog With Options
      Ok = -1
      No = -2
      Close Dialog = 0
    • ShowError (message As String, info As String, title As String)
      Show Error Dialog
    • ShowError2 (message As String, title As String)
      Show Error Dialog
    • ShowErrorWithException (message As String, info As String, title As String, ex As String)
      Show Error Dialog With Exception
    • ShowErrorWithException2 (message As String, title As String, ex As String)
      Show Error Dialog With Exception
    • ShowInformation (message As String, info As String, title As String)
      Show information dialog
    • ShowInformation2 (message As String, title As String, buttonLabel As String)
      Show Information Dialog
    • ShowInput (message As String, info As String, title As String) As String
      Show Input dialog
    • ShowInputWithChoices (message As String, info As String, title As String, obj() As Object) As Object
      Show Input Dialog With Choices
    • ShowWarning (message As String, info As String, title As String)
      Show Warning Dialog
    • ShowWarning2 (message As String, title As String, buttonLabel As String)
      Show Warning Dialog
    • showLogin As String
      Show Login dialog
    Properties:
    • SetOwner As Form [write only]
      Anchor the Dialogs in the MainForm
 

Attachments

  • jBetterDialogs v1.0.zip
    104.9 KB · Views: 848
  • Dialogs-ScreenShots_02.png
    Dialogs-ScreenShots_02.png
    53.4 KB · Views: 1,853
  • Dialogs-ScreenShots_01.jpg
    Dialogs-ScreenShots_01.jpg
    182.5 KB · Views: 1,606
  • jBetterDialogs v1.1.zip
    105 KB · Views: 911
  • JBetterDialogLibrary_v1.20.zip
    101.1 KB · Views: 1,250
Last edited:

BPak

Active Member
Licensed User
Longtime User
Installed 7u55 ok. Set Environment vars to it.
Double clicked your jBetterDialogs.jar file which I had saved to the desktop.

Message Box came up as shown below.

Set B4J to the new java compiler.

Tried compiling JBetterDialogs 1.1 and it compiled ok but still got the error message when trying to use the Buttons with the 2 on them at bottom of Demo window.

It still says Resource missing in the error.
 

Attachments

  • jbd.PNG
    jbd.PNG
    33.2 KB · Views: 341

Erel

B4X founder
Staff member
Licensed User
Longtime User
The Java version should not matter unless you are using JNI. I tried your example and it works. However I do get an error with the error 2 dialog (and information 2).

Program started.
Error occurred on line: 89 (main).
java.lang.IllegalArgumentException: Invalid URL: Invalid URL or resource not found
at javafx.scene.image.Image.validateUrl(Image.java:986)
at javafx.scene.image.Image.<init>(Image.java:538)
at anywheresoftware.b4a.giuseppe.salvi.dialogs.DialogWrapper$DialogsWrapper$Builder.setIconFromResource(DialogWrapper.java:1773)
at anywheresoftware.b4a.giuseppe.salvi.dialogs.DialogWrapper$DialogsWrapper$Builder.setInfoIcon(DialogWrapper.java:1793)
at anywheresoftware.b4a.giuseppe.salvi.dialogs.DialogWrapper$DialogsWrapper.showInfo(DialogWrapper.java:1898)
at anywheresoftware.b4a.giuseppe.salvi.dialogs.BetterDialogsWrapper.ShowInformation2(BetterDialogsWrapper.java:78)
at b4j.example.main._info2_mouseclicked(main.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:221)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at anywheresoftware.b4j.objects.NodeWrapper$1.handle(NodeWrapper.java:59)
at anywheresoftware.b4j.objects.NodeWrapper$1.handle(NodeWrapper.java:1)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3113)
at javafx.scene.Scene$ClickGenerator.access$8600(Scene.java:3051)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3333)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3164)
at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3119)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1559)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2261)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:228)
 

lonleystar

Well-Known Member
Licensed User
Longtime User
HI Erel, Thanks for reply u r right. below is the attached library, the zip contain 2 compiled versions:

1) win7 64bit

2) win8.1 64bit.

The demo was compiled under win7 64bit.

Please let me know if it work.
 

Attachments

  • jBetterDialogs v1.1.zip
    207.9 KB · Views: 372
  • jBetterDialogs.jar
    359.3 KB · Views: 457

BPak

Active Member
Licensed User
Longtime User
Hi Giuseppe
The program jBetterDialogs.jar now runs on my computer.

Using 7u45 or 7u55 Java the buttons without the 2 at the end of the name work fine. BUT the bottom 4 buttons with 2 on them just close down the program.
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi Erel, I've a question when i compile the demo under win8.1 64dit it doesnt work with win7 64bit and 32bit, if I compile it under win7 32bit it doesnt work with win8.1 64bit and win7 64bit and etc,etc, how i can resolve it.


P.S.
Just the last 4 buttons work with win8.1 and win7 64bit and 32bit.
 

BPak

Active Member
Licensed User
Longtime User
Tried your suggestion of the two different libraries. Last 4 buttons still not working for me.
 

JuliamnHeim

Member
Licensed User
Longtime User
Hi Giuseppe
First off thanks for the lib, works great on windows. Can't get it to work on Linux. Any ideas? I have Ubuntu 12.01 LTS. Are there any additional files I need to include in my distro to get it to work? Thanks again
 

mjas

Member
Licensed User
Longtime User
Hi Giusepp, nice work.

I'm trying it, but how to translate in other languages?
You said before: "about to use other language, in to the zip is a text file u have to translate it in your language and upload".
The text file "To Translate.txt" is to change the name? and to upload where?

Many thanks for your help in this.
 
Top