• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about GUI (with NetBeans IDE)

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I want to ask about my vision for the GUI. I'm using NetBeans IDE to make it. My idea is something like this, we have a few JPanels with JLabels, and JButtons. First JPanel it's a menu and it is only visible JPanel at the application starts. When we click on the one of the buttons (let's say "Information") we change Menu JPanel Visibility to false, and the JPanel which include the "Information" is now Visible. The JPanel "Information" also has got JLabels and JButtons, and one of JButtons is a "Main Menu" which (when clicked) sets the Menu JPanel visibility as true, and set Information JPanel visibility as false.

My second idea (which is just stupid ;>) is to remove all components on JButton click, and create new components. So in Menu JPanel we got JButton information. When we click it, we remove all components that are in Menu JPanel, and we create new components, that are needed in Information JPanel.

I think that both ideas are terrible, but I have no other idea how to make it. I was thinking about web app, but I don't have such knowledge to create it.



 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ever heard of CardLayout? And I do hope you're not using the NetBeans visual designer (aka Matisse); it's not a beginners' tool and you're more than likely to end up with code you can't comprehend and a design you can't figure out how to change.

I'm moving this from Beginning Java to the GUIs forum, which is where we usually discuss Swing related questions.
 
Marek Krokosinski
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

Sorry for posting in wrong forum..

I read something about CardLayout in documentation (here exactly: http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html ), This is what I was looking for, so now I have to check in in practise , and yes im using netbeans ide to create gui. Why it's not beginner tool? I understand most of the generated code, maybe not all but mostly all..
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have any issues with using an IDE, NetBeans or another. Using a visual designer without having first learned to hand-code a Swing GUI can come back to bite you when you need to add any advanced customizations or functionality.

IMHO it's only worthwhile for someone who plans to make a living designing GUIs to take the effort to learn the advanced features of the designer. For us mere mortals, learning hand-coding is easier, and the code is maintainable.

Another point is that upgrades to the designer can make your earlier designs useless. Recently I read a thread where the only 'solution' was for the programmer to revert to using NetBeans 5.5, losing a lot of bug fixes and enhancements subsequently added to the IDE.
 
reply
    Bookmark Topic Watch Topic
  • New Topic