Results 1 to 2 of 2
  1. #1
    TechyJay is offline Member
    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Default Game In progress need help with Textfield Gui

    A bit new to the forums here, I thank you for your help in advance. Ok, so I have a game already a private project of mine. So far I have 1k lines of code and I'd like to redirect all the System.out lines to a gui application that i've made(its not perfect just a test) A) how would I have my current classes with output of System.out.println() output methods to a gui object created in the main engine program? Here is an example of a simple gui I made. B) Is there an alternate way or more logical one that I'm missing?


    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ArenaOutputGui extends JFrame{

    String i="", o="";
    JTextArea textarea;

    JPanel panel;

    public ArenaOutputGui(){
    }
    protected ArenaOutputGui(String in, String out){
    super("game");
    i=in;
    o=out;

    setSize(430,300);
    setResizable(false);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLocationRelativeTo(null);
    setLayout(new FlowLayout());

    textarea = new JTextArea();
    panel= new JPanel();
    panel.add(textarea);
    add(panel);

    setVisible(true);

    }
    public void guiOut(String i){
    textarea.append(i);
    }


    }

  2. #2
    TechyJay is offline Member
    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Default Re: Game In progress need help with Textfield Gui

    Nvm lock thread please, I created my own API problem solved =D thanks.

Similar Threads

  1. Progress bar
    By Milanek in forum New To Java
    Replies: 0
    Last Post: 10-11-2011, 05:41 PM
  2. Java Progress bar
    By myka in forum Advanced Java
    Replies: 3
    Last Post: 05-08-2010, 08:16 PM
  3. trying to use progress bar for the first time.
    By IYIaster in forum New To Java
    Replies: 19
    Last Post: 07-26-2009, 04:59 AM
  4. How to use Progress bar
    By LankanSniper in forum AWT / Swing
    Replies: 3
    Last Post: 03-25-2009, 11:44 AM

Posting Permissions

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