Multiple forms without multiple windows

D

doug

Hi, I have inherited a java app that uses multiple forms to gather
user information. Each form opens it it's own frame so that at times
there are up to ten windows open at once.

I was thinking of converting most of them to dialogs. Each dialog
would have quite a few textboxes and buttons but certainly doable.

Is there a better way? I would like to have one frame showing a few
input forms and using a few dialogs for simple input. I just think I'm
overlooking something obvious.

I can't use swing as the jvm doesn't support swing.

I'm fairly new to java but have done lots of programming with vb where
all forms are dialogs.

The current app uses many global vars to maintain state and direct the
action of each form. Definitely not a good way to go.

TIA
 
C

Chris Smith

doug said:
Hi, I have inherited a java app that uses multiple forms to gather
user information. Each form opens it it's own frame so that at times
there are up to ten windows open at once.

I was thinking of converting most of them to dialogs. Each dialog
would have quite a few textboxes and buttons but certainly doable.

There's not a lot of difference between a "Frame" and a "Dialog" in
Java. The only differences I'm aware of are that dialogs can be modal
(whereas frames can't), and that dialogs have an "owner" which receives
focus by default when they are dismissed. Unless one of these
differences fits your needs, I don't see an immediate reason to convert
from one to the other.
Is there a better way? I would like to have one frame showing a few
input forms and using a few dialogs for simple input. I just think I'm
overlooking something obvious.

Ike's suggestion of using CardLayout to make the forms available in
pieces (along with, perhaps, either tab-like or wizard-style buttons to
switch pages) is a good one. (Too bad you can't take advantage of Swing
here.)
The current app uses many global vars to maintain state and direct the
action of each form. Definitely not a good way to go.

I don't envy you. Good luck! :)

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
T

Tony Morris

Frame's are native windows, Dialog's aren't.
A solution produced by using CardLayout can "usually" also be solved using a
JTabbedPane.

Depending on the requirements, I'd be investigating one of these two
solutions.

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
 
A

Andrew Thompson

| doug wrote:
| > Hi, I have inherited a java app that uses multiple forms to gather
| > user information. Each form opens it it's own frame so that at times
| > there are up to ten windows open at once.
| >
| > I was thinking of converting most of them to dialogs. Each dialog
| > would have quite a few textboxes and buttons but certainly doable.
|
| There's not a lot of difference between a "Frame" and a "Dialog" in
| Java.

I actually thought the OP meant html
frames* there, but now I reread it, I am
not entirely clear.

Could you clarify doug?

* For those that may be unclear what I
mean, you can specify a 'target' for an html
link, which usually sends the output to
a particular frame of a frameset. If the
target is 'blank' (or something like that)
or a frame that does not currently exist,
a new browser window is opened..

--
Andrew Thompson
* http://www.PhySci.org/codes/ Web & IT help
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
 
D

doug

| There's not a lot of difference between a "Frame" and a "Dialog" in
| Java.

I actually thought the OP meant html
frames* there, but now I reread it, I am
not entirely clear.

Could you clarify doug?

It is an application, not html.

I've never seen an application spawn so many windows, it fills the
task bar.
I just thought opening a dialog box, retrieving the users variables,
and closing it would more object like.

For example, the logon screen captures the user info, validates it and
creates another window, leaving the logon window intact. The next is a
menu and when the user select an item, another window is created. The
others screens have more info, maybe displaying 10 items, and 4 input
boxes. That's why I as thinking modal input boxes might work best.

I would just like to have one code object control the process, and
have it call other objects to capture and display info.

Thanks for your help
 
A

Andrew Thompson

"doug" ...
| > | There's not a lot of difference between a "Frame" and a "Dialog" in
| > | Java.
....
| It is an application, not html.
|
| I've never seen an application spawn so many windows, it fills the
| task bar.
| I just thought opening a dialog box, retrieving the users variables,
| and closing it would more object like.

I will have to cede to others on the
finer points of UI design, but I have
been burning to ask you.

Is it more logical to have some of these
windows compacted into a more 'wizard-like'
approach?

...of course that depends on the exact logic of
the data collection, but if it can be done
sequentially in a single window, that
would have to be cleaner, from both
an UI and logic POV.

You might build the parts of a single
object through successive cards on a
cardlayout in a dialog, then return the
object on close.

| For example, the logon screen captures the user info, validates it and
| creates another window, leaving the logon window intact.

Why are they in a separate window at all?
That is sounding to me like a perfect
example for keeping both those within the
same UI element.

Just some thoughts.

--
Andrew Thompson
* http://www.PhySci.org/codes/ Web & IT help
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top