Re: Combinig 2 GUI's to compile and run at the same time.



"Willliwill" <u33694@uwe> writes:

Yes this is homework, having cleared that up what I want to do is compile,
and run these 2 programs simultaneously. Any help would be appreciated.

OK. Here's a general plan of attack. For your week2 assignment, split
the program into two parts: One is the Interest JFrame and the other is
either a class or else a static method that just builds the "all" panel,
and one that builds the button JPanel.

In other words, move the construction of the "all" and "b" panels out of
the Frame construction and make them separately callable.

This will make your Frame code constructor very simple, since it will
pretty much just call

setTitle("Find Payment"); /*GUI specs */
setSize(500,400);
setLocation(200,200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
add(Interest.makeButtonPanel(),BorderLayout.SOUTH);
add(Interest.makeInputPanel(),BorderLayout.CENTER);

That way, you can use the makeButtonPanel and makeInputPanel methods to
create the components and add them to the interface for your second week
project. This will require some reworking of the action handler for the
week1 project, since it will no longer have direct access to the fields
in the InputPanel, but rather will have to get them indirectly. But
that gives you the needed flexibility.

[Snip long code listing]

--
Thomas A. Russ, USC/Information Sciences Institute
.


Quantcast