• Post Reply Bookmark Topic Watch Topic
  • New Topic

Best practice when dealing with GUI???  RSS feed

 
Janus Knudsen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im wondering what the best practice is when dealing with the GUI!. How do I make my GUI most appropriate for future implementations?. Should I make a special GUI class or ??
Could some of you experts, please give me hint in the right direction )

Kind regards
Janus, DK
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "future implementations"? Most modern GUI's follow the MVC (Model View Controller) Pattern. You might want to look into that. It will give you some good guidelines and modern practices that are followed for constructing GUI's.
Also, there is the JAVA Look And Feel Guidelines.
This will help you constuct GUI's that follow a typical design methodology that consists of Shortcut Keys, Menu Components, basically things that all GUI's should have in common to lessen the learning curve of your applications interface.
 
Janus Knudsen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By future implementations i mean some welldesigned code-structure easy to understand, even after many months!!
Maybe be a welldesigned GUI-class or something like that?? - Maybe some special methods each called for a special component??
I'm new in Java therefore my strange questions.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think well designed code is in the eye of the beholder.
Personally, I think the key to good, clean, well designed code is comments. No one is going to be able to look at your code and know exactly what is going on no matter how many patterns you use or how clean your logic is. But adding comments will sure help that process.
Also, good variable names. For example:
JPanel p1 = new JPanel();
JPanel mainFramePanel = new JPanel();
Which would you rather see when debugging 5000 lines of code and you see p1 on line 4000?
As far as good coding practices in general, as in guidelines to follow when building GUI code, I am not a good source for that information. But I bet there are a few books on the subject.
I still say take a look at MVC though.
 
basha khan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use MVC architecture ..
use a good IDE
plan seperate classes for seperate windows..
make a good model before u start.
think about 'future referencing' while u r coding.
u can get GOOD GUI and good code
basha
SCJP
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!