willishf
|
Posted: March 12, 2010 19:56 by willishf
|
|
I downloaded the netbeans library and added it to my Palette. I was then hoping to use ValidationPanel instead of JPanel for GUI layout. I can add ValidationPanel to a Panel but it does not let me drop in a text field etc. Is this expected behavior or do I need to do something special. I am running 6.8 |
Netbeans
Replies: 4 - Last Post: May 25, 2010 20:10
by: Tim Boudreau
by: Tim Boudreau
showing 1 - 5 of 5
willishf
|
Posted: March 13, 2010 12:13 by willishf
|
|
It appears this is a netbeans limitation where you can't use a custom Jpanel for GUI layout. I was able to work around it by adding ValidationPanel to a JPanel and then adding a JPanel to the Other Components area and then adding that JPanel via the ValidationPanel properites setInnerComponent. I add a method addValidation() and do all the validation logic setup which get called after initComponents(). |
Tim Boudreau
|
Posted: March 19, 2010 22:20 by Tim Boudreau
|
|
Easiest way in NetBeans is to just use new JPanel Form, and once it's created, change "extends javax.swing.JPanel" to "extends ValidationPanel" - the GUI editor will not notice this change. Generally, it should work to put panel subclasses on the palette and then use them as panels - the only thing being that if a layout manager is already set, that can confuse things. |
Tim Boudreau
|
Posted: May 25, 2010 20:10 by Tim Boudreau
|
|
Implement a ValidationUI which enables/disables the buttons that can close your dialog, and set up the ValidationGroup to do that. See ValidationPanel.showDialog() in the source code - it does pretty much what you'll need. |
Replies: 4 - Last Post: May 25, 2010 20:10
by: Tim Boudreau
by: Tim Boudreau







