How can i convert some caracteres of a String in bold characteres?? hELPME

How can i convert some caracteres of a String in bold caracteres?? hELPME
I have a JList and a DefaultListModel of Strings. So, i have many key words like "proccess", "if", "fi" that i want these characteres in bold.

How i can use HTML in java to change a String to bold?
example
String str = "channel ";
str = <b>str</b>;
like this? syntax error =/

Similar Messages

  • How can I convert an int to a string?

    Hi
    How can I convert an int to a string?
    /ad87geao

    Here is some the code:
    public class GUI
        extends Applet {
      public GUI() { 
        lastValue = 5;
        String temp = Integer.toString(lastValue);
        System.out.println(temp);
        showText(temp);
      private void showText(final String text) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            tArea2.setText(text + "\n");
    }

  • How can I convert  an ArrayList to a String[]

    Hi,
    How can I convert an ArrayList (only with strings) to a String[] ?
    I've tried this :
         public static String listToString(List l) {
              StringBuffer sb = new StringBuffer();
              Iterator iter = l.iterator();
              while (iter.hasNext()) {
                   sb.append(iter.next().toString());
                   if (iter.hasNext()) {
                        sb.append(',');
              return sb.toString();
    But what I get is an array of xxxxx@435634 (for example).
    Thanks a lot !

    Strings are Objects but not all Objects are Strings and at least one of the elements in your List is not a String.

  • How can i convert JMS TextMessage into a String

    Please tell me,How can i convert A JMS TextMessage into a String

    http://java.sun.com/javaee/5/docs/api/javax/jms/TextMessage.html#getText()

  • How can I convert/read out from a string Hex (8-bit), the bit 0 length 1

    How can I convert/read out from Hex (8-bit), the bit 0 length 1 (string subset!!??) and convert it to decimal.
    With respect to one complement and two complement ?

    Just like Jeff, purely guessing here.
    It almost sounds like you just need to Read from Binary File?
    AND the 8-bit number with 1?
    Need more details.  What exactly do you have to start with?  What exactly are you trying to get out of it?  Examples help.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can I convert a Waveform to a String-For​mat?

    Hello,
    I write with "SQL-Execute.vi" datas to an Access-file. The "SQL-Execute.vi" needs a statement in String Format. And that is my problem. My source-datas (that I want to save to Access) are Waveforms. How can I convert the Waveform datas to a String Format?
    Thanks for help!

    Wire the waveform to the Get waveform componants function...from that you get t0, delta t and the sample values. Now you can generate whatever string you want based on that information...
    You could e.g. wire the Y array to a for-loop in which you calculate the time of each sample by taking t0 and adding delta t multiplied with the array index, then you could convert the Y value and the time to strings using the seconds to time string and number to fractional string functions...etc etc...
    MTO

  • How can I convert date infomation to a string just includes the date not th

    I just want the date like Thu 08, july 2004 but not the exact time.
    how can I do that.

    The prior code produces a date formatted as Jul 7, 2004
    To get Wed 07, July 2004, try this minor modification:
    import java.text.DateFormat;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    DateFormat format = new SimpleDateFormat("EEE dd, MMMM yyyy");
    Date mydate = new Date();
    String str = format.format(mydate);
    System.out.println(str);

  • HOW can I convert int value char TO String

    I am trying to study Java by books, but sometimes it is quite difficult to find answers even to simple questions...
    I am writing a program that analyzes a Chinese text in Unicode. What I get from the text is CHAR int value (in decimals), and now I need to find them in another text file (with RegEx). But I can't find a way how to convert an INT value of a char into a String.
    Could you help me?
    Thank you in advance.

    You are confusing matters a bit. A char is a char is a char, no matter
    how you represent it. Have a look at this:char a= 'A';
    char b= 65;Both a and b have the same value. The representation of that value
    can be 'A' or 65 or even (char)('B'-1), because the decimal representation
    of 'B' is 66. Note the funny construct (char)(...). This construct casts
    the value ... back to the char type. Java performs all non-fraction
    arithmetic using four byte integers. The cast transforms it back to
    a two byte char type.
    Strings are just concatenations of zero or more chars. the charAt(i)
    method returns you the i-th char in a string. Have a look:String s= "AB";
    char a= 'A';
    char b= (char)(a+1);
    if (a == s.charAt(0)) System.out.println("yep");
    if (b == s.charAt(1)) System.out.println("yep");This piece of code prints "yep" two times. If you want to compare two
    Strings instead, you have to do this:String s= "AB";
    char a= 'A';
    char b= 'B';
    String t= ""+a+b;
    if (s.equals(t)) System.out.println("yep");Note the 'equals' method instead of the '==' operator. Also note that
    string t was constructed using those two chars. The above was a
    shorthand of something like this:StringBuffer sb= new StringBuffer("");
    sb.append(a);
    sb.append(b);
    String t= sb.toString();This is all handled by the compiler, for now, you can simply use the '+'
    operator if you want to append a char to a string. Note that it is not
    very efficient, but it'll do for now.
    Does this get your started?
    kind regards,
    Jos

  • How can I convert a tab to a String

    Hello,
    I want to read a file, and check if in some place from the text there is a tab there, in case there exist one, repmplace for <tab8> or something like that.
    I have the following.
    import java.io.*;
    import java.util.*;
    public class Expander {
      // other declarations ...
      public static void expand(String[] args) {
    //    BufferedWriter br = new BufferedReader();
        try{
          if(args[0].equals("-v")){
            System.out.println("Expander Version 1.0\nCopyright (C)");
          if(args[0].equals("-h")){
            System.out.println("");
            System.out.println("Usage: java Expander [OPTION] ... [FILE] ...");
            System.out.println("Convert tabs in each FILE to spaces, writing to standard output.");
            System.out.println("Without FILE or with FILE = -, read from standard input.");
            System.out.println("");
            System.out.println("-i    do not convert TABs after non-whitespace.");
            System.out.println("-i=N  have tabs (positive) N spaces apart, not the default 8.");
            System.out.println("-h    display this help message and exit.");
            System.out.println("-v    display version information and exit.");
          if(args[0].equals("-i")){
            BufferedReader in = new BufferedReader(new FileReader(args[1]));
            String tempLine;
            while((tempLine = in.readLine()) != null){
              String temp = check(tempLine);
              System.out.println(temp);
              writeNew(temp,"1"+args[1]);
          else
            System.err.println("Command not Accepted, please check -h for more help");
        catch(IOException e){System.out.println(e);}
        catch(NoClassDefFoundError i){System.out.println(i);System.exit(0);}
      }// closes readLoadData
      public static String check(String line){
        if ( line.equals("\t") )
          return "<TAB8>";
        else
          return line;
      public static void writeNew(String line, String args){
        String name = args+".txt";
        try
          BufferedWriter out = new BufferedWriter(new FileWriter(name, true));
          PrintWriter fw = new PrintWriter(out);
          fw.print(line);
          out.close();
        catch(IOException e)
        { System.out.println(e);}
      public static void main(String[] args) {
        Expander.expand(args);
    }any ideas?
    Tahnks =)

    Hi,
    I guess the best way is to use regular expressions (must use SDK 1.4.1 or higher):
    Add the line:
    import java.util.regex.*;
    and use one of the methods:
    //Regex method to replace all \\t by <tab>
    public String replaceTabs1(String line, String tab) {
    Matcher matcher = Pattern.compile("\t").matcher(line);
    tab = matcher.replaceAll("<tab>");
    return line;
    //Regex method to replace \\t by <tab> one by one
    public String replaceTabs2(String line) {
    Matcher matcher = Pattern.compile("\t").matcher(line);
    while(matcher.find()){
    line = matcher.replaceFirst("<tab>");
    return line;
    Or, use more general method to find and replace any string by any other string in your file
    public String replaceText(String source, String find, String replace) {
    Matcher matcher = Pattern.compile(find).matcher(source);
    source = matcher.replaceAll(replace);
    return source;
    Hope it will work,
    VM

  • How can i convert if the date in string format

    String lFstr = (String) pReq.getParameter("FND");
    String lTstr = (String) pReq.getParameter("TND");
    String lLstr = (String) pReq.getParameter("LWD");
    System.out.println(lFstr + " " + lTstr + " " + lLstr);
    //DateFormat ds = DateFormat.getDateInstance();
    DateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy");
    Date lFdate = null;
    Date lTdate = null;
    Date lLdate = null;
    try {
    lFdate = dateFormatter.parse(lFstr);
    lTdate = dateFormatter.parse(lTstr);
    lLdate = dateFormatter.parse(lLstr);
    } catch (Exception e) {
    System.out.println(lFdate+" "+lTdate+" "+lLdate);
    i am getting the values from request parameters at that time it is giving values.
    after convertion of string to date it is giving the null value what is wrong in this code

    It might have thrown an exception. Try printing the stack trace in the catch block.

  • How can I convert my music, and CDs to MP3, for use in my vehicle's AM/FM/ Stereo? I have a 16 GB SDHC Card, that I would like to load up with some of my music.

    How can I convert my music, and CDs to MP3, for use in my vehicle's AM/FM/ Stereo? I have a 16 GB SDHC Card, that I would like to load up with some of my music.
    Thanks for any help you can furnish.
    Ed

    Well, this question really belongs in the iTunes forum, which is where you will get fast answers.
    Just go to iTunes Preferences.  Click on the General icon.  Set When you insert a CD to Ask to Import CD.  Click on Import Settings.  Set Import to MP3 decoder.  Make sure you're using Good Quality.
    This should deal with your CD's.
    With your current music, as long as it does not have DRM restrictions (older iTunes Music did), select the song, right click on the song (or group of songs), pull down to Create MP3 version. 

  • ITunes 11 has converted some songs to Quicktime movie format. How can I convert them back to MPEGs? format

    iTunes 11 has converted some songs to Quicktime movie format. How can I convert them back to MPEGs?

    I didn't mess with the iTunes Media folder previously, so I don't think that was the cause. Anyway, I manually fixed most of the songs, but I still can't figure out how to fix the movies that became listed as songs.
    Here is a screenshot of what it looks like when I click on "Get Info" for one of the movies (which has ended up in the music section on iTunes):
    There is no option to change the media kind to "movie" or "video" even though it is a movie and it still plays as a movie if I press play.

  • I have some documents from apple works from OSX how can I convert them in Pages in OS Maverick? Thanks Harold

    How can I convert documents from apple works to pages in OSX Mavericks? Harold

    If you're using a version of Pages prior to 5.0, it can import AppleWorks 6 word processing documents directly. Otherwise, reopen them in AppleWorks and export them in a format that Pages can read; for Pages 5.0, those are listed here.
    (107827)

  • How can I convert an InputStream to a FileInputStream ???

    How can I convert an InputStream to a FileInputStream ???

    Thanks for you reply, however, I am still stuck.
    I am trying to convert my application (which runs smoothly) to a signed applet. The following is the original (application) code:
    private void loadConfig() {
    String fileName = "resources/groupconfig";
    File name = new File(fileName);
    if(name.isFile()) {
    try {
         ObjectInputStream in = new ObjectInputStream(new FileInputStream(fileName));
         pAndGConfig = (PAGroupsConfig)in.readObject();
         in.close();
         return;
    } catch(ClassNotFoundException e) {
         System.err.println("++ERROR: "+e);
    } catch(IOException e) {
         System.err.println("++ERROR: "+e);
    System.out.println("Can't find file: " + fileName);
    Because all code and resources now reside in a Jar file (for the signed applet), I must use the following line to access the resources:
    InputStream is = this.getClass().getResourceAsStream(fileName);
    I then need to convert the 'InputStream' to 'ObjectInputStream' or 'FileInputStream' so that I can work with it.
    I would be very grateful if you could help shed some light on the matter - Cobram

  • I recored a video with my ipad, downloaded it to my mac but I cant upload it to Youtube because the format IMG is not a video format. How can I convert it?

    How can I convert a video I took with my ipad on the format IMG to a supported format for Youtube?

    To upload videos to YouTube we have to make sure videos are in a format that YouTube accepts. Here’s the list of some well-known video formats which YouTube supports:
    WebM files (Vp8 video codec and Vorbis Audio codec)
    MPEG4, 3GPP and MOV files – (typically supporting h264 and mpeg4 video codecs and AAC audio codec)
    AVI (Many cameras output this format – typically the video codec is MJPEG and audio is PCM)
    MPEGPS (Typically supporting MPEG2 video codec and MP2 audio)
    WMV)
    FLV (Adobe – FLV1 video codec, MP3 audio)
    But I think you get the wrong video file. iPad recorded video files are in m4v, mp4, mov, avi format but not the img files. Anyway, if you need a video converter, Format factory or iFunia video converter are good choice.
    Good luck!

Maybe you are looking for

  • How can I filter a column based on data in another list.

    I have two lists: List A: Business Unit | BU Services BU1 | Service 1 BU1 | Service 2 BU1 | Service 3 BU2 | Service 4 BU2 | Service 5 BU3 | Service 6 BU3 | Service 7 List B: Sales Rep | Business Unit | Service Jonny Cash | BU3 | Service 7 Kitty Wells

  • Could not be moved to mailbox

    One of my mailboxes is not allowing me to put new messages into it. When I try to put a message in it, I get the response "The message "XXXX" could not be moved to the mailbox "XXXXXXXX" Any ideas about what's wrong?

  • Injecting a watermark on images as they are viewed

    We have over 60k .tif images on a Unix server. These images are engineering drawings from A to J size. When an image is selected via IE or Netscape our current proprietary viewer displays the image. We need to watermark each image when displayed or w

  • Dodge/Burn Tool

    Hi. Just been playing with PSE8 and having problems with the dodge/burn tool. Know it's usually located with the sponge tool but for some reason I can't access them. The sponge tool is visible in the tool box but when highlighted, the options at the

  • Has anyone had issues with texting after doing the update today?

    I did the update today and not I am having problems sending and receiving text messages.  Has anyone else had this problem?