Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Basic GUI principles  RSS feed

 
Tris Rabar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm trying to understand some principles that come with basci GUI design. I have an applicatin designed and need to switch between windows, revert to windows that have already been opened, manipulated and closed, obtaining the previous contents, and stuff like that. Can someone please give me some insight into doing such. Do I have to implement threads?? Can anyone explain this concept?
Thanks...
 
Greg Brouelette
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quite a complex question. I tend to make my dialog boxes Singleton objects so menu items or toolbar buttons or whatever wants to pop up the dialog.
 
Tris Rabar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Greg,

Thanks for the reply. I'm not familiar with Singleton objects. Can you explain further?
Thanks...
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The basic idea of the Singleton pattern is a class that allows only one instance of itself to exist.
Here's the basic framework I've used with regards to allowing only one of some frame to exist:


For more information on the Singleton pattern (or other patterns) a quick search on the JavaRanch forums will return some nice results as would a search on google.
Good Luck.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is not an easy one to answer. There are multiple ways to do what you are asking. You could have a DB, pass object references or a few others. The answer actually depends on what you need to do. So unfortunately one answer doesn't exist.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding designing GUI applications, one guru I talked to a while back on this subject said that a course in multimedia design he'd taken at the university was very beneficial to his ability to design a GUI well.
I think this is a good question. Hopefully, someone will turn up with a great website or two on the subject.
Good Luck.
 
Tris Rabar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Thanks for the replies thus far. I really do appreciate all the assistance. I will investigate more on the Singleton class and if I do come up with a way to achieve what I want, I will post it up.
Thanks...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!