1

The CodenameOne GUI Builder seems to have a mind of its own..

I created a simple form with a button that has a green image when it is enabled and red when disabled. In my code I use another button to call an event function that enables and disables the button.

This seems pretty simple, yet it doesn't work reliably. The button's image changes between green and transparent as it toggles. Other times it works correctly. After I make a change I always do a 'save' and a 'regen' in the GUI Builder and then 'Clean and Build' in NetBeans.

Also, the size of my image is much smaller in the simulator than in the GUI Builder.

GUI Builder is sooo frustrating; I wish I could just code the for using html and css :(

Any suggestions would be appreciated.

Please see my video capture (https://siscocircuits.com/cno_gui_builder_problem.wmv) which shows the problem in action.

Doug Sisco
  • 121
  • 9

1 Answers1

0

You can write code in Java to represent the GUI. In fact that's what the GUI builder does under the surface and that's what most of our demos do. We also support a form of CSS.

The problem with the image sizes is probably due to the fact that you used regular images instead of multi-images to adapt to the various DPIs. I suggest reviewing the generated code to see what went wrong it's a bit difficult to see in the video but you can put a breakpoint in the debugger and step over the generated code.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • Thanks for your reply, but I don't see what the images have to do with the disabled image not showing.. they are the same image size and type, and the GUI Builder shows them working as expected. This isn't they only problem I've encountered with the GUI Builder, it was just the easiest to demonstrate. Clearly the GUI builder is broken, and I'm not sure it's worth wasting time trying to debug the code that it generates but I'll give it a shot and let you know what I find. – Doug Sisco Dec 23 '22 at 14:05
  • It's hard to debug a GUI builder description or video. But if it generates bad code, that's something we can fix and usually workaround more easily. – Shai Almog Dec 25 '22 at 03:16