Results 1 to 1 of 1
  1. #1
    kyle.g is offline Member
    Join Date
    Jul 2010
    Rep Power

    Default Object Draw canvas Text

    Hello, I'm new to the forums and still pretty new to java. I'm making a program and need to display text (a variable that holds an integer value).

    Right now I'm running into a dilemma. Everything works correctly as I have it written, but it does not work the way I want it to. This is generically what I have:

    Java Code:
    Text text = new Text (variable, 0.0, 0.0, canvas);
    text.setColor (Color.WHITE);
    Every time the variable changes, the old and new text just overlap each other. When I add a pause and then hide the text it works (by just showing the latest variable value since the last one is hidden) but I need to do this without a pause as the pause can be an infinite amount of values in this program.

    Let me know if you need more info or anything, I can assist you helping me find an answer in any way possible. If anything isn't clear enough just let me know.

    Thank you very much. Let me know if there is an easier way of doing this or how to just show the latest variable value on the canvas the way I am going about doing it.

    P.S. As I said, I'm new to java for the most part, so if you are introducing something that a beginner would find somewhat complicated try your best to explain it. Thank you so much!

    I looked around and I saw this. I'm going to say that I would rather stick with Text than 2d graphics since it seems so much simpler, unless you all feel it would be much easier for what I am doing. Just let me know what you think.
    Last edited by kyle.g; 07-27-2010 at 11:49 PM.

Similar Threads

  1. AWT: Painting buttons and text areas in a canvas
    By chappa in forum AWT / Swing
    Replies: 6
    Last Post: 01-09-2010, 02:37 PM
  2. Problems With Using Canvas to draw On...,
    By Mpisha in forum NetBeans
    Replies: 1
    Last Post: 10-14-2008, 05:27 PM
  3. Demonstrates how to draw vertical text in SWT
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 06-28-2008, 09:26 PM
  4. How to draw text along a curve
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-25-2008, 10:31 AM
  5. How to Draw Text in Java
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 11:14 PM

Posting Permissions

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