Multi color string

Hi Forum,
I would like to know that the following phenomenon is a "feature" or "bug".
I select a part of string and set the color with property nodes. This works well, I can make a rainbow text. But when I modify the string (and update the terminal) then the whole string is recoloured automatically with the colour of first character.
I'd like to create a display where the text is continuosly updated, scrolles and different part of the string is coloured/highlighted. If the above mentioned method is not efficient can one show me the right way?
Tamas
Attachments:
Multi color text.png ‏45 KB
Display trial.vi ‏57 KB

I have done something similar using the Picture control
Ben
Message Edited by Ben on 06-06-2007 08:54 AM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Attachments:
Protocol_analyzer.jpg ‏102 KB

Similar Messages

  • How can I get Multi-color text it a swing componet?

    How can I get Multi-color text it a swing componet?
    I've tryed JTextPane and JEditorPane.
    If they support having text in more then one color then I don't see how.
    I want to make a color-coded Java editor in Java, but I can't color-code if I can only have one color.
    JComponent.setForeground(Color fg)
    is not what I need.
    maybe Java doesn't support it yet.
    but I hope it does.
    Please help, thanks.

    Hi,
    I've made you a little example with a coloured JEditorPane and JTextPane:
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ColorDemo extends JFrame {
         public ColorDemo() {
              super("ColorDemo");
              // coloured JEditorPane
              JEditorPane editorPane = new JEditorPane("text/html",
                   "<FONT color=red> This </FONT>"+
                   "<FONT color=blue> is </FONT>"+
                   "<FONT color=green> a </FONT>"+
                   "<B> JEditorPane </B>");
              editorPane.setPreferredSize(new Dimension(250, 150));
              // coloured JTextPane
              JTextPane textPane = new JTextPane();
              textPane.setPreferredSize(new Dimension(250, 150));
              Document doc = textPane.getDocument();
              Style def = StyleContext.getDefaultStyleContext().
                   getStyle(StyleContext.DEFAULT_STYLE);
              try {
                   StyleConstants.setForeground(def, Color.blue);
                   doc.insertString (0, "This ", def);
                   StyleConstants.setForeground(def, Color.red);
                   doc.insertString (5, "is ", def);
                   StyleConstants.setForeground(def, Color.green);
                   doc.insertString (8, "a ", def);
                   StyleConstants.setBold(def, true);
                   StyleConstants.setForeground(def, Color.black);
                   doc.insertString (10, "JTextPane", def);
              } catch (Exception e) {}
              JPanel contentPane = new JPanel();
              contentPane.add(textPane);
              contentPane.add(editorPane);
              setContentPane(contentPane);
         public static void main(String[] args) {
              JFrame frame = new ColorDemo();
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              frame.pack();
              frame.setVisible(true);
    }Hope this helps,
    Kurt.

  • Multi-colored JTable column heading?  How?

    Hi,
    I'm looking for a way to have JTable column heading text
    that can be displayed in multiple colors, so one string
    in one column header, might have each letter a different
    color.
    My application requires highlighting some of the letters
    of a word as red, while others are normal text (black).
    I've been using multi-line strings to simulate vertical
    naming for my column header, for example:
    PPP
    I I I
    N N N
    1 2 3
    for PIN1, PIN2, PIN3. The column data has a binary
    one or zero for each pin, grouped together in one JTable
    column. In my application, if there is an error, I want to
    color just the text representing, say PIN2 red and leave
    the surrounding PIN1 and PIN3 black.
    What approach should I take for doing this with JTable?
    Thanks!
    John Roberts
    [email protected]

    You should override the default cell renderer used by Java
    - JTable.getTableHeader().setDefaultRenderer(yourRenderer)
    Extend yourRenderer from JLabel and use HTML tags to change the color.
    - setText on JLabel with the HTML code like "<HTML> <BODY> <FONT COLOR="red"> A </FONT> <FONT COLOR="green"> B </FONT></BODY> </HTML>"

  • Multi Colored JButton.

    Hi,
    How to make my JButton multi colored? For example upper half red color and lower half blue color. I tried overriding it's paint(g) method, but I am loosing it's text movement on mouse click. Any solution?
    thanks.

    an example for you
    import javax.swing.*;
    import java.awt.*;
    public class Tast {
    public static void main(String[] args) {
    JFrame frame=new JFrame("Test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(new JColoredButton("COLORED BUTTON"));
    frame.pack();
    frame.show();
    class JColoredButton extends JButton {
    public JColoredButton(String title) {
    super(title);
    this.setOpaque(false);
    public void paint(Graphics g) {
    int h=this.getHeight();
    int w=this.getWidth();
    Color oldColor=g.getColor();
    g.setColor(Color.cyan);
    g.fillRect(0,0,w,h/2);
    g.setColor(Color.red);
    g.fillRect(0,h/2,w,h);
    g.setColor(oldColor);
    super.paint(g);
    best regards
    Stas

  • I have an Apple MacBook Pro and when surfing the web my computer will slow to a crawl and I will have a multi-colored spinning wheel visible until my latest request is handled.  What is causing this and is there a way to prevent this from occuring

    I have a MacBook Pro.  When surfing the web it will eventually slow to a crawl.  When this occurs, there will be a small multi-colored wheel spinning until my latest command is handled.  What is causing this and is there a way that I can modify or prevent this from happening?  Is there a setting that will prevent this?

    When you next have the problem, note the exact time: hour, minute, second.
    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Scroll back in the log to the time you noted above. Select any messages timestamped from then until the end of the episode, or until they start to repeat. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Multi Lingual String not getting displayed properly with Java 1.5.4

    Hi,
    I have a strange problem and i think the problem is due to java 1.5.4.
    Problem is:
    My application was previously deployed on weblogic6.1 server and jdk used was 1.3.1
    After i migrated my application to weblogic 9.2 and started using jdk 1.5.4, i am not able to correctly view the data which is stored in different languages on browser.
    Some more details:
    OS - Linux.
    Database - Informix 9.2
    Intresting part is :
    If i enter a new multi lingual string from my application (deployed on WLS 9.2 with JDK 1.5.4) and store it in database, and then try to retreive it, it is displayed correctly.
    Issue arises only when the multi lingual string created and stored in database from my old application (deployed on WLS 6.1 with JDK 1.3.1) is retrieved and displayed in the new application (WLS 9.2 with JDK 1.5.4).
    Hope my issue is clear and if any one has any clue as to how to solve this issue. Kindly help

    One thread is enough.
    http://forum.java.sun.com/thread.jspa?messageID=9651015

  • Retrieving empty values from multi value string in user profile custom properties

    Hi,
    I created a webpart to save and retrieve data from custom properties. I use the code below to get the stored data:
    for (int i = 0; i < profile[property].Count; i++)
    Item = profile[property][i] == null ? string.Empty : profile[property][i].ToString();
    list.Add(Regex.Split(Item, @"\,\#"));
    Nothinig special about it.
    In my development environment, it works fine. The problem is  in my UAT environment. I'm facing an issue that i hope someone has been through. When the custom property is a multi value string type, it returns a empty string. I tested with HTML and single
    value fields and it works fine.
    Independently of the field type, it saves the data all right.
    Can anyone help me?
    Thanks!!

    Thanks, Chitvan Jain.
    I did as you suggested, but nothing changed. The problem is that profile[propname] comes already blank when using multi value property, even if there is data  to be retrieved.
    One funny thing is that, somehow the code manages to count the number of values there is in the property. Only the data is missing. We can see the exact number of column, cause i check if there's the right number of data, if there isn't, i add up  a empty
    string on the grid cell, but only for viewing. The empty string is not stored in the property.

  • Has anyone experienced problems with Mackeeper? I did not complete downloading this software. Yet, occasionally when on the internet, I will have the MacKeeper multi-colored circle replace my pointer. How do you deal with this?

    Has anyone experienced problems with Mackeeper? I did not complete downloading this software. Yet, occasionally when on the internet, I will have the MacKeeper multi-colored circle replace my pointer. How do you deal with this?

    Welcome to Apple Support Communities
    Don't download MacKeeper. Users complain about this app and it damages OS X. Also, Mac OS X knows how to take care of itself, so you don't need any other cleaning application that may damage OS X. See > https://discussions.apple.com/docs/DOC-3691

  • Multi color gradient for touch and selected color of spark mobile list

    multi color gradient for touch and selected color of spark mobile list
    how to get dat?

    or how about a bitmap as the background for the touch and selected color for the items in a list.

  • HoW to ChaNGE the text in the mobile application to be in MulTi-CoLoR text

    _*  Do anyone can tell me how to change the text in the mobile application to be in multi-color text, to make it more interesting and increase readability?
    Is it using the Graphic's paint() method? or any better suggestion?
    Please give the short example if can?
    Please help... "_"
    Hearing from u all soon...@_@
    thanks....

    Go into outline view. If you can see the outlines of the letterforms, you can't just change the text. If the letterforms are solid black, take the type tool, select the text and type yours.
    Anyway you can just select the letters, take the type tool and type new text.
    Working with the type tool is a basic. Please see the manual for details

  • Have a MacBook Pro. the computer will not boot up, the screen has black and white stripes and multi color bands as well.

    Have a MacBookPro. The computer will not boot up. the screen has black and white bands with multi color bands as well.

    Yeah it's dead. Take it to an Apple Genius Bar and have it checked out. Then buy a new one.

  • SQL Server Reporting Services Multi Color selection

    Hi to All.
    iam trying to use this swicth condition in SSRS for multi color view. But its not getting can u suggest me 
    =switch(Fields!AVGSALES.Value<2000 ,"red",Fields!AVGSALES.Value<5000, "blue", Fields!AVGSALES.Value>5000,"yellow"

    Hi pullela venu,
    Based on your description, your switch condition in SSRS don’t work ,right?
    I have tested on my local environment and it works fine, so your problem may due to the conditions of different colors, for example, you haven’t include the value of 2000 and 5000,If the AVGSALES value is 2000 or 5000, this expression will not work, and
    you can also check you have put the expression in the right place, Please check details below one by one to make sure you have done the right:
    1.  Did you want to specify three different colors for three different ranges of values like below?
    Fields!AVGSALES.Value<2000(red)
    Fields!AVGSALES.Value=<2000 and Fields!AVGSALES.Value<5000(blue)
    Fields!AVGSALES.Value>=5000(yellow)
    If the above ranges of value is correct you can modify the switch function in the expression as below:
    =switch(Fields!AVGSALES.Value=<2000 ,"red", Fields!AVGSALES.Value>2000 and Fields!AVGSALES.Value<5000,"blue",Fields!AVGSALES.Value>=5000,"yellow")
    2.  Select the textbox of “AVGSALES” in the properties window and select the expression of color to add the switch function above.
    If you still have any question, please feel free to ask.
    Regards
    Vicky Liu

  • HT201263 After updating to the ios6 my ipod was going on and off displaying the apple icon and then had a white screen that had multi colors on it. Then it had a blue screen.plz help me

    I was updating my iPod touch 4g to the ios6 and it told me to hook it up to the iTunes and so I did. After doing that the computer told me to restore I tried and it didn't work. My ipod then was Turing on and off displaying the apple icon then my screen turned white with rainbow colors going down the screen then at some point my ipod had a multi colored blue screen. The screen was no longer blue after I let it die. Plz help I can't find any solutions.

    Try:
    - iOS: Not responding or does not turn on
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Creating multi-colored brushes in PSE 8

    OK, I am having a really hard time finding information on this...maybe because it can't be done, who knows.  Maybe you all do, I hope!  I am very interested in using Photoshop brushes.  I have PSE 8 and I have a general understanding of brushes...I know how to upload, change color, transparency, etc.  What I don't know is how do I make a butterfly look like a multi-colored butterfly instead of a pink butterfly or a gray butterfly?  I am assuming I need to make several layers, but beyond that I'm lost.  I just can't seem to make it look right when I try to color in with different colors.  I hope all this makes sense and someone can help.
    Thanks in advance!

    She states it's also for PSE 7, but I would think that would be very similar to PSE 8, but I can't seem to make it work as I don't have the same set up she's describing.  If someone maybe could see what she's trying to explain and maybe figure out how to take her instructions and apply them to PSE 8.  Usually, I can follow instructions that aren't from PSE 8 anyway, but this one I am having trouble with.
    http://www.obsidiandawn.com/using-multiple-colors-with-photoshop-brushes-tutoria l
    Thank you to everyone!
    That particular dialog is in Photoshop not Photoshop Elements so she must have mean't PS7 not PSE7. All she's doing is adding a color overlay layer style so you can replicate that by adding your solid color onto a layer over it (fill layer with color or use a solid fill adjustment layer) and using the butterfly as the base of a clipping mask (clipping group...same thing different name).
    Clipping mask tut:
    http://www.photokaboom.com/photography/learn/Photoshop_Elements/layers/layer_groups_clippi ng_masks/1_layer_groups_clipping_masks.htm
    This will give you a solid colored butterfly. Change the solid color blend mode to color just as she does with the layer style. (Softlight blend mode might also do the trick for you.)
    Another option that I think might produce better results would be to clip a gradient map adjustment layer to the butterfly...butterfly again base to the clipping mask...instead of a solid color. Gradient maps color according to the brightness value.
    You can pop in a blank layer between the butterfly and the gradient map and use paint (white or black at low opacity...color is unpredictable) to to push the color to the desired result. (Black will map to one side of the gradient and white to the other with shades of gray mapping between these brightness endpoints.)
    Tutorial on editing gradients:
    http://www.photokaboom.com/photography/learn/Photoshop_Elements/gradients/4_gradients_edit _a_gradient.htm

  • Screen is all multi colored, how to correct?

    Screen is multi colored, tried the restore and reboot.  did not correct.
    Anyone have the answer?

    Do you have something set up in Settings>General>Accessibility? "Multi colored" is hard to envision without a little more detail. How is it multi colored?

Maybe you are looking for

  • Peculiar behavior in a PDF created in Indesign

    Hello, I have a 20 page newsletter pdf with about 12 articles. At the top of the first page there's our text logo, and just below it is a table of contents compiled using table of contents styles (btw this pdf was compiled in Indesign 5.5) and just b

  • Lightning to vga adapter not working after ios 7 update

    After I installed ios 7 on my iphone and ipad, lightning to vga adapter A1439 stopped working on both machines. I thought that the first update would solve this problem. However, I recently installed 7.0.3 update but both machines still can not see t

  • Viewing the users inbox for pending workitems..

    Hi all, I have a situation where in the management has asked me to look into a person's business workplace and report the number of pending workitems.Any suggestions... Regards, Sukumar.

  • Filenames getting truncated in Save for Web AppleScript

    Hey all, running CS4 on an Apple Macbook Pro (using OS X 10.5.6). I am creating an AppleScript that saves out a number of files with different filenames using save for web. The problem is that Photoshop CS4 is truncating the filename, and using a sho

  • How do you create a folder in iPhoto

    I don't see how to create an album in iPhoto for iOS on the new iPad. Am I missing something?