Need to color the  different textfield with different color in J2ME

hi
i am developing an application where i need to color the different textfield in the form with different color. but i am not able to do this even with the canvas class also. Can you please help me ? Thanks in advance..

In J2ME, I don't think you can do that easily by setting color. If you want to use specific color in a text field, you need to construct the text box your own. Use Graphics object to draw text field (as image) and here specify a color of your choice.
Hope this helps.
Thanks,
Mrityunjoy

Similar Messages

  • I purchased the products and I'm trying to complete a project I've started. I have an image and need to fill the back ground with a color I already have as a background layer so it blends in

    I purchased the products and I'm trying to complete a project I've started. I have an image and need to fill the back ground with a color I already have as a background layer so it blends in

    You should find the forum for whichever product this concerns and post your question(s) there.
    Here is a link to a page that has links to all Adobe forums...
    Forum links page: https://forums.adobe.com/welcome

  • Display of text of different rows with different color - JTable

    Hi all !
    I have struck in a problem. I have to display the different rows with different color in the JTable. I have created an arraylist in the model class, which stores color of all the rows. Now in renderer class, I am just picking up color from the arraylist, taking rowIndex as index for arraylist. I used to set foreground color for each row in the renderer class. The problem is that it is not showing all the rows properly, sometimes it show all the rows correctly, but as i resize the window/panel, it starts behaving abnormally, some text is painted properly, but other aren't.
    Does anybody have any solution regarding this problem.
    One thing i want to mention is that in getTableCellRendererComponent() method, i used to retrive the color everytime, and setting the foreground color of the text. Is this a right approach or some other technique have to be followed.
    here is code of renderer class ---
    import java.awt.*;
    import javax.swing.*;
    * Renderer to plot stage record table.
    public class ExStageCellRenderer extends javax.swing.table.DefaultTableCellRenderer
        Color curColor;
         * returns component to be painted, overridding this method from
         * DefaultCellRenderer
         * @param table
         *            table whose component has to be plotted
         * @param value
         *            value of that particular cell
         * @param isSelected
         *            is Cell selected
         * @param hasFocus
         *            has the cell got focus
         * @param row
         *            row of the cell
         * @param column
         *            column of the cell
         * @return painted component
        public Component getTableCellRendererComponent (JTable table, Object value, boolean isSelected, boolean hasFocus, int row,
                int column)
            Component component = super.getTableCellRendererComponent (table, value, isSelected, hasFocus, row, column);
            ExStageDataModel model = (ExStageDataModel)table.getModel ();       
            if (curColor instanceof Color) {
                    curColor = model.getColor(row);
                } else {
                    // If color unknown, use table's foreground color
                    curColor = table.getForeground();
            String tooltip = "";
            StringBuffer stringBuffer = new StringBuffer ();
            for (int i = 0; i < table.getColumnCount (); i++)
                    Object Value = table.getValueAt (row, i);
                    if (Value == null) continue;
                    stringBuffer.append (Value.toString () + "    ");
            tooltip += stringBuffer.toString ();
            tooltip = tooltip.trim ();
            ((JComponent) component).setToolTipText (tooltip);
            if (column == 1)
                this.setHorizontalAlignment (SwingConstants.CENTER);
            else if (column == 0 || column == 4 || column == 5)
                this.setHorizontalAlignment (SwingConstants.LEFT);
            else
                this.setHorizontalAlignment (SwingConstants.RIGHT);
            // LOOK!! should turn tip off if there is none !!
            component.setForeground (this.curColor);
            //System.out.println("render : " + component.getBounds ());
            //component.validate ();
            component.update (component.getGraphics ());
            return component;
    Waiting for reply....
    Code snooker

    Hmm, why are you doing the curColor instanceof? What does this accomplish? I don't see any reason to ask what it was before; all you should be interested in here is what you want it to be now.
    All you should have to do is say:
    this.setForeground(model.getColor(row));I also don't see why you're doing the update() -- JTable is going to do that for you at the appropriate time, you have no idea if now is the right time to do it or not. In fact it probably isn't, you're probably updating the previously-drawn cell with your new color and alignment, which may be the strange behavior you're seeing.
    Also, I don't see why you're doing the super. All that's going to do is return "this", so why not just use "this"?
    Well, without knowing your larger code or exactly what you're trying to accomplish, maybe I'm just missing something.
    I've just recently been working on a program where I had some similar requirements -- different foreground and background colors and alignment -- and I found it much cleaner to create a class to hold all this data, and then create a default renderer for that class. Then I made some constructors for this "attribute" class that let me set whatever I need, like
    public CellAttrib(String s,Color c,int alignment,Border border)
      this.s=s;
      this.c=c;
      this.border=border;
    // with suitable defaults ...
    pubic CellAtrtrib(String s)
      this.s=s;
      this.c=Color.BLACK;
      this.border=null;
    }Then the renderer just queried the cell-attributes class, as in:
    setForeground(value.getColor());
    setHorizontalAlignment(value.getAlignment());
    setBorder(value.getBorder);

  • Not able to color different rows with different colors in a column of table

    Hi,
    I am trying to to display different rows with different colors in a column of the table based on some decode condition.
    I have gone through the following threads :
    Can we colour the rows in the column of a table
    Changing Color of a value in a column
    This is what i have done :
    1.Added the following code to custom.xss(changed the name to Custom.xss as suggested in one of the above threads) --- in path ---- jdev\myhtml\OA_HTML\cabo\styles
    <style selector=".1">
    <includeStyle name="DefaultFontFamily"/>
    <property name="font-size">11pt</property>
    <property name="font-weight">Bolder</property>
    <property name="color">#008000</property>
    <property name="text-indent">3px</property>
    </style>
    <style selector=".2">
    <includeStyle name="DefaultFontFamily"/>
    <property name="font-size">11pt</property>
    <property name="font-weight">Bolder</property>
    <property name="color">#FFFF00</property>
    <property name="text-indent">3px</property>
    </style>
    2. Sql query of the VO is :
    select comments,role ,decode(role,'REQUESTER','1','2') Colorattr from xxat_sars_action_history where request_id = :1 and event_name = :2 and action_code <> 'PENDING'
    order by sequence_num desc
    3. Coded the following in the process request of the controller:
    OATableBean table = (OATableBean)webBean.findIndexedChildRecursive("CommentsTB");
    OAMessageStyledTextBean roleBN = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("role");
    OADataBoundValueViewObject cssjob = new OADataBoundValueViewObject(roleBN,"Colorattr");
    roleBN.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR, cssjob);
    where 1 and 2 form the colors ( i have even tried with 'Red' and 'Yellow'...as it was not working replaced with 1 and 2)
    4.The query returns data fine with corresponding 1 and 2 values.
    But different colors are not getting reflecting on to the UI.
    I am testing this on my local jdev.
    Please do let me know if i am missing something.
    Thanks ,
    Sushma.

    Any Clues please.....
    Thanks,
    Sushma.

  • How can I share the home folder with different accounts on the same mac?

    Hi, here's a question:
    How can I share the home folder with different accounts on the same mac?
    The whole point being not to have to install all my apps, and move all my files each time between users.
    The second thing would be to be able to modify one document on one account, and have it changed on the other account without having to copy it.
    I would like to have a pro and a private account on my mac.
    Thanks for you answers,
    Doug

    Your apps should not be installed in your home folder--they should be in /Applications where every user can access them.
    If you want to share things between users on the same Mac, use the /Users/Shared folder. Keep your home folder private. Trying to defeat the protections on the home folder subfolders just gets messy. I've never bothered to figure out all of the problems associated with it so I can't explain how to do it.
    Even with using Shared, you would need to alter the ACLs on the shared folder in order to allow both users to modify the documents.
    You must create a Group in Users & Groups and put each user in that group. Then create a folder inside /Users/Shared where you want to share the various files.
    Then, add an ACL to the shared folder that gives the group special permissions. on that folder.
    sudo chmod -R +a "<sharinggroup> allow delete,chown,list,search,add_file,add_subdirectory,delete_child,file_inherit,directory_inherit" /Users/Shared/<sharing folder>
    Replace <sharinggroup> and <sharingfolder> with the name of your group and your folder. Then, run the command in the Terminal.
    With that ACL, each user in <sharinggroup> will be able to alter the files created by any user in the group in that <sharingfolder>.
    Essentially, the client OS is not designed for true file sharing among the individual users. It is designed to isolate each user account from the others.

  • How do I copy purchases between 2 itunes libraries on the same computer with different log ins and separate apple user ids?

    How do I copy purchases between 2 itunes libraries on the same computer with different log ins and separate apple user ids?

    Load the library which doesn't contain the songs and drag them into the open iTunes application window. If you need to move them between different computer user accounts, put them into /Users/Shared/.
    (74502)

  • Create 10 different TEXTFIELDS with a FOR statement

    Hello everybody, I,ve been trying to create 10 different
    TEXTFIELDS with a FOR statement, in order to apply different
    properties to each one. First I tried this code:

    Hi - your first one is closer; the problem is that you are
    only creating one TextField and merely changing the properties of
    the same one each time through the loop, and you are trying to add
    the same one 10 times to the stage.
    You probably want to do something closer to:

  • HT2905 I have multiple album titles of the same name with different artists. How can I get them to go under one album title again?

    I have multiple album titles of the same name with different artists. How can I get them to go under one album title again?

    In iTunes(on a Mac or PC) just tap on 'Albums' rather than 'Artists' and you'll see them all together.
    You may find that there are songs mislabelled. In which case right tap on the Album or Artist and tap 'Get Info', then change to the correct name and the songs will join the rest of the songs for that Artist or Album.
    Then resync with your iPhone and all will be well.

  • Why can't two different users use Itunes on the same computer with different log ins

    Why can't two different users use Itunes on the same computer with different log ins

    Pmorgan5672 wrote:
    Why can't two different users use Itunes on the same computer with different log ins
    They can, but not at the same time.
    If one user left iTunes running, and another user tries to use iTunes from a different Windows user ID, that second user will get an error message.  If they really want to use iTunes, they either have to beg the first user to log in and close iTunes, or else they have to restart the computer.
    If you are asking the technical reason why, it is something about context switching.

  • CAn I run Lion and snow leopard on the same computer with different sign-ins?

    CAn I run Lion and snow leopard on the same computer with different sign-ins?

    Alternatively, partition your internal HD and dual-boot it. Do note that you have to reboot to switch back and forth. You can't do it by logging out and back in.

  • Is it possible to have 2 icloud (from 2 different iphones with different apple ids) on the same computer?

    I am inquiring as to if you can 2 different icloud accounts (that come from 2 different iphones with different apple ids) on the same computer. I would like both iphones to be able to back up to the same computer since we have different accounts/pictures/mail etc.

    Yes, if you create 2 seperate user accounts.

  • Can you have 2 ipods on the same accounts with different play list?

    Can I have 2 ipods on the same accounts with different plalists?

    Sure.  Each iPod is identified in iTunes with its own name and you configure each one as you wish:

  • Use the same form with different button turned on in different calls

    Can I use the same form with different buttons turned on in different calls?
    Thanks!

    This is to avoid piracy. What could happen is, people could buy music, and give it away for free online. Usually it is then you buy a complete album off iTunes that it will only be available on one device. It is tied to that account, and the device must be registered to that account to listen to it.

  • HELP!! Authorization in the same laptop with different operation systems

    My BF installed Win 7 operation system on his laptop yesterday and re-authorized it when he used iTunes. However, when he finished authorization, a dialog block showing that "*Including this one, you have authorised two computers out of your available 5*" appeared; what's worse, when he connected his iPhone to the laptop, it deleted all the bought apps in the iPhone, instead of synchronizating.
    I also want to install Win 7 operation system, but I'm afraid that the same thing would happen again (to my iTouch).
    We're quite confused that why the authorization in the same laptop with different operation systems is counted as two times. Friends who know please tell us whether this is the case.. If not, please tell us how to deal with it as we frequently re-install operation system for quicker operation.
    Message was edited by: Shiwen
    Message was edited by: Shiwen

    It's the *operating system* that is authorised, not the particular user profile or the hardware. Before upgrading/reinstalling deauthorise and you won't run out...
    tt2

  • HT204053 i RECENTLY PURCHASED ANOTHER IPHONE.  MY INTERNET IS NOT WORKING.  I JUST CREATED AN APPLE ID.  WHAT'S NEXT?  I NOW HAVE TWO DIFFERENT ACCOUNTS WITH DIFFERENT USER NAMES.  HOW CAN I USE ONLY ONE ACCOUNT FOR ITUNES, ICLOUD APPLE ID ETC???

    I RECENTLY PURCHASED ANOTHER IPHONE.  MY INTERNET IS NOT WORKING.  I JUST CREATED AN APPLE ID.  WHAT'S NEXT?  I NOW HAVE TWO DIFFERENT ACCOUNTS WITH DIFFERENT USER NAMES.  HOW CAN I USE ONLY ONE ACCOUNT FOR ITUNES, ICLOUD APPLE ID ETC???

    Welcome to the Apple community.
    iTunes and iCloud and different accounts, you will need to delete both accounts from your device before adding the new details in their place.
    For iCloud go to settings > iCloud, scroll down and hit the delete button. You can then sign back in using your correct details. For iTunes go to settings >store, tap your account ID and then sign out, you can then sign back in using your correct Apple ID.

Maybe you are looking for

  • Change color of the showDetailItem in panelTabbed in 11G

    Dear All, I have to change the color of showDetailItem in panelTabbed from gray to dark blue. But when I am trying to set the color from style the color of whole panel gets changed. I want to change the color of of the tab only. Please help its Urgen

  • Archived Log files

    Hello, I have a understanding problem off the function of the archived log files. My Oracle 9i Database is running in ARCHIVELOG. So if the online log files are full they get backed up to 3 different locations. However if I view now the v$archive_log

  • USB 1.1 iPhone Problems

    *THE SITUATION* Well, when I first got my iPhone (about 2 weeks after it was released) I had tons of problems connecting my iPhone to my computer which only features 3 USB 1.1 ports, and no USB 2.0 ports. The phone wouldn't be recognized at all, and

  • To Jdev, Help Please...

    Env OS Nt SP 4 ORACLE 8.1.6.0 Jdev 3.2 Oracle 8.1.7 Jdbc java.sql.SQLException: ORA-01722: invalid number void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int) (DBError.java:168) int oracle.jdbc.oci8.OCIDBAccess

  • SQL Server 2008 reporting services reports just went blank even though I can still download excel pdf etc....

    I'm quite stumped.  All of my reports are suddenly blank. I see the icons for the reports, and I can even download the PDF by exporting to Excel of PDF. Can someone help explain what may have happened to my instance and how to correct this?