B4J Library [Custom View] RichViewfx CodeArea

micro

Well-Known Member
Licensed User
Longtime User
Hi stevel05
thanks for your job.
Why the your example program crash a this line in CodeArea.bas?
B4X:
SpansBuilder.InitializeNewInstance("org.fxmisc.richtext.StyleSpansBuilder",Null)

Error:
B4X:
java.lang.ClassNotFoundException: org$fxmisc$richtext$StyleSpansBuilder

The latest version downloaded of richtextfx is richtextfx-fat-0.82.jar
 

ThRuST

Well-Known Member
Licensed User
Longtime User
What version of Java are you using? There might be compatible issues because of Java v9.0.1. It should probably work with an earlier version.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Ok then that's not the problem. I used Steve05's CodeArea up to the version before Java 9.0.1 it worked fine before that. It might have been something else that caused my previous project to stop working so I rewrote the whole project again. I'm using a TextArea for my B4J project Athena that I posted in Share my creations.
You might want to ask Steve05 and he might take a look at it himself. If he's not too busy.
 

alienhunter

Active Member
Licensed User
Longtime User

it works this way

#AdditionalJar: richtextfx-fat-0.9.0

in CodeArea.bas
Dim SpansBuilder As JavaObject
SpansBuilder.InitializeNewInstance("org.fxmisc.richtext.model.StyleSpansBuilder",Null)
 

stevel05

Expert
Licensed User
Longtime User
Because the underlying library has changed. As Alien hunter as said, the class is now "org.fxmisc.richtext.model.StyleSpansBuilder"

I will update the lib when I get a chance.
 

ilan

Expert
Licensed User
Longtime User
hi, i am trying to run the example from post #1 but i get an error. i looked for the richtextfx-0.9.0.jar file on the guthub but it seems like it was updated to richtextfx-0.9.2.jar and now the b4j lib is not working.

any plans to update the lib?

thanx, ilan

logs:

 

stevel05

Expert
Licensed User
Longtime User
Hi Ilan I will take a look, but as it may take a while, I've added a link to the 0.8.2 jar on my dropbox to the first post so that you can use it now.

Steve​
 

Mahimahi

Member
Licensed User
Hi, I am trying to switch from using TextArea to CodeArea to take advantage of highlighting of text. With TextArea I was able to resize when the main layout window resizes using .PrefWidth = MainLayoutForm.Width - x, and .PrefHeight = MainLayoutForm.Height - y. With CodeArea I tried doing .setup(MainLayoutForm, Null, 0, 400, MainLayoutForm.Width - x, MainLayoutForm.Height-y) which resizes the control initially when app starts, but while the window/main layout resizes, it doesn't seem to be resizing in MainLayoutForm_Resize event sub.

Can someone please give some pointers? Thanks a lot.
 

stevel05

Expert
Licensed User
Longtime User
From Alejandro Moyano's question, for those wanting to run Richviewfx on java > 8 you will need to add these lines to your project.

B4X:
#VirtualMachineArgs: --add-opens javafx.graphics/javafx.scene.text=ALL-UNNAMED  --add-exports javafx.graphics/com.sun.javafx.text=ALL-UNNAMED
#PackagerProperty: VMArgs = --add-opens javafx.graphics/javafx.scene.text=b4j --add-exports javafx.graphics/com.sun.javafx.text=b4j
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…