Skip to main content

Easy Question: How to programmatically show a Form created in the designer

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
daddyhop
Offline
Joined: 2006-05-05

Hi all,
I'm creating my forms using the Designer, but I don't want to use the Designer for navigation. I want to create an action event, and to conditionally show the user FormA or FormB. I know how to get a reference to all my forms, but how do I display it?
Thanks,
Bruce

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

If you started navigating with the UIBuilder state machine you can just invoke the showContainer() method with the proper arguments.
If you want to do everything manually you can use UIBuilder.createContainer() to create the form instance, then cast it to Form and invoke show() as usual.