This question is answered.


Permlink Replies: 6 - Pages: 1 - Last Post: 11-Oct-2020 13:04 Last Post By: davidekholm
AndreWolff

Posts: 1,883
Registered: 14-Dec-2007
What is the best way to define setColor in a compiled GUI?
Posted: 08-Oct-2020 14:19
 
  Click to reply to this thread Reply
In the FancyBox BSH UI I have in onload.bsh the statements:
     JColorSelector menuBootstrap_backgroundColor = new JColorSelector("menuBootstrap_backgroundColor");
     menuBootstrap_backgroundColor.setColor("#ffffff");

If I port this to a compiled GUI, NetBeans reports illegal start of type for the 2nd statement.

File SkinModel.java contains the statement
public String menuBootstrap_backgroundColor="#ffffff";r
What is the best way to change in the 2nd problem statement?

BTW Is there somewhere a list of differences between BSH and Compiled codes?

I have a simular problem with the last statement in
	JComboBox menuAlignment = new JComboBox(new Object[] {
		new Item("mr-auto", "Left"),
		new Item("mx-auto", "Centered"),
		new Item("ml-auto", "Right")
	});
	menuAlignment.setSelectedIndex(1);


Edit:

I found the solution, I have in Netbeans to move the setColor and SetSelectedIndex to the next section where the controls are added to the panel.

But now I have another problem:

If I move the jar file to the skin lib folder and open an album made with the skin I get the next message:
We're sorry. jAlbum is unable to start. Please pass this error report to support@jalbum.net
Thank you for your patience.
 
java.lang.UnsupportedClassVersionError: The FancyBox skin requires a more recent Java version)
	at se.datadosen.jalbum.AlbumBean.setDataTypes(AlbumBean.java:5292)


The Source / Binary Format field in NetBeans shows JDK 14 and I get trhe same error if I change that into JDK 13 or JDK 8

Edited by: AndreWolff on 08-Oct-2020 18:05

Edited by: AndreWolff on 08-Oct-2020 19:38
RobM

Posts: 3,378
Registered: 4-Aug-2006
Re: What is the best way to define setColor in a compiled GUI?
Posted: 08-Oct-2020 19:50   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Maybe the error is to do with how you are starting jAlbum, see https://jalbum.net/forum/thread.jspa?messageID=338115&#338115

In any event, if you want help debugging a compiled skin then providing your current source files would help. Also, make a new post as it is easier than having to read edit notes.
AndreWolff

Posts: 1,883
Registered: 14-Dec-2007
Re: What is the best way to define setColor in a compiled GUI?
Posted: 08-Oct-2020 20:10   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
Maybe the error is to do with how you are starting jAlbum, see https://jalbum.net/forum/thread.jspa?messageID=338115&#338115
I double click the jAlbum icon as I alwas do
In any event, if you want help debugging a compiled skin then providing your current source files would help. Also, make a new post as it is easier than having to read edit notes.
See http://jalbum.net/forum/thread.jspa?threadID=56596
AndreWolff

Posts: 1,883
Registered: 14-Dec-2007
Re: What is the best way to define setColor in a compiled GUI?
Posted: 09-Oct-2020 15:56   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
I have a related question about color settings:
I use now this code:
JColorSelector menuBootstrap_backgroundColor = new JColorSelector("menuBootstrap_backgroundColor");
  {
              menuBootstrap_backgroundColor.setColor("#ffffff");
             add(menuBootstrap_backgroundColor);
   }
 };
But my SkinModel.java file contains the statement
	public String menuBootstrap_backgroundColor="#ffffff";
So I wonder, is it allowed and recommende to remove the menuBootstrap_backgroundColor.setColor("#ffffff") statement?

Well I tried it and I see I can remove the setColor statements.

Edited by: AndreWolff on 09-Oct-2020 16:13

Edited by: AndreWolff on 09-Oct-2020 16:17
davidekholm

Posts: 3,454
Registered: 18-Oct-2002
Re: What is the best way to define setColor in a compiled GUI?
Posted: 10-Oct-2020 16:02   in response to: AndreWolff in response to: AndreWolff
Correct
  Click to reply to this thread Reply
Yes, just confirming what you figured out. With defaults in your SkinModel, you don't need to initialize components any further.
AndreWolff

Posts: 1,883
Registered: 14-Dec-2007
Re: What is the best way to define setColor in a compiled GUI?
Posted: 10-Oct-2020 18:19   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Thanks, but is that also correct for a BeanShell GUI?
davidekholm

Posts: 3,454
Registered: 18-Oct-2002
Re: What is the best way to define setColor in a compiled GUI?
Posted: 11-Oct-2020 13:04   in response to: AndreWolff in response to: AndreWolff
Helpful
  Click to reply to this thread Reply
Yes
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums