Re: Combinig 2 GUI's to compile and run at the same time.
- From: tar@xxxxxxxxxxxxx (Thomas A. Russ)
- Date: 26 Apr 2007 11:05:43 -0700
"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
.
- References:
- Combinig 2 GUI's to compile and run at the same time.
- From: Willliwill
- Combinig 2 GUI's to compile and run at the same time.
- Prev by Date: Problem with SWT - "Bring to front"
- Next by Date: Adding custom cell renderer to JTable causes delete problems
- Previous by thread: Re: Combinig 2 GUI's to compile and run at the same time.
- Next by thread: Re: Combinig 2 GUI's to compile and run at the same time.
- Index(es):