Hi Richard,
I ran into another problem as I attempt to improve the visual of my application, the basics with me metawidget work well, but right now I need to establish length certain to the fields displayed in the UI,
Length of the fields displayed for data entry is very small, it does not take the values that I use in the metawidget-metadata.xml, I also try setting an hibernate inspector, but do not work because I am using hibernate configured with Spring, so I don´t know how to resolve this issue, and I cant advance in de develop of my UI because in the metawidgets I use to create new records, the fields appear too small (length).
You can give me a clue to how I can resolve this issue?
The configuration of my application is Java SE, with Spring, Hibernate, and Log4j
Sorry for the inconvenience.
Thank you very much in advance!
Greetings.
Nicolas Prieto
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Richard, thank you very much for the guidance.
I actually was referring to the number of pixels in width, and am using a GridBagLayout, but after reading your comment I started to review the code and realized that while this layout metawidget has set, the JPanel that contains did not have a defined layout, then I assign a BorderLayout to JPanel, using this and the GridBagLayout for metawidget shows me the fields drawn across the width of the container.
I will consider the examples you gave me to control data entry.
You were very friendly and quick to respond. Thank you very much for the help, and for your time!.
Greetings.
Nicolas Prieto.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Richard,
I ran into another problem as I attempt to improve the visual of my application, the basics with me metawidget work well, but right now I need to establish length certain to the fields displayed in the UI,
Length of the fields displayed for data entry is very small, it does not take the values that I use in the metawidget-metadata.xml, I also try setting an hibernate inspector, but do not work because I am using hibernate configured with Spring, so I don´t know how to resolve this issue, and I cant advance in de develop of my UI because in the metawidgets I use to create new records, the fields appear too small (length).
You can give me a clue to how I can resolve this issue?
The configuration of my application is Java SE, with Spring, Hibernate, and Log4j
Sorry for the inconvenience.
Thank you very much in advance!
Greetings.
Nicolas Prieto
Nicolas,
Thanks for your interest in Metawidget!
When you say 'length' are you referring to 'how many pixels wide' the field is, or 'maximum number of characters that can be typed into it'?
The former is controlled by the Layout. If you're using GridBagLayout, for example, it should 'fill width'. What Layout are you using?
The latter is controlled by Swing. Unfortuntely Swing doesn't have a setting for 'maximum number of characters' on JTextField. You can implement one by making a custom Document class and calling .setDocument (see http://www.andrels.com/wp-en_US/index.php/2009/09/setting-maximum-number-of-characters-in-jtextfield). However this is not something Metawidget does by default. You should be able to create a WidgetProcessor that could do this, though. See here for an example: http://metawidget.sourceforge.net/doc/reference/en/html/ch02s05.html#section-architecture-widgetprocessors-implementing-your-own
Regards,
Richard.
Richard, thank you very much for the guidance.
I actually was referring to the number of pixels in width, and am using a GridBagLayout, but after reading your comment I started to review the code and realized that while this layout metawidget has set, the JPanel that contains did not have a defined layout, then I assign a BorderLayout to JPanel, using this and the GridBagLayout for metawidget shows me the fields drawn across the width of the container.
I will consider the examples you gave me to control data entry.
You were very friendly and quick to respond. Thank you very much for the help, and for your time!.
Greetings.
Nicolas Prieto.
Okay blogged the example: http://blog.kennardconsulting.com/2012/06/swingmetawidget-limiting-length-of.html
Thanks a lot!