Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.alt.net!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "tar" Subject: Re: Combinig 2 GUI's to c Message-ID: X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <713e985c577fe@uwe> References: <713e985c577fe@uwe> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 40 Date: Wed, 27 Apr 2011 15:33:57 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918437 96.60.20.240 (Wed, 27 Apr 2011 10:33:57 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:33:57 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:1547 To: comp.lang.java.gui "Willliwill" 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 --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24