I want to design the Java swing with validation
Please share your ideas
One Button will be available in Top . When clicking the button it should create the JTextfield,JLabel,Jcombobox
It should satisfy the Grid bag constraints
Object of components will be created dynamically
Given the broad nature of your question, the best I can do is point you to the Swing Tutorial.
Just one addition you may not get from the tutorial: when adding/removing components to/from an already visible/realized GUI, be sure to call revalidate() and repaint() on the enclosing container. Or, in the scenario you describe, you may want to call pack() on the top level window instead.
luck, db
There are no new questions, but there may be new answers.
Darryl Burke wrote:Given the broad nature of your question, the best I can do is point you to the Swing Tutorial.
Just one addition you may not get from the tutorial: when adding/removing components to/from an already visible/realized GUI, be sure to call revalidate() and repaint() on the enclosing container. Or, in the scenario you describe, you may want to call pack() on the top level window instead.
Thanks.. I tried your ideas.. Got it .. but faced challenge in Validation with Text Field and Combo box
Hard to get the the reference for single component
Because all components are generated dynamically
Please help me..
You will have to explain the problem much more before anybody can help you.
You may be trying to do too much at once. Add one Component at a time, compiling and running your app after each new Component.
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
Gift giving made easy with the permaculture playing cards