Results 1 to 4 of 4
  1. #1
    Goseph is offline Member
    Join Date
    Dec 2008
    Posts
    8
    Rep Power
    0

    Default [SOLVED] same textbox with different coloured texts

    I am making a simple IDE/debugger for microchip assembler and can't figure out how to make a textbox to display different coloured texts at once in the same box. Is this simple/possible? Or will I have to create my own textbox-like component from scratch?

    Thankful as always for your advice,

    Goseph

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Is this for a Swing application? If so, you may wish to look into use of a JTextPane component. It's more complex than a JTextArea, but it allows for a lot more flexibility when setting the style attributes of the text found in the component. There's a decent Sun tutorial on it here: How to Use Editor Panes and Text Panes (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components)

    On an unrelated note, you may wish to respond to neilcoffey's reply to your question on image drawing and saving here: [SOLVED] Image drawing, saving

    It's simply good etiquette to thank any folks who try to help you here, and also it may help motivate them to help you again in the future.

    Good luck.

  3. #3
    Goseph is offline Member
    Join Date
    Dec 2008
    Posts
    8
    Rep Power
    0

    Default

    yes its swing, thats great I'll use JTextPane thanks alot.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

Similar Threads

  1. Replies: 1
    Last Post: 08-21-2009, 08:07 PM
  2. draw in jpanel using values input in textbox
    By New to JAVA in forum AWT / Swing
    Replies: 6
    Last Post: 07-08-2009, 11:06 AM
  3. color texts
    By layst in forum New To Java
    Replies: 1
    Last Post: 10-22-2008, 02:47 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
  •