• 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

AWT Panels in a Vector, and displaying them...

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
Okay, I'm trying to develop a surveying system that will require a lot of different screens (and I can't use Swing.)
Now I thought to have a Vector of Panels that would be created on the fly, only I can't seem to display them... Here is some code from my initial "app" (I like to start small =P)

The nextPanel function is called when a button is pushed...

Not sure if this kind of question deserves to be in the intermediate section or not... Please feel free to tell me to ask similar questions in the beginners forum =)
Thanks!
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This should probably be in the Swing/AWT forum, but let's deal with it. When you change the contents of a continer you have to invoke validate() on it:
java.awt.Component


public void validate()
Validates this container and all of its subcomponents.
The validate method is used to cause a container to lay out its subcomponents again. It should be invoked when this container's subcomponents are modified (added to or removed from the container, or layout-related information changed) after the container has been displayed.


It sounds like you are doing a series of screens, like a wizard. You should look at CardLayout.
It lets you specify several sequential panels and flip between them.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr. Phyre:
Welcome to JavaRanch!
We don't have too many rules round these parts, but we do have our naming policy, which asks that your display name consist of a first and last name, and that it not be an obvious fake. Please head over here and update your name ASAP. Thanks, pardner!
I'm going to move this to the "Swing/JFC/AWT" forum, as Joe suggests. Followups there, please.
[ April 29, 2004: Message edited by: Ernest Friedman-Hill ]
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic