Gera Levi

Greenhorn
+ Follow
since Jun 07, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Gera Levi

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!

14 years ago
mmm yeah that's what I thought, haha but you never know, by the way does this splash screen code actually works? 'cause now I'm having a big headaque with a splashscreen with progress bar, I've seen so many codes and topics, but never got lucky
14 years ago
you are just missing a "/" before the name of your package to use it from that direction bro, try

"/PACKAGENAME/IMAGE"

NOTE: Dashes are used the regular ones, not the inverted "\"

Try it out
14 years ago