Recent Topics
-
sha-512 with saltmsz - Yesterday, 09:16 PM
-
Perl vs PythonPally - Yesterday, 05:24 PM
-
What language/tools should I learn and use?muffin8or - Yesterday, 04:44 PM
-
.htaccess mod_rewrite sub domains to folde excluding wwwIanWilkinson - Yesterday, 03:28 PM
-
[2.7] [PIL] Looping through PNGs, need to check if they're emptybbqroast - Yesterday, 02:36 PM
Recent Blog Entries
Recent Status Updates
Popular Tags
- Managed C++
- networking
- c
- stream
- programming
- Visual Basic 4 / 5 / 6
- console
- Connection
- import
- authentication
- element
- syntax
- session
- hardware
- sql
- javascript
- array
- printing
- generator
- game
- header
- html5
- mysql
- string
- c++
- timer
- loop
- java
- html
- ajax
- form
- C#
- jquery
- php
- assembly
- linked list
- vb.net
- xml
- android
- css
- login
- encryption
- setup
- calculator
- combobox
- binary
- pseudocode
- hello world
- innerHTML
- grid
Dynamic Number Of Text Field
#1
Posted 17 April 2012 - 09:25 PM
I am using jFrame and in my jFrame there is one text field which show number of text field in next step
now I have two problem
1-How to make multi step in jFrame?
2-How can make dynamic text fields? (How to manage values and ...)
3- all data in all step should be accessible?Is it possible?
#2
Posted 18 April 2012 - 03:12 AM
#5
Posted 18 April 2012 - 05:31 AM

Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid
#6
Posted 18 April 2012 - 07:49 AM
You're going to need a loop. Inside the body of the loop you will create a new JTextField and add it to your container. You can control how many text fields get created by manipulating the upper bound of the loop.
#7
Posted 18 April 2012 - 10:16 AM
Or am I misunderstanding your question?

Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid
#8
Posted 19 April 2012 - 07:37 PM
#9
Posted 19 April 2012 - 10:03 PM
#10
Posted 20 April 2012 - 05:13 AM
With for I can manage number of field text but I need multi step form.
Can you describe exactly what it is you're trying to do?

Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid
#11
Posted 20 April 2012 - 07:14 AM
Images are clear
#12
Posted 20 April 2012 - 07:51 AM
I can create that example UI in your post with a few lines of code, but I have no way of knowing whether it satisfies your business logic requirements.
List<JComponent> labelList = new ArrayList<JComponent>();
List<JComponent> textFieldList = new ArrayList<JComponent>();
// Assume 'upperBound' is an int value containing the number of field copies you want.
for (int i = 0; i < upperBound; i++) {
labelList.add(new JLabel("Field #" + Integer.toString(i+1)));
textFieldList.add(new JTextField());
}
// Loop through labelList and textFieldList here and add them to your form or your layout manager.
// ...
There's a lot more to it, like sizing and positioning controls, but that's the gist of it.

Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid
Similar Topics
-
C# - Dynamic Controls
Started by CommittedC0der, 12 Aug 2011 In: Tutorial Forums → C# Tutorials
form
- 4 replies
- 6,541 views
-
Pascal's Triangle Dynamic Visual Display - GDI Program
Started by AceInfinity, 19 Apr 2013 In: Language Forums → C#
gdi, pascals triangle, visual and 1 more...
- 0 replies
- 262 views
-

[SOLVED] Static Binding vs. Dynamic Binding with C++
Started by bahadirtr, 08 Apr 2013 In: Language Forums → C and C++
binding, static, dynamic, c++
- 4 replies
- 235 views
-
Dynamic website
Started by PiJoKra, 30 Jan 2013 In: Language Forums → HTML, CSS and Javascript
dynamic, javascript, website, seo and 1 more...
- 8 replies
- 440 views
-
Java Source: CLArray (Dynamic array - ArrayList)
Started by Chall, 24 Oct 2012 In: Tutorial Forums → Classes and Code Snippets
carray, carrayobject and 5 more...
- Hot 10 replies
- 649 views

















