Problem of fillup with colored rectangles

The following is my canvas
<mx:Canvas id="b1" x="10" y="10" height="40" width="300" borderStyle="solid" borderColor="black"/>
To fill this canvas with rectangles i wrote the following code
               for(var i:int=b1.x;i<b1.x+b1.width;i=i+15)
                    var line1:UIComponent = new UIComponent();
                    var lineThickness1:Number = 1;
                    var lineColor1:Number = 0x000000;
                    var lineAlpha1:Number = 1;
                    line1.graphics.lineStyle(lineThickness1,lineColor1,lineAlpha1);
                    line1.graphics.moveTo(i,b1.y);
                    line1.graphics.drawRect(i,b1.y,15,b1.height);
                    this.addChild(line1);
its fine then
<mx:HBox x="40" y="450">
        <mx:Label text="Enter Units :" fontWeight="bold" fontSize="15"/>
        <mx:TextInput id="tiUnits" width="30" maxChars="1"/>
        <mx:Button id="btn" label="OK" click="btnCall(tiUnits.text);"/>
    </mx:HBox>
In btnCall()
entered input in tiUnits should be converted to integer and by considering that value i need to fill the rectangles(width-15) of canvas one by one with colour
eg: if input is 15 the first rectangle needs to fill with color and if i enter 30 then after first rectangle two rectangles each width 15 needs to fill
in this way i have fill the canvas one after another
please help me.......

Sample code to draw rectangle,
private function drawRectangle(event: MouseEvent): void {
     var unit: int = (Number(tiUnits.text) / 15);
     var colors: Array = [0x0000FF, 0x00FF00, 0xFF0000, 0xFF00FF, 0x00FFFF, 0xFFFF00]
     //Remove all rectangles from canvas
     b1.removeAllChildren();
     for(var i: int = 0; i < unit ; i++) {
          var lineThickness1: Number = 1;
          var lineColor1: Number = 0x000000;
          var lineAlpha1: Number = 1;
          //Random background color
          var bgColor: uint = colors[Math.floor(Math.random() * colors.length)];
          var line1: UIComponent = new UIComponent();
          line1.graphics.lineStyle(lineThickness1, lineColor1, lineAlpha1);
          line1.graphics.beginFill(bgColor, 1.0);
          line1.graphics.moveTo((i * 15), b1.y);
          line1.graphics.drawRect((i * 15) - 1, -1, 15, b1.height - 1);
          b1.addChild(line1);
<mx:Canvas id="b1" x="10" y="10" height="40" width="300" borderStyle="solid" borderColor="black"/>
<mx:HBox x="40" y="450">
     <mx:Label text="Enter Units :" fontWeight="bold" fontSize="15"/>
     <mx:TextInput id="tiUnits" width="30" />
     <mx:Button id="btn" label="OK" click="drawRectangle(event);"/>
</mx:HBox>     

Similar Messages

  • Rectangles with colors

    <mx:Canvas id="b1" x="10" y="10" height="40" width="300" borderStyle="solid" borderColor="black"/>
    to add rectangles side by side inside this canvas i wrote the following code
    for(var i:int=b1.x;i<b1.x+b1.width;i=i+15)
                        var line1:UIComponent = new UIComponent();
                        var lineThickness1:Number = 1;
                        var lineColor1:Number = 0x000000;
                        var lineAlpha1:Number = 1;
                        line1.graphics.lineStyle(lineThickness1,lineColor1,lineAlpha1);
                        line1.graphics.moveTo(i,b1.y);
                        line1.graphics.drawRect(i,b1.y,15,b1.height);
                        this.addChild(line1);
    now I want to fill those rectangles with colored rectangles starting to ending
    i pass the units then units*15 will be calculated and the covered rectangles will be populated with colored rectangles for that i wrote the following code
                             var c:UIComponent = new UIComponent();
                            var xposstr:String = arr1.getItemAt(arr1.length).toString();
                            var xpos:int = parseInt(xposstr);
                           c.graphics.beginFill(0xFFCC00,1);
                            c.graphics.drawRect(xpos,0,numUnits*15,b1.height-2);
                            c.graphics.endFill();
                            b1.addChild(c);
                            arr1.addItem(c.x+numUnits*15);
    arr1 is the ArrayCollection
    but iam not getting the required output

    This code draws rectangle (random background color),
    var colors: Array = [0x0000FF, 0x00FF00, 0xFF0000, 0xFF00FF]
    for(var i: int = 0; i < b1.width; i = i + 15) {
         var lineThickness1:Number = 1;
         var lineColor1:Number = 0x000000;
         var lineAlpha1:Number = 1;
         var bgColor: uint = colors[Math.floor(Math.random() * colors.length)];
         var g: Graphics = b1.graphics;
         g.lineStyle(lineThickness1,lineColor1,lineAlpha1);
         g.beginFill(bgColor, 1.0);
         g.moveTo(i, 0);
         g.drawRect(i, 0, 15, b1.height - 1);
         g.endFill();

  • With IOS 7.0 How do you change the Color Red, that shows up on the Calendar to another color? People with certain eye problems cannot tolerate the color Red.

    How do you change the Color Red, that shows up on various points of the Calendar to another color? Persons with certain eye problems have visual irritations that can be caused by the color Red. This problem came up with the update to IOS 7.0.

    Sorry but you cant

  • I have a problem with color prints from photoshop elements 12. The pictures are too light and with strange colors. I have a Canon pixma mg615I0 printer and use mac os X yosemite. The pictures are taken with a coanon eos 550d in the color space sRGB. I hav

    Hi
    I have a problem with color prints from photoshop elements 12. The pictures are too light and with strange colors. I have a Canon pixma mg615I0 printer and use mac os X yosemite. The pictures are taken with a coanon eos 550d in the color space sRGB. I have followed adobes recommendations and have tried both letting the printer respektive photoshop manage the colors. But nothing works. I see that there are different opinions about which is best to do so I tried both. I have the latest printer driver installed. Can anyone help me with this?

    Do the following:
    Print a test page from the printer. Perhaps the print head needs cleaning via its maintenance facility.
    Let the printer manage colors, not PSE
    Calibrate the monitor

  • Problems with colors running CS4 and W7.

    Hey everyone.
    I'm having some MASSIVE problems with colors on my system.
    Windows 7 Prof 64bit
    Photoshop CS4 64bit
    6g Ram
    1T hard drive
    Nvidia GeForce 9800 GTX+
    Dell SE198WFP Monitor 
    The system itself is a Dell Inspiron 530 that I put into a Black Widow V9 gaming tower. 
    Here is an example of the issue I'm having: 
    http://findae.deviantart.com/art/Converge-101214480
    http://i38.tinypic.com/bjcymr.jpg 
    The top image is a (admittedly old and crappy, but it shows the problem) photo that I had previously edited and put in my portfolio. The tinypic below is the result of copying that photo from the portfolio, pasting it into photoshop, and then saving it into a jpg. As you can see, the transitions between colors and the contrast are a complete mess. 
    Thing is, my hard drive recently quit on me, and I had to install the operating system and such on a new drive. I remember having this problem with the system when I first had it, but it either went away on its own or I fixed it somehow before. Now I can't remember for the life of me how I got rid of the problem, and I certainly don't know what the problem is in the first place. I'm tempted to think it may not be photoshop itself, but the problem seems to be especially bad when I'm working with photos. 
    Anyone have any idea what the problem might be and how to solve it? 
    Edit: I also noticed it when viewing http://findae.deviantart.com/gallery/#/d1hni37 in firefox, whereas the other photo appeared to be ok before I copied and pasted it. It has extremely obvious lines of green and orange in the transition from light skin tone to dark skin tone. Annoyingly enough, this doesn't show up in the thumbnail within my gallery at all, only when I click on the thumbnail and see the fullsize image. Extremely frustrating.  
    Here's another good look at the problem while selecting a color in photoshop: http://i37.tinypic.com/2h6t7gh.jpg  All I did was screenshot it a few times, and it deteriorated to that point.

    Screen glitches like color blocks appearing where they shouldn't could indicate a problem with your video drivers.
    Go to the nVidia site and see if they've released any updated drivers; people often report that updated drivers are correcting current problems with Photoshop.
    http://www.nvidia.com/object/win7-winvista-64bit-258.96-whql-driver.html
    Note the recent (3 weeks ago) release.
    -Noel

  • Problem with colors showing in PE10

    Is there a known problem with color in Elements 10?
    I have a gif that when opened in paint shows the light blue color correctly but in PSE10 shows as a buff color.
    Red, yellow and blue seem about right.
    It doesnt matter if it is the gif or the psd file the color showns the same in PSE10.
    Is there a setting or could something be corrupted.

    Bump.
    I have uninstalled and reinstalled Elements and get the same result.
    Is there a way to adjust the colors represented in Elements 10?

  • Adobe Photoshop CC, problem with color noise/pixelation on the monitor display

    After downloading Adobe Photoshop CC, my images come in with color noise/pixelation on the monitor display. I've tried checking the color space preferences, but this doesn't help. I didn't have this problem before. Is there anything else I can check? There's no problem with LR, just Photoshop.

    My performance settings are: Available RAM 10905 MB/using 7633 MG (70 percent); cache levels 4, history 20, cache tile size 1024K. However, I noticed under Graphics processer settings, it is set on Advanced Drawing Mode - perhaps this should be changed to Normal or Basic Mode? Your help is very much appreciated.

  • Strange problem with color measure in Mac.

    Hello, I am having a strange problem with color measure in Mac. For example i create a gradient in Photoshop from color 200 200 200 to color 240 240 240. When i measure the color of the gradient with the color measure tool of Photoshop or with the built in OS X color measure tool the measured color is from 200 199 197 to 240 240 238. I have measured the same gradient with Photoshop for PC and the values are OK (the same values that i create).
    I dont know what is the problem, but i belive that the colors that i create would be the same that i measure after creating them, and also the same values between Mac and PC. I will appreciate it a lot any help or information that you could give me that helps me to understand what is happening here.
    Thank you for your time
    Marcelo.

    Yep you got it, proof as monitor basicaly strips out any profiling and just delivers it straight.
    is there any way to make the OS X color measure tool to measure the original color values
    You mean the document colors - No, like I said photoshop is filtering your image through document profile, proof setup and monitor profile. Why do you want to use Digital color meter anyway for this?
    i dont understand what is the point to measure color values that will change every time a calibrate my monitor.
    Because color values are 'bigger' than whats on your monitor. Your monitor (via photoshop) is only doing the best it can to display those values - which can be anything from LAB colors outside the gamut of your monitor - to CMYK colors. Calibrating it is the only way to allow your monitor to do this in any way accurately. (not ever really possible) Monitors have a certain gamut and are only dispays/representations of the REAL colors that a document, with a profile, holds. So there's only one good reason to measure monitor values, and that's to generate a monitor profile.

  • Problem with color profile printing

    I have an Epson R280 and an Epson NX415 scanner/printer combo. When I print from Photoshop to the R280 it's very easy, I make sure that in the printer settings, under Color Management, ICM and "Off (no color adjustment)" are selected. According to some tutorials I've seen online, this is the way to ensure that the printer driver will not perform any further color conversion, and that the working profile will be the one selected under "Printer profile" in the Photoshop native dialog. In that list I have a few color profiles available for the R280, which I assume were installed in the system when I installed the driver for the R280. With these profiles, as long as I select the Epson R290 R280 profile, it prints very close to what I see on the screen.
    The problem is that replacing all six cartridges on the R280 is over $80, while replacing all four on the NX415 is about half, so I use this one for almost everything. The big problem I have with it is that the drivers didn't install any color profiles, so I cannot find the right profile to print to it. So far I've tried using the R280 profiles and some work better than others, but none of them gives me the right colors that I see on the photo inside Photoshop. One of them called "SPR280 290 Photo Qlty IJP" comes close, but it's not the same, I see that the hue is a little off, especially on yellowish areas.
    So my question is, how do I get profiles that are meant for the NX415, for each type of paper? I don't want to keep wasting ink and paper doing print tests.
    Thanks,
    Sebastian

    If it didn't install any profiles, it may just expect the data to be in one of the standard document profiles - e.g., sRGB.  Some printer drivers work this way.
    If you're unable to find an indication one way or another with a web search of what profile to use, I'd try sRGB and maybe Adobe RGB to see if they appear to match.
    There are devices you can buy to allow you to profile your own printer with your paper, etc., though I have not used one.
    http://www.youtube.com/watch?v=Wu0qUb4J5A4
    -Noel

  • Java update causes problems with color printing in Mac 10.5

    Had a big problem with color printing for the last two weeks. Thought the printer was broken because it would freeze and refuse to be "seen", or would generate error messages. Bought new Samsung 315, and had the SAME problem. Bought new HP CP1518ni, and had the SAME problem. Not resolved after talking to tech support at both places.
    Looked for software updates around the time of the onset of printing problems. on May 15 installed "Java for Mac OS X 10.5 update" (1.0) (am running on 10.5.8). Removed the Java preferences files (com.apple.java......plist) and restarted.
    Problem solved! Clearly not the printer.

    Hmmm. This is about the time my printer stopped printing too. I've now had two printers in my house and had trouble with both of them. What a pain we should not have to delete updates for our stuff to work together.
    Renee

  • Problem to print with HP Color LaserJet CP3525 (PCL 6) on Server

    Hi,
    I have a printer HP Color LaserJet CP3525 in a server, and I installed with the correct drivers for that but the printing output is strange. I'm trying to print in A4 paper, and everything is just printed in 1/4 of the page. The most strange is that the graphics are scaled to the 1/4 of the page while the text is exactly with the same size than the complete page, but all the letter are overlapping each other.
    I also tried to print with a generic configuration and print in all the page but I can't print with color, just the black toner is used, so the quality is really bad.
    Please, help me!

    This sounds like a driver issue. You mention the printer being PCL6. Can you confirm which driver you are using when the 1/4 page prints occur. My guess is that it would be one of the Gutenprint drivers included with SL and this sort of output can occur when the printer driver is not supported by the printer.
    Also, with regards to the Generic, which I assume is the Generic PCL Laser Printer driver included with SL, this by default is set to 300dpi. You can change this print quality setting to 600dpi, which will improve your output, especially the graphics. However this driver only supports black & white printing. So if you want to print in color from the Mac and the printer does not support PostScript, then you should look at installing the pxlmono package.
    http://www.linuxfoundation.org/collaborate/workgroups/openprinting/macosx/pxlmon o
    Note that you will need the pxlmono, Foomatic and Ghostscript packages to use this driver suite.

  • Problem with colors in maps

    I have a map of Europe, displaying data for different countries. I use alerts to color code countries depending on their results - from light blue to dark blue. It works fine.
    Then I make the map selectable, so that I can select one country at a time and display its details on a different chart. However, when I hover over the country, it's color changes, and when I finally select it I get a different colour (green for example). I don't want the colours to change though, I want them to remain as defined by alerts.
    I think it is mixing alert colours with colors set in Appearance/Tab, even when I changed those colours to white I am still getting differences in colours on selection.
    How can I stop this from happening?

    Thank you guys!
    However, unless I have a bug in my version of Dashboards, they don't behave quite as you have described.
    My alerts are shades of blue. The rest of the map is white.
    I have set the other colours in Appearance/Tab in such a way that when I hover over or select a map item it should be black, when I select it it should be black.
    However, what the dashboard does is the following: I hover over Spain, which is originally dark blue - the Dashboard changes is to... green (not black), and when I select Spain, the colour changes to dark green (not black).
    Lighter shades of blue change to yellow, or red, anything BUT the black that I have specified.
    I understand that I can't switch this functionality off completely, but I would like to make the colour black, at least, on selection.
    Black works fine ONLY if I don't use blue alerts.

  • WebView weird rendering issue (Color rectangles) - Debug Mode

    Hi,
    i got a problem with a JavaFX Webview.
    Everything loads fine, but every single Element in the DOM of the page (including the body) is overlayed with a random colored rectangle when hovered.
    After a few seconds the entire page is renders unreadable and is only a freaky mix of colors.
    It does work without problems in the JavaFX Ensemble Example so i think it can't be a javafx probleme but i am doing something wrong somewhere else in my application.
    The initialisation code is the same as in the example:
    webview = new WebView();
    previewStage.getChildren().add(webview);
    final WebEngine webEngine = webview.getEngine();
    webEngine.load("http://www.google.de");
    Thought it might be an stylesheet issue, but i removed all stylesheets and it still looks the same.
    I attached some pictures how it looks.
    http://www.tinyuploads.com/images/31lf1b.png
    http://www.tinyuploads.com/images/UxK8wZ.png
    I appreciate any help.
    Thank you!

    THANK YOU VERY MUCH.
    This solved my problem and it was driving me crazy. :-)
    For Future reference:
    WebView enters a debug mode when logging is set to a level higher than FINEST.
    You can change it for the particular class using these lines:
    Logger logger = Logger.getLogger( WCGraphicsPrismContext.class.getName() );
    logger.setLevel( Level.OFF );

  • Problem using JTextPane with large styled docs

    I have an environment where we need to parse out large (5MB) log files, and I'm displaying them with colorized attributes such as logging level, timestamp, etc. The files are read in once and never changed, only displayed - the text is not editable, so we don't care about future updates to the doc (only highlighting text for find/copy). However we do need the entire document 'available' after load in order to do string searches and certain operations linked to the entry a piece of text is in.
    Parsing and building the styled document are relatively fast operations (a couple seconds), but when I set the document on the JTextPanel (which is inside a JScrollBar), it can take an enormous amount of time to display, and sometimes eats up every resource on the machine, eventually stoping dead without displaying at all (out of memory maybe?).
    I've read similar posts on the forum, but no one has provided a clear-cut solution to this problem. Is there a simple way to make my document display quickly? Alternatively, is there another way to implement this without using JTextPane?
    Any help is much appreciated.
    Thanks,
    lex

    In the past I tried to optimize ParagraphView and SectionView of the kit. Don't know whether it will help in your case. Hope so.
    import javax.swing.text.*;
    import java.awt.Rectangle;
    import javax.swing.SizeRequirements;
    import java.awt.Shape;
    public class OptimizedParagraphView extends ParagraphView {
        public OptimizedParagraphView(Element elem) {
            super(elem);
        protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
            //optimized
            int preferred = 0;
            int n = getViewCount();
            for (int i = 0; i < n; i++) {
                View v = getView(i);
                spans[i] = (int) v.getPreferredSpan(axis);
                offsets=preferred;
    preferred += spans[i];
    protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
    //optimized
    int n = getViewCount();
    for (int i = 0; i < n; i++) {
    View v = getView(i);
    int min = (int) v.getMinimumSpan(axis);
    offsets[i] = 0;
    spans[i] = Math.max(min, targetSpan);
    public int getResizeWeight(int axis) {
    //optimized
    return 0;
    public float getAlignment(int axis) {
    //opimized
    return 0;
    protected View createRow() {
    //optimized
    return new OptimizedRow(getElement());
    class OptimizedRow extends BoxView {
    SizeRequirements mimorRequirements;
    OptimizedRow(Element elem) {
    super(elem, View.X_AXIS);
    protected void loadChildren(ViewFactory f) {
    public AttributeSet getAttributes() {
    View p = getParent();
    return (p != null) ? p.getAttributes() : getElement().getAttributes();
    public float getAlignment(int axis) {
    if (axis == View.X_AXIS) {
    switch (StyleConstants.getAlignment(getAttributes())) {
    case StyleConstants.ALIGN_LEFT:
    return 0;
    case StyleConstants.ALIGN_RIGHT:
    return 1;
    case StyleConstants.ALIGN_CENTER:
    case StyleConstants.ALIGN_JUSTIFIED:
    return 0.5f;
    return 0;
    public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException {
    Rectangle r = a.getBounds();
    View v = getViewAtPosition(pos, r);
    if ((v != null) && (!v.getElement().isLeaf())) {
    // Don't adjust the height if the view represents a branch.
    return super.modelToView(pos, a, b);
    r = a.getBounds();
    int height = r.height;
    int y = r.y;
    Shape loc = super.modelToView(pos, a, b);
    r = loc.getBounds();
    r.height = height;
    r.y = y;
    return r;
    public int getStartOffset() {
    int offs = Integer.MAX_VALUE;
    int n = getViewCount();
    for (int i = 0; i < n; i++) {
    View v = getView(i);
    offs = Math.min(offs, v.getStartOffset());
    return offs;
    public int getEndOffset() {
    int offs = 0;
    int n = getViewCount();
    for (int i = 0; i < n; i++) {
    View v = getView(i);
    offs = Math.max(offs, v.getEndOffset());
    return offs;
    protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
    baselineLayout(targetSpan, axis, offsets, spans);
    protected SizeRequirements calculateMinorAxisRequirements(int axis,
    SizeRequirements r) {
    mimorRequirements= baselineRequirements(axis, r);
    return mimorRequirements;
    protected SizeRequirements baselineRequirements(int axis, SizeRequirements r) {
    if (r == null) {
    r = new SizeRequirements();
    int n = getViewCount();
    // loop through all children calculating the max of all their ascents and
    // descents at minimum, preferred, and maximum sizes
    int span=0;
    for (int i = 0; i < n; i++) {
    View v = getView(i);
    // find the maximum of the preferred ascents and descents
    span = Math.max((int)v.getPreferredSpan(axis),span);
    r.preferred = span;
    r.maximum=span;
    r.minimum=span;
    return r;
    protected int getViewIndexAtPosition(int pos) {
    // This is expensive, but are views are not necessarily layed
    // out in model order.
    if(pos < getStartOffset() || pos >= getEndOffset())
    return -1;
    for(int counter = getViewCount() - 1; counter >= 0; counter--) {
    View v = getView(counter);
    if(pos >= v.getStartOffset() &&
    pos < v.getEndOffset()) {
    return counter;
    return -1;
    protected short getLeftInset() {
    View parentView;
    int adjustment = 0;
    if ((parentView = getParent()) != null) { //use firstLineIdent for the first row
    if (this == parentView.getView(0)) {
    adjustment = firstLineIndent;
    return (short)(super.getLeftInset() + adjustment);
    protected short getBottomInset() {
    float lineSpacing=StyleConstants.getLineSpacing(getAttributes());
    return (short)(super.getBottomInset() + mimorRequirements.preferred * lineSpacing);
    protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
    //optimized
    int preferred = 0;
    int n = getViewCount();
    for (int i = 0; i < n; i++) {
    View v = getView(i);
    spans[i] = (int) v.getPreferredSpan(axis);
    offsets[i]=preferred;
    preferred += spans[i];
    public int getResizeWeight(int axis) {
    //optimized
    return 0;
    import javax.swing.text.*;
    public class OptimizedSectionView extends BoxView {
    public OptimizedSectionView(Element elem) {
    super(elem,View.Y_AXIS);
    protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
    //optimized
    int preferred = 0;
    int n = getViewCount();
    for (int i = 0; i < n; i++) {
    View v = getView(i);
    spans[i] = (int) v.getPreferredSpan(axis);
    offsets[i]=preferred;
    preferred += spans[i];
    public int getResizeWeight(int axis) {
    //optimized
    return 0;
    public float getAlignment(int axis) {
    //opimized
    return 0;
    class MyViewFactory implements ViewFactory {
    * Creates view for specified element.
    * @param elem Element parent element
    * @return View created view instance.
    public View create(Element elem) {
    String kind = elem.getName();
    if (kind != null) {
    if (kind.equals(AbstractDocument.ContentElementName)) {
    return new LabelView(elem);
    else if (kind.equals(AbstractDocument.ParagraphElementName)) {
    return new OptimizedParagraphView(elem);
    // return new ParagraphView(elem);
    else if (kind.equals(AbstractDocument.SectionElementName)) {
    return new OptimizedSectionView(elem);
    // return new BoxView(elem, View.Y_AXIS);
    else if (kind.equals(StyleConstants.ComponentElementName)) {
    return new ComponentView(elem);
    else if (kind.equals(StyleConstants.IconElementName)) {
    return new IconView(elem);
    // default to text display
    return new LabelView(elem);
    regards,
    Stas

  • Photoshop: Making a text box with color or border.

    How do you fill a text box in Photoshop?
    Answer: You CAN’T.
    Solution:  You CAN do anything you want in Photoshop -we know it’s GREAT - but the steps are not always so easy.  See below for solutions to making it seem that the text box is filled with color, bordered, semi-tansparent etc.
    In Photoshop, a text box is mostly about the text inside and less about the box that surrounds it.  In other words, the box is always transparent and all effects apply to the font shapes typed inside by the user.  Photoshop (CS4) can produce incredible, professional, amazing text images. No Doubt About It!
    A Photoshop text box can display one of two types of bounding boxes: 
    Its OBJECT bounding box is there for moving the whole text layer, rotating it, duplicating it and distorting.  Clicking once on the text layer pallet and selecting the move tool (v) will produce this bounding box.  The direct selection tool (a) won’t recognize it.  Note:  If you try to resize the box as an object, it also distorts/stretches the text inside.  This can make cool effects but usually you want the text to stay the way the font was designed.  See: Layers>Type>Warp Text.
    The TEXT bounding box is there for highlighting, re-typing and selecting the margins of the actual text/paragraph etc.  Selecting the text tool and clicking over existing text will produce this bounding box.
    Some features are accessible in either mode.
    The Photoshop text tool has two types of cursors:
    The NEW text box cursor looks like a text insertion cursor (often seen in word processing) WITH a dotted box around it.
    To produce the new text box cursor just select the text tool and move over to a new work area.
    The EDIT text cursor looks very much like the ordinary cursor people are familiar with (no dotted box). 
    To produce the edit text tool, hover the text tool over EXISTING text and the cursor changes to the simple insertion shape (without the dotted box).  A click now will put you into text editing mode, not new text box mode.  This drove me batty for a while because I was used to clicking anywhere inside an existing text box and the blinking cursor would pop in automatically - usually at the end of the last letter.  This doesn’t happen in Photoshop; if that NEW text box tool is active, it will try to place a new box anywhere you click sometimes overlapping another.
    When in this mode (edit existing text) you can carefully hover the arrow to the edges of the text box and resize the bounding box without altering the shape of the text itself.  This is how you make the text box larger or smaller to fit/accommodate your needs.  You can also highlight text, insert between words/letters.  Highlighted text is available for changing its font, color, size, cutting/pasting etc. 
    To get OUT of the EDIT text mode, click the check box on the tool column above or type enter (not return) or type cmd-return (MAC), ctrl-return (WIN).  If you want to cancel any changes to an existing text box click the ex-circle on the tool column or press the esc key (top left of keyboard-escape key)
    OK, THE MAIN POINT:
    To make an effect that looks like a text box that is filled, bordered, semi-transparent etc., you will have to create an object shape (box) and place it just behind (under) the text box.  Linking the two allows you to move them around easily.  The drawback is that, when you need a larger box, you’ll have to alter the size of both boxes and possibly re-center them to each other (I know it’s sort of dumb to have so many steps just to get a shaded text box or bordered one.)
    Begin by selecting the Rectangle shape tool and draw a shape on the screen of any size.  In the layers pallet a layer is created with two items (layer thumbnail and vector mask) Double click the one on the left the layer thumbnail).  Change its color to a light one such as baby blue or yellow.
    Now select the text tool and click once over that shape.  A text box is created exactly the same size of the rectangle (any shape will work too).
    Type some text into that box and change the font type, size and color to something you might use regularly.  Check to see that the text color is black (can be changed later).  The text automatically wraps around when you reach the edge of this box and fits well (inside margins can be altered by pixel later).
    Now link the two boxes to one another.  Shift-click each layer in the layers pallet to select both and choose the link button at the bottom of the window for layers or go to Layers>Link Layers.  Now when you move one it will move the other too!
    Using the paragraph tools you can center text, indent first line, and add space between paragraphs.  Except the first paragraph seems too close to the top of the colored rectangle; doesn’t it?  Photoshop won’t add extra leading (horizontal space) between the text box and the top of the first paragraph.
    There are two ways to fix this:
    1.     Select the text tool and click inside the existing text then hover the pointer just above the little box/tab in the top center of that rectangle and bring it down just a bit.
    2.     Or you could unlink the two layers (to unlink just click link again while one of the two layers is selected in pallet) and move the colored rectangle up just a bit.
    In the first instance it was not necessary to unlink the boxes.  This is the advantage because altering the colored rectangle without unlinking will distort your text as will altering the text box if you are not in object text mode (see intro.)
    Ok, some advantages:
    Now that you have this set up you can use the background box (colored rectangle) to make other effects.  Select it as a separate layer but you won’t have to unlink it.  To make the box semi-transparent change either the layer OPACITY or the layer FILL (found in the layer pallet).
    To create a border box:
    1.     Select the colored rectangle box and under Layers>Styles>Blending Options (or just double click in an open area of the layer pallet for that shape.)
    2.     Select Stroke, change:  Fill Type color, Color black, Size 4, Position inside, Blend Mode normal, Opacity 100%. Click OK/Apply
    3.     Back in the layer pallet, change the Fill to 0% and you will just have a border with attached text box.  You may have to alter the inside text box again depending on the thickness of that border especially if you made the Position to be inside to keep the sharpness of the rectangle.
    4.     Yes this will work with other shapes and even custom shapes.  Remember to draw the shape first and immediately place a new text box over it BEFORE any other alteration is done.  This ensures that Photoshop creates a text box exactly the same size/dimension of your chosen shape.  It even makes margins fit irregular shapes like triangles.
    5.     Try it!

    Toxic Cumquat wrote:
    How do you fill a text box in Photoshop?
    Answer: You CAN’T.
    Solution:  You CAN do anything you want in Photoshop -we know it’s GREAT - but the steps are not always so easy.  See below for solutions to making it seem that the text box is filled with color, bordered, semi-tansparent etc.
    In Photoshop, a text box is mostly about the text inside and less about the box that surrounds it.  In other words, the box is always transparent and all effects apply to the font shapes typed inside by the user.  Photoshop (CS4) can produce incredible, professional, amazing text images. No Doubt About It!
    A Photoshop text box can display one of two types of bounding boxes: 
    Its OBJECT bounding box is there for moving the whole text layer, rotating it, duplicating it and distorting.  Clicking once on the text layer pallet and selecting the move tool (v) will produce this bounding box.  The direct selection tool (a) won’t recognize it.  Note:  If you try to resize the box as an object, it also distorts/stretches the text inside.  This can make cool effects but usually you want the text to stay the way the font was designed.  See: Layers>Type>Warp Text.
    The TEXT bounding box is there for highlighting, re-typing and selecting the margins of the actual text/paragraph etc.  Selecting the text tool and clicking over existing text will produce this bounding box.
    Some features are accessible in either mode.
    The Photoshop text tool has two types of cursors:
    The NEW text box cursor looks like a text insertion cursor (often seen in word processing) WITH a dotted box around it.
    To produce the new text box cursor just select the text tool and move over to a new work area.
    The EDIT text cursor looks very much like the ordinary cursor people are familiar with (no dotted box). 
    To produce the edit text tool, hover the text tool over EXISTING text and the cursor changes to the simple insertion shape (without the dotted box).  A click now will put you into text editing mode, not new text box mode.  This drove me batty for a while because I was used to clicking anywhere inside an existing text box and the blinking cursor would pop in automatically - usually at the end of the last letter.  This doesn’t happen in Photoshop; if that NEW text box tool is active, it will try to place a new box anywhere you click sometimes overlapping another.
    When in this mode (edit existing text) you can carefully hover the arrow to the edges of the text box and resize the bounding box without altering the shape of the text itself.  This is how you make the text box larger or smaller to fit/accommodate your needs.  You can also highlight text, insert between words/letters.  Highlighted text is available for changing its font, color, size, cutting/pasting etc. 
    To get OUT of the EDIT text mode, click the check box on the tool column above or type enter (not return) or type cmd-return (MAC), ctrl-return (WIN).  If you want to cancel any changes to an existing text box click the ex-circle on the tool column or press the esc key (top left of keyboard-escape key)
    OK, THE MAIN POINT:
    To make an effect that looks like a text box that is filled, bordered, semi-transparent etc., you will have to create an object shape (box) and place it just behind (under) the text box.  Linking the two allows you to move them around easily.  The drawback is that, when you need a larger box, you’ll have to alter the size of both boxes and possibly re-center them to each other (I know it’s sort of dumb to have so many steps just to get a shaded text box or bordered one.)
    Begin by selecting the Rectangle shape tool and draw a shape on the screen of any size.  In the layers pallet a layer is created with two items (layer thumbnail and vector mask) Double click the one on the left the layer thumbnail).  Change its color to a light one such as baby blue or yellow.
    Now select the text tool and click once over that shape.  A text box is created exactly the same size of the rectangle (any shape will work too).
    Type some text into that box and change the font type, size and color to something you might use regularly.  Check to see that the text color is black (can be changed later).  The text automatically wraps around when you reach the edge of this box and fits well (inside margins can be altered by pixel later).
    Now link the two boxes to one another.  Shift-click each layer in the layers pallet to select both and choose the link button at the bottom of the window for layers or go to Layers>Link Layers.  Now when you move one it will move the other too!
    Using the paragraph tools you can center text, indent first line, and add space between paragraphs.  Except the first paragraph seems too close to the top of the colored rectangle; doesn’t it?  Photoshop won’t add extra leading (horizontal space) between the text box and the top of the first paragraph.
    There are two ways to fix this:
    1.     Select the text tool and click inside the existing text then hover the pointer just above the little box/tab in the top center of that rectangle and bring it down just a bit.
    2.     Or you could unlink the two layers (to unlink just click link again while one of the two layers is selected in pallet) and move the colored rectangle up just a bit.
    In the first instance it was not necessary to unlink the boxes.  This is the advantage because altering the colored rectangle without unlinking will distort your text as will altering the text box if you are not in object text mode (see intro.)
    Ok, some advantages:
    Now that you have this set up you can use the background box (colored rectangle) to make other effects.  Select it as a separate layer but you won’t have to unlink it.  To make the box semi-transparent change either the layer OPACITY or the layer FILL (found in the layer pallet).
    To create a border box:
    1.     Select the colored rectangle box and under Layers>Styles>Blending Options (or just double click in an open area of the layer pallet for that shape.)
    2.     Select Stroke, change:  Fill Type color, Color black, Size 4, Position inside, Blend Mode normal, Opacity 100%. Click OK/Apply
    3.     Back in the layer pallet, change the Fill to 0% and you will just have a border with attached text box.  You may have to alter the inside text box again depending on the thickness of that border especially if you made the Position to be inside to keep the sharpness of the rectangle.
    4.     Yes this will work with other shapes and even custom shapes.  Remember to draw the shape first and immediately place a new text box over it BEFORE any other alteration is done.  This ensures that Photoshop creates a text box exactly the same size/dimension of your chosen shape.  It even makes margins fit irregular shapes like triangles.
    5.     Try it! Or try using Indesign!
    There. I fixed that for you.

Maybe you are looking for