Help with gradient and 'ghost effect'

Hello. I created this image many years ago and I have forgotten how I did it.
I now want to create the same effect with this image ..
The brown is #a03506 - I have tried in vain to replicate what I did. Radial gradient? I just can't remember.
Can anyone help me please?
Regards - Paul

It's a little hard to tell what the original image looks like, but I'll give you some ideas of what you can do.
I'm assuming you want something like this:
If so, you need to turn the image into a layer.
Double click the thumbnail of the image in the Layers panel.
This opens the New Layer dialog box.
You don't have to do anything here. Just click OK. The image is now its own layer.
Click at the bottom of the Layers panel on the Add Layer Mask icon.
This adds a rectangle next to the image in the Layers panel. This rectangle is the layer mask. Anything you put in this rectangle will hide parts of the image.
Make sure the four "corners" of the layer mask are chosen, NOT the four corners of the image. This means that what you are about to do will affect only the image. (Don't worry about screwing up your image. Your working on the mask, not the image.)
Now go and choose the Gradient tool from the Tools panel.
Now, take the Gradient tool and position it over the image. For the ghost image I showed at the top of this post, I put the tool in the center and then dragged down to the bottom of the image. Look carefully and you can see the little line to the right of the door.
Release the mouse. The image should be ghosted.
Now, look at the Layers panel. See how the rectangle for the layer mask goes from white to black? That's because you drew a gradient on the mask. And anywhere there was black, you can't see the image and anywhere there is white you can. And there is change in opacity as the rectangle goes from white to black.
I like to teach people that the layer mask is like a dirty window. Where the window is clean, you can see through it to see the image. Where the window is black, you can't see the image. And anything in between lets you see a percentage of the image.
If you want a different effect, you can change the gradient shape. With the gradient tool still chosen, go to the top of the window and choose another gradient. For instance, radial. Then drag on the image making sure the layer mask is still chosen in the Layers panel.
This will change the appearance of the layer mask and the effect on the image.
You can use gradients or brushes or anything on the layer mask. Just make sure it is chosen and not the image or you'll be screwing up the image, not the mask.
Let us know if this is what you need.

Similar Messages

  • Help with PS and HDR Effect Pro from Nik

    I altready have a help request into Nik Software, but was hoping someone here could offer some suggestions.
    I'm running the Nik Complete software program on Win 7 64Bit, Raid 5 machine. 8800 GTS 512 MB card; 12gb of RAM, i7 quad core, 2.67 GH, PS CS5 and Lightroom 3.2, Wacom Intuos 3 tablet.
    I have the most updated drivers for video, wacom tablet. OS is current with updates. PS CS5 is updated, but I am NOT running Lightroom's 3.3 RC.
    I updated all software updates for the NIK software collection from their site and still have the same problem even after uninstall and re-install.
    When I attempt to run HDR Efect Pro I get the menu window to select my images, click ok and with in seconds I get the message that Adobe Photoshop CS5 has stoopped working and must close...
    I've gone to their site and looked into their FAQ/troubleshooting and did all their recommendations, update drivers, look for color profiles with 0 Bytes in the system color spool for both 32 and 64 bit apps and still no luck. This also happens with CS4 and CS3 and if I attempt to use the program form Lightroom and Bridge. Any ideas, work arounds, suggestions? Their automatic reply from my support request says 2-3 days due to the high populaity of their program!!!
    Thanks for any and all help.

    Outside of suggesting some pretty generic things, I can't offer much help...  I don't use Nik products myself
    You could try disabling the "Use OpenGL Drawing" setting in Photoshop as a workaround to see if that helps.  Perhaps between Photoshop and the plug-in problems are being caused in the OpenGL driver for your particular video card.
    Also, given that 3rd party plug-ins and Photoshop could be competing for memory, you could try changing the amount of memory Photoshop is allowed to use in the Edit - Preferences - Performance dialog.
    Good luck.
    -Noel

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • Help with count and sum query

    Hi I am using oracle 10g. Trying to aggregate duplicate count records. I have so far:
    SELECT 'ST' LEDGER,
    CASE
    WHEN c.Category = 'E' THEN 'Headcount Exempt'
    ELSE 'Headcount Non-Exempt'
    END
    ACCOUNTS,
    CASE WHEN a.COMPANY = 'ZEE' THEN 'OH' ELSE 'NA' END MARKET,
    'MARCH_12' AS PERIOD,
    COUNT (a.empl_id) head_count
    FROM essbase.employee_pubinfo a
    LEFT OUTER JOIN MMS_DIST_COPY b
    ON a.cost_ctr = TRIM (b.bu)
    INNER JOIN MMS_GL_PAY_GROUPS c
    ON a.pay_group = c.group_code
    WHERE a.employee_status IN ('A', 'L', 'P', 'S')
    AND FISCAL_YEAR = '2012'
    AND FISCAL_MONTH = 'MARCH'
    GROUP BY a.company,
    b.district,
    a.cost_ctr,
    c.category,
    a.fiscal_month,
    a.fiscal_year;
    which gives me same rows with different head_counts. I am trying to combine the same rows as a total (one record). Do I use a subquery?

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    user610131 wrote:
    ... which gives me same rows with different head_counts.If they have different head_counts, then the rows are not the same.
    I am trying to combine the same rows as a total (one record). Do I use a subquery?Maybe. It's more likely that you need a different GROUP BY clause, since the GROUP BY clause determines how many rows of output there will be. I'll be able to say more after you post the sample data, results, and explanation.
    You may want both a sub-query and a different GROUP BY clause. For example:
    WITH    got_group_by_columns     AS
         SELECT  a.empl_id
         ,     CASE
                        WHEN  c.category = 'E'
                  THEN  'Headcount Exempt'
                        ELSE  'Headcount Non-Exempt'
                END          AS accounts
         ,       CASE
                        WHEN a.company = 'ZEE'
                        THEN 'OH'
                        ELSE 'NA'
                END          AS market
         FROM              essbase.employee_pubinfo a
         LEFT OUTER JOIN  mms_dist_copy             b  ON   a.cost_ctr     = TRIM (b.bu)
         INNER JOIN       mms_gl_pay_groups        c  ON   a.pay_group      = c.group_code
         WHERE     a.employee_status     IN ('A', 'L', 'P', 'S')
         AND        fiscal_year           = '2012'
         AND        fiscal_month          = 'MARCH'
    SELECT    'ST'               AS ledger
    ,       accounts
    ,       market
    ,       'MARCH_12'          AS period
    ,       COUNT (empl_id)       AS head_count
    FROM       got_group_by_columns
    GROUP BY  accounts
    ,            market
    ;But that's just a wild guess.
    You said you wanted "Help with count and sum". I see the COUNT, but what do you want with SUM? No doubt this will be clearer after you post the sample data and results.
    Edited by: Frank Kulash on Apr 4, 2012 5:31 PM

  • MOVED: [Athlon64] Need Help with X64 and Promise 20378

    This topic has been moved to Operating Systems.
    [Athlon64] Need Help with X64 and Promise 20378

    I'm moving this the the Administration Forum.  It seems more apporpiate there.

  • Help with Guilloches and other things?

    Heya, i've used Illustrator before for a few things, but i'm still quite new to it. Hope you can help.
    Ok so what im trying to do is make bank note from scratch. Dont worry, its for a college project and it'll be an entirely new design so theres no chance of anyone mistaking it for real money (althought I do want it to look real)
    I wanted to include Guilloches in the design. These are the lines found on bank notes to make it harder to counterfeit:
    I've experimented using shapes made of lines and using the blend tool to create multiple lines in between them, but it doesnt give the same effect. Is there a better way to achieve these results?
    The other thing is cross-hatch shading. I want to include my own photo into the design (vain, i know ). Ive also found no way of doing this. Can you help me?
    Thanks

    Sorry, but Illustrator is really not ideally suited to banknote design.
    I designed the current series of Icelandic banknotes so I know all about the problems involved.
    You can make something that "looks" more or less like a banknote, but doing the actual artwork for a banknote is a totally different kettle of fish.
    Illustrator (although a vector application) has pixel-based output (rip), whereas real banknote designs never use pixels, only lines.
    In addition, the colour-banding used in real banknote printing (not gradients as such but specially mixed bands of colour inked onto up to 4 offset plates for each side of the note) makes line work extremely difficult to produce.
    You can do guilloches with blends, repeat rotations and all kinds of distortions, but getting them to "ink" properly in 4 separations using gradated bands of colour is extremely complicated. It will cost you much hard work to produce a passable semblance of a banknote if you use only Illy.
    You mention cross-hatching in a portrait. This again is fiendishly tricky to reproduce in Illustrator because engraved lines in intaglio are not of a constant weight. You can get part of the way using various brush strokes, but frankly I would advise you not to attempt it unless you are prepared to spend several weeks doing the job. It takes a skilled engraver up to three months to do a good portrait (with a burin on a steel plate, a few lines per day). I have always sent photographs or detailed pencil drawings to the engravers. Specialized applications are available that can produce a semblance to hand engraving, but they are really not very good and the outcome invariably involves a lot of manual tweaking. If you are good at drawing it might even be better to do the portrait by hand, but copying the style of engraved lines is very tricky unless done in considerable oversize.
    May I suggest that it is considerably easier to produce colour banding effects using gradients in Photoshop. Copy Illy line work into Photoshop, lock layer transparency and colour with gradients. To do things correctly you will need 4 gradients - one for each offset separation plate - for each side of the note. Calculating the colour range for each plate will prove much more work that you suspect. And remember that each gradient should run the whole width of the note and only horizontally.
    Depending on how real you want your "banknote" to look I suspect you need to study security printing carefully before you embark on this job.

  • Noob needs help with gradient

    I am having troubles duplicating this image. As you can see ( if I link to it correctly) this little green box (there are three across the top "service specials" for example) is lighter in the middle and darker on the top and bottom. I am tryng to make a new one but am struggling as 'gradient' only seems to go from 'dark to light' but not 'dark to light to dark again'
    Any help please? And please keep it realy simple or give directions in detail.
    my link

    When you have the Gradient Tool selected, look at the Options bar at the top of your screen. There's a group of 5 buttons that will produce different types of gradients.
    Experiment with those, and experiment with your start and stop points when you click and drag with the gradient tool in your document area.

  • Noob needs help with Logic and Motu live setup.

    Hello everyone,
    I'm a noob / semi noob who could use some help with a live setup using 2 MOTU 896HD's and Logic on a Mac.
    Here's the scenario:
    I teach an outdoor marching percussion section (a drumline and a front ensemble of marimbas and vibes). We have an amazing setup of live sound to amplify and enhance the mallet percussion. There is a yamaha PA system with 2 subs and 2 mains which are routed through a rack unit that processes the overall PA balance. I'm pretty sure that the unit is supposed to avoid feedback and do an overall cross-over EQ of the sound. Other then that unit, we have 2 motu896hd units which are routed via fire-wire. I also have a coax cable routing the output of the secondary box to the input of the primary box (digital i/o which converts to ADAT in (i think?)..?
    Here's the confusion:
    There are more then 8 inputs being used from the ensemble itself, so I need the 16 available inputs to be available in Logic. I was lead to believe that the 2nd motu unit would have to be sent digitally to the 1st motu unit via coax digital i/o. Once in Logic, however, I cannot find the signal or any input at all past the 8th input (of the 1st unit).
    Here's the goal:
    All of my performers and inputs routed via firewire into a Mac Mini running OSX and Logic pro.
    I want to be able to use MainStage and run different patches of effects / virt. instruments for a midi controller keyboard / etc.
    I want to be able to EQ and balance the ensemble via Logic.
    Here's another question:
    How much latency will I be dealing with? Would a mac mini with 4gb of ram be able to handle this load? With percussion, I obviously want the sound as latency free as possible. I also, however, want the flexibility of sound enhancement / modification that comes with Logic and the motu896hd units.
    Any help would be REALLY appreciated. I need the routing assistance along with some direction as to whether or not this will work for this type of application. I'm pretty certain it does, as I have spoken with some other teachers in similar venues and they have been doing similar things using mac mini's / logic / mainstage / etc.
    Thanks in advance,
    Chris

    You'll definitely want to read the manual to make sure the 896HDs are connected together properly. ADAT is a little tricky, it's not just a matter of cabling them together. Go to motunation.com if you need more guidance on connecting multiple devices. Beyond that initial hookup, here are a couple of quick suggestions:
    1. Open CueMix and see if both devices are reported there. If not, your connections aren't correct. Be sure to select 44.1kHz as your sample rate, otherwise you are reducing the number of additional channels. For instance at 88.2kHz you would get half the additional channels via ADAT.
    2. You may need to create an aggregate device for the MacBook to recognize more than the first 896HD. Lots of help on this forum for how to do that. Again, first make sure you have the 896HDs connected together properly.
    3. As for latency with Mainstage on the Mini, no way to know until you try it. Generally MOTU is fantastic for low latency work but Mainstage is a question mark for a lot of users right now. If the Mini can't cut the mustard, you have a great excuse to upgrade to a MacBook Pro.

  • Need a bit of help with css and fullscreen

    I am currently doing a javaFX application for my university project, I have it everything nearly finished, but need to finish the css component to make the application "prettier" (I am not very good on graphic design to be honest). So if i could get a bit of help on this little issue I'd be very grateful.
    is there any way to make fullscreen (and if possible resizing window) to instead rearranging everything to actually do a fullscreen (like the games) and everything "grows accordingly (even though in games what it usually does is to change the screen resolution, is that possible to reproduce with javaFX?) also how to remove the message and the effect on click the "esc" key to exit the fullscreen mode?
    i know that removing the focus effect on an element is with the following (if a button)
    .button:focused{
         -fx-background-insets: 0;
    }but,is there any way to remove the effect on anything focused (TextField, Combo Box, ...)? (tried with a .textfield:focused but it did not work)
    also i wanted to produce the focused effect by this way but it didn't work, how should i do it? (in fact even if i try to put this line on the button:focused, the focused effect gets removed from there, because of the insets line)
    #highlight{
         -fx-background-insets: 2;
         -fx-background-color: yellow;
    public class controller extends StackPane implements Initializable{
         public void highlight(){
              this.getStyleClass().add("highlight");
    and last thing (for the moment) the .button seems to work for all the buttons, but trying another thing like .gridpane or .textfield or .scrollpane does not seem to work, is there any way to make it work or i should add "id" to all the elements and use the # instead?

    i wrote all them in the same thread becsause there were a total of 4 (and could had been more) separated by ----
    should i leave it how it is or open now 4 threads for each question?

  • FW CS4 need help with gradients & png files

    Relatively new to FW CS4.  I have a png file for use in a PV7 css based site.  Read the docs and still can't figure this out.  The png file is a base image with 3 color sections.  I need to change these three original individual sections to a new color scheme...I can use a regular fill...but I would like to keep the slight fading effect of the original pngs.  In addition...the png's are obviously in png format..but if I export as jpg will I loose the gradient fill/opacity effect in a jpg file ?
    Original png...want to change to light blue tones: Note the fading to the right side of the outside columns.
    If not...how do I change the color scheme in each section of the original png ?  Or do I export as is and modify the resulting jpg's ?
    If I use a gradient fill or paint bucket...the effect just overlays the original gold type color...giving me a new color all together with the original background still partially showing through underneath the new color change ?
    If I delete the gold tones in the png image...then I can't fill the empty space with any other color...nothing works.  I've also tried color find/replace
    but with no results or changes.
    Second problem is when I do apply gradient fills to this png...or jpg...the fill seems to me to be from top to bottom of the section ?  I need the fill to move from left to right as above ?  Any ideas here also ??
    I posted on the PV7 FW group but it's not that active and was more confused by the answers ?
    Thanks much...I'm stuck for now.
    Tim

    After following Lorains' gradient link, when you have the first box tweaked to your liking and you need it replicated to the remaining two boxes (without having to go through the process again)
    1. Select the box that has the new Gradient, then Edit > Copy (or Ctrl/Command + C)
        Then select the remaining two boxes that need the new gradient style, then Edit > Paste Attributes
       This process with carry over (copy/paste attributes) the first box to the others.
    Or
    2. Select the box that has the new Gradient changes, then in the Property Inspector (PI), to the far right, tick the small icon under to create a New (Object) Style. Once created, open the Window > Styles Panel. Select the two remaining boxes on the canvas then click the New Style icon in the Styles Panel to apply.
    1. is memory resident/temporary and will be lost when you later utilize the Copy command. But 2 has more 'staying' power and you can reuse it, go back to it, save it to disk, and tweak it further to create new ones at any time.
    If you absolutely have to keep the final result as a .jpg, then turn off the Canvas color. Open the Window > Optimize Panel, set the output to jpg, BUT set the MATTE color to the color that matches the background of your page.
    Otherwise, output to .png8/png32 with Transparency .
    h
    h

  • Help with XMLSEQUENCE and repeating elements

    I need help with the following XML extraction (note this is on Oracle9i). I have the following XML structure. There are multiple <Reading> elements
    <MeterReadings>
    <MeterReading>
    <Meter>
    <id>0004128190</id>
    <idType>METER_X_UNIVERSAL_ID</idType>
    </Meter>
    <Premise>
    <id>PREM4128190</id>
    <idType>X_CLIENT_PRMSE_ID</idType>
    </Premise>
    <Reading>
    <value>11111</value>
    <readingTypeId>CKWH</readingTypeId>
    </Reading>
    <Reading>
    <value>22222</value>
    <readingTypeId>KWHP</readingTypeId>
    </Reading>
    </MeterReading>
    </MeterReadings>
    I want to return one row for each <reading> element, including all its sub-elements - <value> and <readingTypeId>
    So, for the above data set, I would like to get back something like this. The parent elements can be repeated.
    <meter/id>,<Premise/id>,<Reading/value>,<Reading/readingTypeId>
    0004128190,PREM4128190,11111,CKWH
    0004128190,PREM4128190,22222,KWHP
    I have tried to use the XMLSequence function like this:
    select extractvalue(i.xml_message,'MeterReadings/MeterReading/Meter/id'),
    extractvalue(value(p),'value'), extractvalue(value(p),'readingTypeId')
    from myTable i,
    table(XMLSequence(
    extract(i._xml_message, '//Reading/*' ))) p
    But then I get results like this, where each sub-element results in a new row:
    0004128190     11111     null
    0004128190     null     CKWH
    0004128190     22222     null
    0004128190     null     KWHP
    What would be the proper XQuery?
    Thanks!

    This may help:
    http://www.dreamweaverresources.com/tutorials/pagebackgrounds/examplevert.htm
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    http://www.csstemplates.com.au
    http://www.perrelink.com.au
    CSS Tutorials for Dreamweaver
    http://www.adobe.com/devnet/dreamweaver/css.html
    "teamkombat" <[email protected]> wrote in
    message
    news:ept196$d1g$[email protected]..
    > Hi I am trying to create a very simple effect where my
    page casts a
    > shadow. If
    > you take a look at
    http://www.timberland.com/home/index.jsp
    the left and
    > right
    > side of the page has a very light shadow. I would like
    to use a similar
    > effect. What I was thinking was to create 2 small .gifs
    with the shadow
    > effect
    > (1 for the left side and 1 for the right side) maybe
    10px long. Then
    > create 1
    > table with 3 columns: The middle collumn will be the
    main column for the
    > content and 2 thin/small columns on the left and right
    to attach the
    > shadow
    > .gifs.
    >
    > I was wondering how do I repeat this shadow .gif image
    for the length of
    > the
    > main column?
    >
    > Also if there is a better solution to the above problem
    please let me
    > know. I
    > have read about faux columns and using CSS for repeating
    images, but don't
    > really grasp the ideas yet. Thanks everyone for their
    time and help.
    >
    >

  • HELP with Subtitles and Stories

    Ok, I need help with a a complicated disc I'm trying to set-up.
    I don't even know if this is possible.
    What I'd like to do is enable a story that could Play all
    three of seperate video shorts, that all resides on seperate tracks. The reason they are on seperate tracks, is because each track has two audio streams (one for English Lang, the other for Japanese Language) and each short aslo has an English Subtitle track. The tracks are named as Short A, Short B, and Short C.
    Or is there a way other than a Story that could link
    the three seperate tracks to play one right after the other ?

    Stories won't link assets across different tracks - a story is like a play list for a single track - it can only contain a subset of the track's assets.
    In order to effect a 'Play All' across different tracks you are going to need to script it.
    Fortunately, it's pretty easy, but you have to be clear about the functionality that you want in advance. Whilst it is simple to check to see if a 'play all' button was activated, there are various scenarios which your user might be in that will adversely affect the playback.
    Check here for more info - the section about scripting is towards the bottom, but be sure to read about things to watch out for!

  • Need Help With Waveform-driven Image Effects

    Hi,
    I've been working on a full-dome 3D animation for a couple of years now and I'm looking for someone to help with a custom plug-in for After Effects, Photoshop and/or Combustion. I need to be able to drive filters and effects like Brush Strokes and 'sketchy' noise with the waveform from an audio file. I've been using a very poor mans workflow in which I've mapped the waveform by breaking it up into vertical ranges of varying intensities and then applying respective levels of the effects and filters to the sequential images based on where they fall in the waveform ranges. So for the test Ive done, I've been literally applying Photoshop actions to very small packets of still images from rendered sequences, and it has been dizzyingly time-consuming. Ideally I would want to be able to do this dynamically with a motion graphics package, but really I'm looking for as much help as I can get.
    This project began as my master's thesis and I'm working on it during the free time I have between teaching and freelance work; I don't have much money but I am willing to pay for help with this goal. There is still a lot of 3D work that I still need to do and the rendering process will be slow, so this wouldn't be a job with strict or tight deadlines. The final images will be very large (3200x3200) and with the growth in the full-dome market, these sizes could easily increase. If anyone is interested or could help me with this endeavor in any way, please respond to [email protected] Thank in advance to anyone who reads this.
    Max

    See the SDK_Backwards sample to see how to acquire audio data from a layer. This is the same access method used by AE's own waveform drawing plug-ins. Feel free to contact me directly with any questions.

  • Help with Mathscipt and for loop

    I have a code in Mathscript/matlab and I need to output the array out. One option is my first code,the other option is using a for loop, but I am only getting the last ouput out. I need to get the whole output out.
    Any help.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Help with Mathscript_for loop.vi ‏115 KB
    Help with Mathscript_for loop2.vi ‏84 KB

    Here's how it should look like.
    Message Edited by altenbach on 10-30-2008 05:12 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    MathscriptInFOR.png ‏15 KB

  • Need help with JTextArea and Scrolling

    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    import javax.swing.*;
    public class MORT_RETRY extends JFrame implements ActionListener
    private JPanel keypad;
    private JPanel buttons;
    private JTextField lcdLoanAmt;
    private JTextField lcdInterestRate;
    private JTextField lcdTerm;
    private JTextField lcdMonthlyPmt;
    private JTextArea displayArea;
    private JButton CalculateBtn;
    private JButton ClrBtn;
    private JButton CloseBtn;
    private JButton Amortize;
    private JScrollPane scroll;
    private DecimalFormat calcPattern = new DecimalFormat("$###,###.00");
    private String[] rateTerm = {"", "7years @ 5.35%", "15years @ 5.5%", "30years @ 5.75%"};
    private JComboBox rateTermList;
    double interest[] = {5.35, 5.5, 5.75};
    int term[] = {7, 15, 30};
    double balance, interestAmt, monthlyInterest, monthlyPayment, monPmtInt, monPmtPrin;
    int termInMonths, month, termLoop, monthLoop;
    public MORT_RETRY()
    Container pane = getContentPane();
    lcdLoanAmt = new JTextField();
    lcdMonthlyPmt = new JTextField();
    displayArea = new JTextArea();//DEFINE COMBOBOX AND SCROLL
    rateTermList = new JComboBox(rateTerm);
    scroll = new JScrollPane(displayArea);
    scroll.setSize(600,170);
    scroll.setLocation(150,270);//DEFINE BUTTONS
    CalculateBtn = new JButton("Calculate");
    ClrBtn = new JButton("Clear Fields");
    CloseBtn = new JButton("Close");
    Amortize = new JButton("Amortize");//DEFINE PANEL(S)
    keypad = new JPanel();
    buttons = new JPanel();//DEFINE KEYPAD PANEL LAYOUT
    keypad.setLayout(new GridLayout( 4, 2, 5, 5));//SET CONTROLS ON KEYPAD PANEL
    keypad.add(new JLabel("Loan Amount$ : "));
    keypad.add(lcdLoanAmt);
    keypad.add(new JLabel("Term of loan and Interest Rate: "));
    keypad.add(rateTermList);
    keypad.add(new JLabel("Monthly Payment : "));
    keypad.add(lcdMonthlyPmt);
    lcdMonthlyPmt.setEditable(false);
    keypad.add(new JLabel("Amortize Table:"));
    keypad.add(displayArea);
    displayArea.setEditable(false);//DEFINE BUTTONS PANEL LAYOUT
    buttons.setLayout(new GridLayout( 1, 3, 5, 5));//SET CONTROLS ON BUTTONS PANEL
    buttons.add(CalculateBtn);
    buttons.add(Amortize);
    buttons.add(ClrBtn);
    buttons.add(CloseBtn);//ADD ACTION LISTENER
    CalculateBtn.addActionListener(this);
    ClrBtn.addActionListener(this);
    CloseBtn.addActionListener(this);
    Amortize.addActionListener(this);
    rateTermList.addActionListener(this);//ADD PANELS
    pane.add(keypad, BorderLayout.NORTH);
    pane.add(buttons, BorderLayout.SOUTH);
    pane.add(scroll, BorderLayout.CENTER);
    addWindowListener( new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    public void actionPerformed(ActionEvent e)
    String arg = lcdLoanAmt.getText();
    int combined = Integer.parseInt(arg);
    if (e.getSource() == CalculateBtn)
    try
    JOptionPane.showMessageDialog(null, "Got try here", "Error", JOptionPane.ERROR_MESSAGE);
    catch(NumberFormatException ev)
    JOptionPane.showMessageDialog(null, "Got here", "Error", JOptionPane.ERROR_MESSAGE);
    if ((e.getSource() == CalculateBtn) && (arg != null))
    try{
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 1))
    monthlyInterest = interest[0] / (12 * 100);
    termInMonths = term[0] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 2))
    monthlyInterest = interest[1] / (12 * 100);
    termInMonths = term[1] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 3))
    monthlyInterest = interest[2] / (12 * 100);
    termInMonths = term[2] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    catch(NumberFormatException ev)
    JOptionPane.showMessageDialog(null, "Invalid Entry!\nPlease Try Again", "Error", JOptionPane.ERROR_MESSAGE);
    }                    //IF STATEMENTS FOR AMORTIZATION
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 1))
    loopy(7, 5.35);
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 2))
    loopy(15, 5.5);
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 3))
    loopy(30, 5.75);
    if (e.getSource() == ClrBtn)
    rateTermList.setSelectedIndex(0);
    lcdLoanAmt.setText(null);
    lcdMonthlyPmt.setText(null);
    displayArea.setText(null);
    if (e.getSource() == CloseBtn)
    System.exit(0);
    private void loopy(int lTerm,double lInterest)
    double total, monthly, monthlyrate, monthint, monthprin, balance, lastint, paid;
    int amount, months, termloop, monthloop;
    String lcd2 = lcdLoanAmt.getText();
    amount = Integer.parseInt(lcd2);
    termloop = 1;
    paid = 0.00;
    monthlyrate = lInterest / (12 * 100);
    months = lTerm * 12;
    monthly = amount *(monthlyrate/(1-Math.pow(1+monthlyrate,-months)));
    total = months * monthly;
    balance = amount;
    while (termloop <= lTerm)
    displayArea.setCaretPosition(0);
    displayArea.append("\n");
    displayArea.append("Year " + termloop + " of " + lTerm + ": payments\n");
    displayArea.append("\n");
    displayArea.append("Month\tMonthly\tPrinciple\tInterest\tBalance\n");
    monthloop = 1;
    while (monthloop <= 12)
    monthint = balance * monthlyrate;
    monthprin = monthly - monthint;
    balance -= monthprin;
    paid += monthly;
    displayArea.setCaretPosition(0);
    displayArea.append(monthloop + "\t" + calcPattern.format(monthly) + "\t" + calcPattern.format(monthprin) + "\t");
    displayArea.append(calcPattern.format(monthint) + "\t" + calcPattern.format(balance) + "\n");
    monthloop ++;
    termloop ++;
    public static void main(String args[])
    MORT_RETRY f = new MORT_RETRY();
    f.setTitle("MORTGAGE PAYMENT CALCULATOR");
    f.setBounds(600, 600, 500, 500);
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    }need help with displaying the textarea correctly and the scroll bar please.
    Message was edited by:
    new2this2020

    What's the problem you're having ???
    PS.

Maybe you are looking for