aspose file tools
The moose likes Servlets and the fly likes Less coding :: A dream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Less coding :: A dream" Watch "Less coding :: A dream" New topic

Less coding :: A dream


Joined: Mar 06, 2001
Posts: 3
Hi, there,
I have written many applications in GUI and generally endup
in writing long codes,extending upto hundreds of lines
Can anybody, tell me how do i reduce coding lines?? Other
than deleting , of course!!
eg.If i am using 10 buttons, i'l have to decalare and initialise them taking atleast 10 lines...
Please guide me....
Bye Amol..

---------<br />enter dragon, exit enlightened.
Bharatesh H Kakamari
Ranch Hand

Joined: Nov 09, 2000
Posts: 198
Less coding is very much achievable through code reuse. You can create and call a method that will do the basic intializations and then call this method wherever you are doing the initializations.
This is one of the suggestions.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347

If you are having 10 buttons, you might be able to use a loop. You could put the labels in a vector.
Another thought is to use default colors etc. Use default when you can.
[This message has been edited by Randall Twede (edited March 07, 2001).]

Visit my download page
Ruslan Ivanov
Ranch Hand

Joined: Feb 22, 2001
Posts: 72
GUI is almost never reusable , one day you come to work and someone has already changed my gui that it looked a day before and you have to work with an old stuff but the code that drives the gui stays the same that's what's good about it.
Consider Paul's rocket mass heater.
subject: Less coding :: A dream