Hi I'm new to this forum, and I've read all over googling about my problem and didn't got lucky...perhaps you can help me out.
well the problem is I believe for most of you guys quite simple, but I'm getting tired:
I have a JFrame with too many TextFields, and an advanced programmer told me that a JButton must not have more than 5 code lines to get best performance.
and in my Button I have loads of setters :P, lets say like 180 variables, so there are like 180 codelines with the setters, because I do the whole process in a java class.
for example: myclass.setMyVariable(Mytextfield.getText()); <--------------like this one, I have over 180 haha, the program works, but I feel it gets somehow laggy...
----Now what I've tried----
thought about sending them in an ArrayList or a String []..... but it's the same story, I would have to put the Mytextfield.getText() again 180 times...and using a "FOR" for that..
well my TextFields are named different... so I couldnt make a FOR that also changes my TextFields names and a position..... so I discarded it.
I've tryied using the jPanel.getComponents() and sending them to a Components[] method in my class. and then managed to separate them and using them, and it worked!
now...the sad story It can get really tricky, and it doesn't work for the inverse, which it would be putting info into the textfields, lets say for an edit option that brings all the info from the
database and put's into the JFrame fields...... only for a virgin JFrame and It doesn't work for me because my frame needs a scrollpane and etc....
So Discarded it...
and Now I'm hopeless, If you guys say there is no other way or that It could be very messy and tricky.....well I guess I should go for investigating a way to put a fancy splashscreen
with a progress bar if my APP get's too laggy with that frame... LOL
I'll wait for an answer, thank you very much!