Results 1 to 4 of 4
  1. #1
    Isong is offline Member
    Join Date
    Oct 2010
    Posts
    5
    Rep Power
    0

    Default How do I integrate these two codes?

    code removed.
    My goal is to print the output of the first code onto a new window in a certain font as shown in the second. When I try to combine the codes, the output comes out wrong.
    Last edited by Isong; 11-03-2010 at 08:06 PM.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    When I try to combine the codes, the output comes out wrong.

    At the moment your tester class (should be Tester) outputs to System.out, and the gui classes displays "Hello World". So what is the attempt to combine the codes (code please), and what is wrong with the output that results?

    Since the FontComponent instances are intended to display different messages some way of telling them what message to display is needed. Consider doing this in their constructor, to provide a setter method.

    The Tester class is going to have to create instance(s?) of the frame or component and tell them what message to display before making them visible. Decide how you are going to display the information: are lots of frames going to be displayed? Or is a single frame/component going to be used?

  3. #3
    Isong is offline Member
    Join Date
    Oct 2010
    Posts
    5
    Rep Power
    0

    Default

    Sorry, I should have been more clear.
    The String message should be the current dates of the week as seen as the result of the first code instead of "Hello World"
    When I try to integrate the first code into the second, the dates of the week begins print out the next consecutive number repeatedly.
    ex:
    correct output- 31 | 1 | 2 |3 | 4| 5| 6|
    resulting output after integrating - 31 | 1 | 2 |3 | 4| 5| 6| 7| 7| 7| 7| 7| 7| 7| 7|

    only one frame is going to be used for this program.

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    When I run it, the main() method of the Tester class generates

    Java Code:
    31   1   2   3*  4   5   6

    so I'm guessing that the output after integrating is coming from some code you haven't posted.

Similar Threads

  1. integrate jsf in struts2
    By vinoopraj in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 04-28-2009, 07:16 AM
  2. integrate EJB with Struts in NetBeans
    By Aseem in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 03-24-2009, 02:01 AM
  3. how jboss integrate with Netbeans 5.5.1 platform
    By obaidulcse@gmail.com in forum NetBeans
    Replies: 0
    Last Post: 12-02-2008, 12:09 AM
  4. Integrate JOSSO with Glassfish
    By Kavitha Kamath in forum New To Java
    Replies: 0
    Last Post: 11-12-2008, 09:59 AM
  5. Help, Integrate a Java with Matlab
    By toby in forum Advanced Java
    Replies: 2
    Last Post: 08-07-2008, 07:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •