Simple java2D concept question

Dear all,
I am trying to write a chess game, but I am new to java2d. I really need some help on the java2d concept. Here is what I plan
1. A Main Class
2. A Chessboard Class
3. A Chess Class
I need to create a chessboard at the begin of the game, then add chess during the game
I don't think the following is right, but have no other idea to do in other way
1st --- use the main class to contain the chessboard and chess objects
2nd --- use JFrame in the chessboard class to contain the chessboard (then paint it in the chessboard class), use JFrame in the chess class to contain the chess image (then paint the chess in the chess class)
3rd --- set the location and the visibility of the chess on the chessboard in the main class
Do I have concept correct?
If so, how to put the chess image on the chessboard?

marco_wu wrote:
Dear all,
I am trying to write a chess game, but I am new to java2d. I really need some help on the java2d concept. Here is what I plan
1. A Main Class
2. A Chessboard Class
3. A Chess Class
1st --- use the main class to contain the chessboard and chess objectsWhat does this mean? If you mean to hold a reference to these then yes, that may be appropriate.
2nd --- use JFrame in the chessboard class to contain the chessboard (then paint it in the chessboard class), use JFrame in the chess class to contain the chess image (then paint the chess in the chess class)
No, do not display directly to a JFrame: use a JPanel.
3rd --- set the location and the visibility of the chess on the chessboard in the main classNo, do not think of your "Main Class" as the do it all area: make this a control area and provide the appropriate steps to get the game setup, but be sure to give an "initialize entity" to allow a new game to start without running through the "Main" again.
You need to have board Tiles--which make up the 2D array of your game board. Each Tile needs to be able to contain a reference to a chess piece. Each piece needs to be a Chess Piece Class. Each piece needs to have it's movements defined there in.
When you initialize you will need to have the board, an array of white chess pieces, and array of black chess pieces.
Remember games like this are basically animations upon request, so plan for that, you need to looking in to SWING graphics using the javax.swing.Timer for animation.

Similar Messages

  • Concept Question about EDI and Error Processing

    Hello All,
    This is a concept question, I was wondering how others would approach this scenario.
    Let's take this scenario. In EDI often the transmission for a purchase order comes in with an invalid material number. Normal error processing is for the EDI team to research the issue (find the correct matnr), edit the idoc and reprocess the Idoc.  I would like to move that type of error processing out of the hands of the EDI folks and into the hands of the business users.
    How would they correct the material number? It has to be more intuitive than editing an IDoc, it has to be an easy and intuitive user interface. This process has to also work for many types of EDI transmissions both inbound and outbound.
    There would be many ways to handle this: create a report with an editable grid that would change the idoc during input and create the order with the corrections, convert the idoc to xml and use simple transformations, use an xsl report...etc.  You get the point. 
    How would you approach this?  Before I start the design I want to make sure I've given all the options due consideration...all options, webdynpro, transformations, regex, you name it...all is available, except there is no XI. 
    Personally I'm leaning towards an editable grid and processing buttons that would post the idoc in background...but I do that type of thing all the time and I may be in a rut and neglecting better design options.
    Thanks for your input,
    Greg

    <b>Paul:</b> So it runs the transaction silently in BDC format, until the error occurs, then opens up in dialogue to allow the user to change the invalid material, and then continue on with processing.
    This works when the processing function module uses BDC. But even then I think this is possibly nice from user perspective, but a nightmare from auditing perspective. I.e. correct me if I'm wrong, but I'm pretty sure there's no log indicating that the user changed the material number. Thus for anybody comparing the IDoc contents against the posted document (including change history) there's no trail that shows this change. Of course you can assume that this is what must have happened, but I personally prefer if I can track in the system what happened and have proof for that.
    <b>Reddy:</b>
    <ol>
    <li>it can be run daily basis, which should select all idocs which are in status 51 with message number (..related to wrong material number). report output should inlcude :idoc number-wrong mat no- space for new material to be entered by business against wrong 1. And there should be one button for RUN.</li>
    <li>After RUN, the material number should be changed to new 1 in segments and idocs should be reprocessed.</li>
    <li>repeat the run until business enter right mat num.</li>
    </ol>
    Design seems to limited to me (takes care only of one error message). Might work if that's the main pain point and this is the only one the user is dealing with. Otherwise I'd expect pretty soon they start complaining about having to use different tools for the possible errors. I'd keep the report more general, but allow this special form of processing only for a given error message (otherwise it's a normal re-process as triggered for example via BD87).
    Also, I assume that when you talk of changing the IDoc you mean that you actually keep an original copy around (like SAP does when you edit an IDoc). Often this is required from an auditing perspective. I'm not sure why you wouldn't want to check the material number <em>before</em> trying to process the IDoc to avoid wasting system resources (but maybe I misunderstood the step).
    Anyhow, in theory you could also achieve all of this via workflow. You can add custom columns to the work item overview in the inbox, only issue here is that it doesn't scale well (so issues with larger volumes).

  • Java Usage Concept Questions

    I have a java Command line running program. Which allow input/edit data of clients and store them into a Flat file. The problem is that i have to make a GUI, ( a thin web based client ) and using only HTML and Javascript.
    The next step is the db should be frontended by servlet or JSP that interact with thin client to perform the database retrievals.
    Now my concept Questions:
    1. Is it possible to communicate to a Java Program using HTML and Javascript? If so, any exampler, pointers?
    2. I was thinking of using HTML and Javascript to directly modify the Database. ( Since it is a flat file therefore nothing more than a txt file ) But isn't this side stepping the problem?
    3. If i could modify the Flat file using HTML and Javascript only. Why would i need JSP and Servlets? And if i could do it with JSP and Servlets only why would i need the think client ( HTML bit )?
    If all of above 3 are correct ( conceptialy ), what is the orginal command line java program for?
    The last question is why i think i have the concept wrong. Please i am new to web programming so feel free to point out any error.

    Hello,
    You a little off on a few things. let me explain what each is used for to give you a better idea what each i used for.
    HTML - Used to format data. Is static and can't do any File I/O and such
    Javascript - Is usaually used for client side validation and some cool effects.
    JSP - Is a scripting language that allows you to execute code on the server to create dynamic content and server side stuff like saving to a DB or a file
    Servlets - Kinda like JSP but gives you more control over a few things. Usaually used for form processing and Servlet/Applet communication
    for you application i would probably embed HTML/JavaScript for layout and validation into a JSP page for your display pages.. then build JSP pages to handle all you business logic and processing.
    --Zer0C00L                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Simple X-fi Question, Please Help

    !Simple X-fi Question, Please HelpL I've been looking for an external sound card that is similar to the 2002 Creative Extigy and think I may found it in the Creative X-Fi. I have some questions about the X-fi though. Can the X-fi:
    1. Input sound from an optical port
    2. Output that sound to 5. surround- Front, surround, center/sub
    3. Is the X-Fi stand-alone, external, and powered by a USB or a wall outlet (you do not need a computer hooked up to it)
    Basically I want to connect a TosLink optical cable from my Xbox to the X-Fi. That will deli'ver the sound to the X-Fi. Then I want that sound to go to a 5. headset that is connected to the X-fi via 5. front, surround, and center/sub wires. The X-Fi has to be stand-alone and cannot be connected to a PC to do this.
    Thank you for your help.

    The connector must match, and the connector polarity (plus and minus voltage) must match.  Sorry, I don't know if the positive voltage goes on the inside of the connector or the outside.    Any wattage of 12 or more should be adequate.
    Message Edited by toomanydonuts on 01-10-2008 01:29 AM

  • Simple Crop tool question... how do I save the crop section?

    Hi,
    I have a very simple crop tool question. I'm a photoshop girl usually... so Illustrator is new to me. When I select the crop section I want... how do I save it?... if I select another tool in the tool panel, the crop section disappears and I can't get it back when I re-select Crop tool. If I select Save as... it saves the whole document...and not just my crop section.
    Like I said, simple question...but I just don't know the secret to the Illustrator crop tool.
    Thanks!
    Yzza

    Either press the Tab key or F key.

  • A Simpler, More Direct Question About Merge Joins

    This thread is related to Merge Joins Should Be Faster and Merge Join but asks a simpler, more direct question:
    Why does merge sort join choose to sort data that is already sorted? Here are some Explain query plans to illustrate my point.
    SQL> EXPLAIN PLAN FOR
      2  SELECT * FROM spoTriples ORDER BY s;
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT |              |   998K|    35M|  5311   (1)| 00:01:04|
    |   1 |  INDEX FULL SCAN | PKSPOTRIPLES |   998K|    35M|  5311   (1)| 00:01:04|
    ---------------------------------------------------------------------------------Notice that the plan does not involve a SORT operation. This is because spoTriples is an Index-Organized Table on the primary key index of (s,p,o), which contains all of the columns in the table. This means the table is already sorted on s, which is the column in the ORDER BY clause. The optimizer is taking advantage of the fact that the table is already sorted, which it should.
    Now look at this plan:
    SQL> EXPLAIN PLAN FOR
      2  SELECT /*+ USE_MERGE(t1 t2) */ t1.s, t2.s
      3  FROM spoTriples t1, spoTriples t2
      4  WHERE t1.s = t2.s;
    Explained.
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT       |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   1 |  MERGE JOIN            |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   2 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   3 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    |*  4 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   5 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    Predicate Information (identified by operation id):
       4 - access("T1"."S"="T2"."S")
           filter("T1"."S"="T2"."S")I'm doing a self join on the column by which the table is sorted. I'm using a hint to force a merge join, but despite the data already being sorted, the optimizer insists on sorting each instance of spoTriples before doing the merge join. The sort should be unnecessary for the same reason that it is unnecessary in the case with the ORDER BY above.
    Is there anyway to make Oracle be aware of and take advantage of the fact that it doesn't have to sort this data before merge joining it?

    Licensing questions are best addressed by visiting the Oracle store, or contacting a salesrep in your area
    But I doubt you can redistribute the product if you aren't licensed yourself.
    Question 3 and 4 have obvious answers
    3: Even if you could this is illegal
    4: if tnsping is not included in the client, tnsping is not included in the client, and there will be no replacement.
    Tnsping only establishes whether a listener is running and shouldn't be called from an application
    Sybrand Bakker
    Senior Oracle DBA

  • Simple Method/Object Concept Question

    I really appreciate everyone's help! Thanks you. I know that for action to take place in Java objects, blocks of code called methods are used. Methods tell an application what to do when buttons are clicked, menus are opened, and text is typed. Methods are either predefined or are created from scratch to manipulate objects, or the data within those objects, but what does the data type identifier that is attached to java methods mean? What is the data type identifier?
    Also, what are the major components of an object? I know objects are based on classes that detail how the object is defined and how it behaves. It is starting to click, but I need more explanation. Thanks a lot
    Stephen

    The datatype of the method represents the datatype of the value returned or void if nothing is retured. Consider the following: int getAge() In this case, the method getAge() will return a value that is an integer. If the method does not return a value, void is used as in the following line:void setAge(int age)As far as the "major parts of an object", well there can be many answers to that. One answer comes from the simple definition of an Object, i.e., "data surrounded by code". In other words, an object is a person, place or thing (or process). The object has sate (data about itself) and it has behavior (code or methods). In that respect, the major parts of an object, in it's simplest form, are it's state (member variables) and it's behavior (member functions/methods).
    Hope this helps.

  • Simple Java SDK question for server group assignment

    I have a snippet of code below in which I am trying to apply the setProcessingServerGroup() and setProcessingServerGroupChoice() methods to my report object. My question should be relatively simple: I believe I need to cast(?) my iObject report object to iProcessingServerGroupInfo per the API in order to use the setProcessingServerGroup() and setProcessingServerGroupChoice() methods, but I'm not sure how to do so.
    Can someone please advise how to cast my iObject to iProcessingServerGroupInfo?
    Thanks in advance...
    Code:
    IInfoObject iObject = (IInfoObject) childReports.get(i); 
    int sgID_view = Integer.parseInt(serverGroupID_view);
    int sgPref_view = Integer.parseInt(serverGroupPref_view);
    !!!!!  CONVERSION / CAST NEEDED HERE !!!!!
    iProcessingServerGroupInfo.setProcessingServerGroup(sgID_view);
    iProcessingServerGroupInfo.setProcessingServerGroupChoice(sgPref_view);

    To followup, I've been able to cast to IShedulingInfo in order to use the setServerGroup() and setServerGroupChoice() methods successfully:
    IInfoObject iObject = (IInfoObject) iObjects.get(i);    
    ISchedulingInfo iSchedulingInfo = iObject.getSchedulingInfo();
    iSchedulingInfo.setServerGroup(427);
    iSchedulingInfo.setServerGroupChoice(2);
    But I don't know how to perform the cast to be able to access the setProcessingServerGroup(), sterProcessingServerGroupChoice() methods.
    Any help appreciated.
    Thanks!

  • Simple java architecture question

    This should be a simple question to answer but I haven't been able to find a good answer.
    I have an application that establishes a network connection with a server and registers event listeners on that connection.
    What I want to do is find a way without a busy-wait/while loop to keep the main() thread running so that the listeners can do their job.
    Here is a sample of what I've got:
    public static void main(String[] args)
    SomeConnection conn1 = null;
    try
    conn1 = new SomeConnection("someaddress");
    TrafficManager tm = conn1.getTraffictManager();
    TrafficHandler th = tm.createTraffichandler(new MessageListener()
                        public void processMessage(Message message)
                             System.out.println("Received: " + message.toString());
         catch (Exception e)
              e.printStackTrace(System.out);
         conn1.disconnect();
    The problem is that the application doesn't stay running to respond to traffic coming across the connection.
    Any guidance would be appreciated.
    Thanks

    Well, what is the job of the MessageListener if it isn't to listen for messages? And apparently it isn't doing that because your application terminates.
    Bear in mind that I don't have any idea how any of those four classes work, or even how they are supposed to work. So let me just quote this line from the API documentation of the Thread class which says when your application will terminate:
    "All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method."
    That must be the case in your application.

  • Simple Java Coding Question

    I know this is a simple question, but I can't search for the answer to this because it involves syntax that Google and the like don't seem to search for..
    I am trying to figure out some Java code that I have found. I would like to know what:
    a[--i] and a[++j] mean.
    My first thought was that they meant to look at the position in the array one less (or more) than i (j). But that doesn't seem to be the case. A is an array of Strings, if that matters...
    Thanks for you help.

    muiajc wrote:
    I know this is a simple question, but I can't search for the answer to this because it involves syntax that Google and the like don't seem to search for..
    I am trying to figure out some Java code that I have found. I would like to know what:
    a[--i] and a[++j] mean.
    It mean increase/decrease the int i/j by 1. This is done before it gets you the value of a[]. for example if i=5 and you said a[--i] it is really a[4] and i is now equal to 4;

  • Simple Java EJB question.

    When it comes to EJB v3 Remote and Local interfaces,
    (With JBoss EJB Container Software in mind, for this question,)
    -Does the Remote interface for the EJB include method signatures from the Bean class
    -that are to be seen
    -that are to be hidden?
    -Does the Local interface for the EJB include method signatures from the Bean class
    -that are to be seen
    -that are to be hidden?
    Which is which for
    -EJB 2.1 ?
    -EJB 3.x ?
    - is EJB 3.x reverse compatible in that it allows use of the javax.ejb.* interfaces,
    and would accept a EJB 2.1 approach, or does it force one to use Annotations
    exclusively?
    Edited by: Zac1234 on Jul 21, 2010 5:21 PM

    muiajc wrote:
    I know this is a simple question, but I can't search for the answer to this because it involves syntax that Google and the like don't seem to search for..
    I am trying to figure out some Java code that I have found. I would like to know what:
    a[--i] and a[++j] mean.
    It mean increase/decrease the int i/j by 1. This is done before it gets you the value of a[]. for example if i=5 and you said a[--i] it is really a[4] and i is now equal to 4;

  • Simple Java Sound Question...

    Can I draw waveforms while capturing data? If yes, how. If no, why.
    Thanks. I need the answer ASAP, please help.

    Hi nfactorial,
    Can I draw waveforms while capturing data?If you would like to do that in Java you would need to know about how to use the Java language in general and especially about the Java Sound and Java2D APIs.
    If yes, how.It would be too much to explain to answer such a general question. A general answer is, you need to use the Java Sound API to capture the data for which a waveform should be drawn. The Sound API delivers data as a stream of bytes typically encoded in pulse coded modulation (PCM) format. The data stream has digital samples each representing a level of sound pressure for a certain point in time. The stream of samples in the amplitude/time domain need to be transformed to a spectrum of samples in the amplitude/frequency domain, i.e. a number of PCM samples need to be mapped to the frequencies that should be displayed. This is done with the fast fourier transformation algorithm. Each set of amplitude/frequency values can then be displayed as a waveform by using some line drawing logic. The entire process would need to run constantly, i.e. as bytes are received from the sound data stream transformation and drawing is triggered.
    Related readings:
    Java Tutorial
    http://java.sun.com/docs/books/tutorial/
    Java Sound Documentation
    http://java.sun.com/j2se/1.5.0/docs/guide/sound/index.html
    Java Sound API Programmer's Guide
    http://java.sun.com/j2se/1.5.0/docs/guide/sound/programmer_guide/contents.html
    Java Sound Resources
    http.//www.jsresources.org
    Java 2D Graphics Tutorial
    http://java.sun.com/docs/books/tutorial/2d/index.html
    Wikipedia on fast fourier transformation
    http://en.wikipedia.org/wiki/Fast_fourier_transform
    HTH
    Ulrich

  • A few simple (?) dimension questions...

    Hi, I have a few really simple dimension questions that I just can't figure out in OWB (which I'm just now starting to play with):
    1) I'm trying to create a dimension that has no levels or any hierarchy. In the BI tool, I just want this dimension to act as a "pick list" for one of 8 values (DW data snapshot dates for the last 8 weeks...) Users won't summarize by this dimension, or ever have more than 1 week selected at a time. How can I set this type of dimension up?
    2) Somewhat related to #1 - just to get something working, I set up a "time in weeks" dimension not as a time dimension, just as a normal user dimension. I then added a single "weeks" level with a surrogate key (using "key" instead of "id"), short desc (as the business key), and long description. Set up a mapping from my source table, everything worked fine. The strange thing I've notcied is that the relational table produced has both a "week_key" column and a "dimension_key" column. How can I get rid of the "dimension_key" column - its just an exact duplicate of the lowest level key column? Note - we will have a dimension table with over 1.3 BILLION rows in our warehouse - so duplicating this column does add a significant amount of overhead - this isn't just an academic problem.
    3) related to building this "test" dimension - my source table has 8 records in it. Whenever I run the ETL to populate the dimension table, the surrogate keys end up being key values 9 - 16 instead of 1 - 8. Note this is even if I reset the sequence number to 1 before I start, etc. My understanding is that Oracle uses a variable width number field when storing data - so having this dimension with values 1-8 instead of 9-16 saves approx a byte for every fact table record (which we're predicting will be in the range of 20 - 50 BILLION rows). How can I force the dimension to start numbering at 1?
    Thanks in advance,
    Scott

    Hi
    Reg #2, I do not think we can get rid of the "dimension key". It looks like OWB is creating this column as a default Primary Key and hence is not possible to remove this. May be if we build the base Table for dimension as a normal relational table, which will allow us to define our own keys, and then build the "Dimension" using AWM on this relation table may resolve the issue of having duplicate primary keys. Its only a thougt, have not tested though.
    rgds
    Mahesh

  • Java2D graphics question ?

    hi,
    i had to tell that i have absolutely no experience with 2D features, and i would like to embellish my interface without having to read a lot of docs and tutorial, so my question is simple for swing's guru
    I would like to apply the GradiantPaint(say form blue to white) to the backgournd color of a
    JPanel object, can anyone tell me how to do it ?
    thanks for your help

    I have never tried this so i cannot tell you for definate extend JPanel similar to this and use JPanelGrad in the exact same way you would JPanel
    public class JPanelGrad extends JPanel
      GradientPaint gp;
      public JPanelGrad(GradientPaint gp)
        super();
        this.gp=gp;
      public JPanelGrad(GradientPaint gp, LayoutManager layout, boolean isDoubleBuffered)
        super(layout, isDoubleBuffered);
        this.gp=gp;
      public void paint(Graphics _g)
        super(_g);//this statment will slow down painting and i think it is will make no difference to remove it...
                           //i think that in JPanel it simply calls paintComponent(g); paintBorder(g); paintChildren(g);
                           //try it both ways - preferablely remove it
        Graphics2D g=(Graphics2D)_g;
        g.fill(new Rectangle(0, 0, getWidth(), getHeight()));
        g.setPaint(gp);
        paintComponent(g);
        paintBorder(g);
        paintChildren(g);
                      //these three methods r to be in this order;
    JPanelGrad panel=new JPanelGrad(new GradientPaint(0, 0, Color.blue, 10, 0, Color.white));
    Simple as. Bamkin

  • Ridiculously simple audio editing question for Garage Band

    Ok, so this is really a fundamental
    question. It concerns editing technique.
    In analog mixing, the editor put
    the sounds to be saved in the right
    places on each of several tracks --
    narration, sound effects, lip sync,
    music, etc. The tracks were then
    all locked together and the mixer
    adjusted the volumes to either save
    or reject audio information.
    A blank master received the information
    and that was your final product,
    in sync, sprocket by sprocket, with
    the video.
    My question, then, is, how do you
    do it in digital multitrack such as
    Garage Band? Are you aiming to have
    4 or 5 tracks all level controlled
    or do you simple erase unwanted
    sound, or what exactly do you do,
    in post production? If you are going
    to do a voice over, then you have to
    do a mix at some point, not just a
    cut and paste. What's the philosophy,
    if you don't mind my asking?
    Thanks,
    Ed

    Wow... you gave me flashbacks to a movie soundtrack I scored, with separate reels of tape all synced up and whirling away for final mixdown!
    To answer your question as best I can in a paragraph or two, digital mixing is unlimited compared to analog. Whereas tape has a physical limit, you can always add another digital track (there are limitations to digital, but they are becoming harder to reach as systems become increasingly powerful). So no need to erase. Editing is also a breeze. Digital tracks are endlessly malleable, with virtually every parameter available for automation.
    Sometimes you might mix down to stems or mix everything down to a stereo master (or alternative mixes) for post production. Similarly, in post, they can deal with huge numbers of digital tracks from different sources.
    In terms of a professional workflow, Logic is the more typical choice over Garageband, and includes a number of features designed for scoring to picture: variable sample rates, frame rates, etc.
    Gain staging in digital recording is different than in analog, and it requires a different approach to achieve excellent sounding results. But the digital workflow is so much more flexible, forgiving, and economical, that it has been the death-knell for the analog workflow. Infinite bussing, routing, mixing, comping, storing, stemming... infinite possibilities, really!

Maybe you are looking for

  • Help needed with Boot times and performanc​e.

    Hi everyone, after two weeks of getting nowhere i gave up and here i am. I have an S10-3 which i am struggling with. As the post title indicates perfomance is (how can i put it) slow. We are talking 15/20 minutes to boot and when i finaly get to Wind

  • Is the iPad for me?

    I currently have a Tablet but it is time for it to retire. I currently use MS Excel for sending my orders. I want to know if I could use the iPad to do this. I need to be able to filter data so that only products that have a quantity number in a colu

  • Standard Business Content available for FSCM in SAP BI

    HI All. I need to know the Objects available under FSCM in SAP BI Content. If you have any documents. Please share it. Regards, Ashok.

  • Suppress values in Cross-Tab and Cross-Tab Chart if null

    I am developing a cross-tab report that has no-values contributing to the summary in a number of cells.  For instance, if I were to display the average value for the testing of particle-counts by the day of the month, and no testing was performed on

  • How to change the color for the af:messages by skins ?

    Hello All How i can change the text color for the af:messages by skins,i want change the color for the messages paragraph not for message header Because i know how to change the message header color text by .AFErrorTextForeground:alias color: Red; Er