New to JSP, where to start?

Hi all,
I decided to take a look at JSP and was wondering what things I need to install/configure to get an environment running. What are your recommendations for a webserver, editor, online resources etc.
I'm fairly experienced with PHP and ASP programming and have 2-3 years background in OOP.
thanks for your time!
regards,
Christophe

I decided to take a look at JSP and was wondering
what things I need to install/configure to get an
environment running. What are your recommendations
for a webserver, editor, online resources etc.(1) Download the Tomcat servlet/JSP engine from Jakarta Apache:
http://jakarta.apache.org/tomcat
(2) Download the JSP Standard Tag Library, also from Jakarta Apache (you'll want version 1.1 to go with Tomcat 5.5):
http://jakarta.apache.org/taglibs
(3) Go buy Hans Bergsten's JSP book from O'Reilly. I think it's the best, because it uses JSTL from the first page. That's the proper way to learn how to write JSPs.
%

Similar Messages

  • NEW TO SAP  -  WHERE TO START

    Hi all
    I am hoping you are able to advise. I am looking to change my career a little , from being a project manager to getting into SAP. However, as you all know its quite vast and varied. My background is Business Information Systems, so I know about development methodologies, programming, web applications etc. However, I dont consider myself to be very technical which is why I want to get into SAP to specialise in an area.
    My issue is that I dont know where to really start. Im thinking a combination of business objects and netweaver as I have a keen interest in web based applications. Obviously, I want to get into a field which is highly required and somewhat recession proof.
    What would you advise.Should I just start a general SAP course? and then develop on top of that or go straight into a specific component.
    Any advise on this would be very helpful.
    Thanks
    Jay

    Hi,
    After reading your posting I understood that right choice is Netweaver (BI) and concentrate on ESOA also.
    Read home page on the sdn for latest information in SAP.
    Please click [To Know SAP|http://help.sap.com/search/sap_trex.jsp] which gives any infomation about SAP.
    With Regards,
    Krishna.

  • New to Programming: Where to Start?

    Hi
    I'm 15 and just want to get a small start in the programming area for mac and iPhone/iPod Touch. I heard to be able to make apps for the App Store I need to have knowledge in Objective-C. Could you recommend any good video tutorials, books or things i need to learn for someone who doesnt know anything about programming? Thanks, any help much appreciated.

    Start with a book and actually trying to write programs. Writing programs is the best way. If you strictly want to focus on iPhone development, you'll need two books, one on Objective-C and the another one to learn to use the different frameworks available on the iPhone. Objective-C is the language used to write iPhone programs.
    Before you invest in these books, do a search on google for something like "iphone sdk tutorial." Theres a few out there. Try to follow a long. If you're still interested after a couple of weeks, invest in the books. It's important to have good reference books.
    They way I go about it when I start studying a new subject and I want to find out what the best books are, I do a search on amazon.com. I just type in the subject of what I'm interested in. For example, I'll search for "objective c." Typically, the top results are the books that have sold the most. Most of the times these are the titles you want to check out. Read the comments people have. A good way to tell if a book is decent is by looking at the spread in the price of the book. If a new book is $50 and used is around $40, then it's a good sign the book has high demand and people tend to keep their copies and not sell them. If the new book is $50 and a used copy is $5 or $10 or something along those lines, then it might not be as good of a book since people are practically giving away their copies.
    Good luck.
    adolfo

  • Running iTunes from external hard drive, new computer, where to start?

    I've seen several threads relating to this, but I'm a bit confused. For some time we have been running iTunes from an external hard drive with no issues. We now have a new laptop with windows 8, and I'm not sure where to start to set up iTunes (we replaced the computer with a laptop). Do I need to do a new install of iTunes on the laptop? Do I install it to the hard drive (C) or to the external drive (G)? My biggest source of concern is losing the library. I also want to be sure that we can continue to run iTunes from the external drive, I don't want it taking up space on the laptop hard drive.

    With more & more people looking towards external drives as a storage solution, it's important to warn them, that although using one within iTunes is a great idea, it comes with its issues & can be a step towards a disastrous sequence. In such a scenario, each time iTunes is launched it'll look for the library that resides on the external drive, & if that drive's not connected, iTunes will open with an empty library. You know what's comming next, rite ? An empty iDevice. This happens because 'by default' iTunes is set to Auto-Sync & if you're using an external drive, the potential for a messy problem goes way up.  So in short, remember these points. when using an external drive(library).
    . Always connect your external drive prior to lauching iTunes.
    . Always ensure iTunes sees your external library prior to connecting your iDevice.
    . Disable the 'Auto-Sync' feature from within iTunes prior to connecting your iDevice.
    . Always wait to connect your iDevice until thee aforementioned points are confirmed.
    As stated earlier, using an external drive with iTunes isn't a problem in & by itself. But if the external drive's disconnected & the 'Auto-Sync' feature's left at its default setting(enabled), a family member could loose all their data simply by connecting their iDevice to the PC/Mac. Or be in for a time consuming lesson.
    PS: At the very least one should research the topic themselves. http://ipod.about.com/od/advanceditunesuse/a/Itunes-External-Hard-Drive.htm

  • I'm new to this! My old mac 0sx 10.2.8 won't switch on. Not sure where to start to fix it? I am totally useless when it comes to computing, can anyone help me please!!

    Hi, I am new to this support site so forgive me if I am doing it wrong but I have a problem that I am at a loss as what to do. My (very) old mac 10.2.8 won't switch on..I really only use it for music , there is a vast amount of music stored in it and am heartbroken that it won't even switch on. I have no idea where to start on trying to fix it. Can somebody please help me on where to start on fixing it

    You might want to try resetting its power management unit; see the following tech notes:
    http://support.apple.com/kb/HT1895
    http://support.apple.com/kb/HT1379
    The reason I'm suggesting this is that some startup settings are stored and preserved by a tiny battery that lasts about 5 years, inside the computer. When that battery dies, the computer may forget things like what time it is and which disk to start up from. If your Mac is around 5 years old or more, that little battery might be on its way out.
    If you can't revive the Mac, don't panic. You can remove its internal hard drive and put it inside a USB/FireWire enclosure so that it can be hooked up to another Mac, and then you can use or copy all of the files and music off of it (assuming the startup problem has nothing to do with the hard drive).

  • HT201269 I used Article: HT2109 to transfer everything from my iPod touch 3g, iOS 5.1.1, to my iPod touch 5g, iOS 6.1.3. Why did data from apps did NOT move to the new device? Games are starting over rather than picking up where they were on the old devic

    I used Article: HT2109 to transfer everything from my iPod touch 3g, iOS 5.1.1, to my iPod touch 5g, iOS 6.1.3. Why did data from apps NOT move to the new device? Games are starting over rather than picking up where they were on the old device?

    - If you restored the 5G frmm the iTunes backup of the 3G were th app in the iTunes library of the computer you used? They have to be.
    - If yes then try again. When I first restored my iPad 4 from the iTunes backup of my iPad 1 app data did not transfer. I tried again and it did.

  • New to mac where do i start

    I just received my new macbook pro today and am totally new to mac (had pcs forever).  Any suggestions on where to start or helpful hints?

    download "cheatsheet" on app store.
    its free and you can know all the shortcuts for each individual app.
    just press command key (the one with apple logo on it) and the screen will show you a screen of all the shortcuts on that app.
    tip #1
    dont edit folders and subfolders, learn how to manage your itunes, iphoto, aperture, documents inside the app.
    tip#2
    create an apple id
    https://appleid.apple.com/ca/
    and go to your macbook pro Settings, icloud, and log in
    iCloud will be your back up for your contacts, Mail, iCalendar, etc. Even Find my iPhone. and it will sync to all your apple devices seamlessly.
    tip#3
    learn to back up with Time Machine.
    hope that helps.

  • HT1414 i was trying to updates the new version but there was error occured so i was trying to restore but the massage come to connect yo wi-fi so i dont know where to start from there

    i was trying to updates the new version but there was error occured so i was trying to restore but the massage come to connect yo wi-fi so i dont know where to start from there

    Downloading past purchases from the App Store, iBookstore, and iTunes Storehttp://support.apple.com/kb/HT2519
    Message was edited by: michael08081

  • New Open Source Broadcom WIFI driver, where to start?

    Hello I want to install new Broadcom Open Source driver brcm80211 for my Broadcom BCM43225 WIFI card but I'm kinda confused where to start. First of all this driver is not available in Arch repositories nor AUR, so I guess there's only GIT way in which I'm not too much familiar. At the moment only Debian has this driver available in it's backports kernel but that is useless for Arch Linux user, except for the firmware loading instructions. So please help me, I have exported the whole 500MB+ git "next staging" tree, and now I would like to figure it out how to compile brcm80211 module and eventually use it with Arch kernel. Thanks in advance.
    Last edited by Riot777 (2010-09-28 23:00:45)

    I spent close to an hour shortly after it was added to the staging-next branch and managed to compile it against 2.6.35.4 (not sure about the .4 part however). Unfortunately, it wasn't especially stable and got some kernel oops on suspend. After that, I went back to using the wl module.
    Recent changes don't look like they could have improved the stability of the driver by much, so I'd advise against using it for now.
    With the above said, if you're feeling adventurous you can build the driver as follows:
    0. Make sure you have the `base-devel' group installed, along with `kernel26-headers' (preferably version 2.6.35.6-2 as 2.6.35.6-1 had some issues) and `linux-firmware' 20100911-1 (the one in [core] doesn't contain the firmware files for brcm80211 AFAIK).
    1. Grab just the brcm80211 directory from the staging-next branch by clicking the `snapshot' link on this page.
    2. Extract the compressed tarball and then open a terminal inside the staging-next-2.6-x directory that gets created.
    3. Change the Makefile a little by running `curl -s http://ompldr.org/vNW82NA/Makefile.patch | patch -Np0'. After that, run `make'.
    4. Now, you should have the compiled module `brcm80211.ko' in the current directory, which you can copy into `/lib/modules/2.6.35-ARCH/updates/'. (Create the updates directory if it doesn't exist.)
    I didn't test the above steps thoroughly and I'm not certain this is the correct way to build the driver. However, I believe it'll get you a working kernel module.

  • New Job as a Dialer Administrator "where to start?"

    Hi Everyone,
    I just got a new job and it looking more like I have to lear about ICM Scripting, cvp with xml, etc...  Anyone know where to start to get training on something like this?  specif Books, specif courses (online / offline), I know there is just an overwelming amount of information that is out there, but don't know what I am looking for to get a firm knowlege about icm scripting and cvp etc.  Any help wouild be most greatful. 
    Thanks Everyone.
    Buddy

    Hi 2wicky,
    Welcome to Windows Forms.
    The link below might be useful to you:
    #Your First Game - XNA Game Studio in 2D
    https://msdn.microsoft.com/en-us/library/bb203893.aspx?f=255&MSPPError=-2147217396
    In addition, since this forum is discussing about the windows forms designer and the winform controls, and if you have any issue about xna or XBOX, I would recommend you go to the link below for help.
    http://xboxforums.create.msdn.com/forums/
    Thanks for your understanding.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • When I try to upload a movie from I movie with the new iOS 7 it says sign in to YouTube when I do the screen goes back to where are started and it says to sign in again.  Any suggestions?

    When I try to upload a movie from I movie with the new iOS 7 it says sign in to YouTube when I do the screen goes back to where are started and it says to sign in again.  Any suggestions?

    Google seems to change their login security occasionally, and apps that assume it will work a particular way get left out in the cold till they are updated, since the login process is hard-coded into the app.
    Here is the automated e-mail I received today from Google when tried to upload a movie using iMovie.
    We recently blocked a sign-in attempt to your Google Account [REDACTED].
    Sign in attempt details
    REDACTED
    If this wasn't you
    Please review your Account Activity page at https://security.google.com/settings/security/activity to see if anything looks suspicious. Whoever tried to sign in to your account knows your password; we recommend that you change it right away.
    If this was you
    You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards.
    To learn more, see https://support.google.com/accounts/answer/6010255.

  • I have just started with Logic X, having been a Logic 8 user for many years. I have some expensive plug-ins which are not being recognised by the news Logic. Where should I install them ?  YoursdisillusionedbyLogic

    I have some expensive plug-ins which are not being recognised by the new Logic. Where should I install them ? 
    I am using Mavericks OS, and I am considering transfering my choiceof DAW to Protools.
    YoursdisillusionedbyLogic

    Hi
    LPX only supports 64bit Audio Unit plugins. You probably need to get the latest updates for all of your plugs.
    Some plugs are not currently available as 64bit versions: you may want to try
    http://www.soundradix.com/products/32-lives
    CCT

  • New to Photoshop WHERE do I start?? HELP

    So I have purchased photoshop 3 for mac 2 weeks ago. I have read the pfd file on getting started. I have browsed through this site but after daily tinkering on the computer with PSE 3.0 I still feel like I know NOTHING and-don't know where to start.
    Can anyone direct me to a good and through "getting started" place?
    I see that a bunch of really cool things can be done with this software but I don't know how. I feel like I may just have to revert back to editing in iphoto...

    One thing to do is get
    this book.
    Open PSE. In the upper left click on the folder icon with the magnifying glass on it.
    That gives you your HD.
    Navigate to a folder with photos, click on it.
    Double click on an image and go nuts.
    You can also set iPhoto to open an image in PSE, when double clicked.
    Find that in iPhoto preferences.

  • Pls help!  Creating a new simple jsp iView...

    Hi, I would like to create a totally new iView JSP project from scratch.  I currently have NetWeaver and EP 6.0.  This is what I have done so far on NetWeaver: <b>File > New > Project > Select Portal Application > click 'Next' > Type in Project name and root folder > click 'FINISH'</b>.  Now, I think I have a project ready?  I have some basic iView JSP code already.   so now can someone provide me with detailed steps on what modifications and steps I need to make on my new project in order for my iView jsp to display on the EP 6.0?  Any files like 'portalapp.xml' that I have to modify?
    Thank you so much for your help,
    Baggett.
    What I know so far: I have looked at an example where I created one using an existing par.  I know how to export .par file to EP 6.0, it's the steps before that I don't know.  Thanks again.

    Hi, I think I found a little solution to my problem but now I have a new issue.  I think I "solved" my problem by doing:  <b>File > New > Project > Select Portal Application > click 'Next' > Type in Project name and root folder > click 'FINISH'.  Now, I do:
    File > New > Other > Portal Application > Create a new Portal Application Object > Select my Project > Portal Component/JSPDynPage (is this the 'easy' one to pick b/c it seems to update the portalapp.xml file, creates a jsp file (myFirstJSP.jsp) and bean for me) > I type in all the textfields for file name, package name, ... > click 'FINISH'. </b>
    Is this a correct/good way of starting a JSP project(I don't really know what a JSPDynPage is)
    Now I have a new issue.  I open up myFirstJSP.jsp and NetWeaver highlights all the code (pasted below) in yellow and there is no error displayed:
    <b><hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
       </hbj:form>
      </hbj:page>
    </hbj:content></b>
    So I try to paste this line into myFirstJSP.jsp: <b><%@ taglib uri="tagLib" prefix="hbj" %></b>and also paste this line onto portalapp.xml:
    <b><component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
    </component-profile>    </b>
    Now, I get an error saying: <b>"JSP Parsing Error:File "/dist/PORTAL_INF/pagelet/tagLib" not found"</b>
    Why is this?  How can I fix it?
    Thanks so much,
    Baggett.

  • I have no idea where to start

    okay, hi! i'm trying to write a vending machine program for a class i'm taking. i have a text file with names, image URLs, and prices. I have a product class which is supposed to use filereader to read the fields in the text file. The product class is going to be loaded by the main VendMach class file, where i will have all of the main ui stuff written. The last file is the MoneyInOut class, which handles all of the money methods. i've got the majority of the UI file done, the text file is ready, and the money file is almost done...everything is hanging on whether or not i can write the product file. i have no idea where to start. any help would be greatly appreciated. i'm not looking for somebody else to write my code, but a point in the right direction would be great! here are the UI and text files:
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.text.NumberFormat;
    import java.util.StringTokenizer;
    // Still to be fixed:
    // 1. Purchase & Maintenance buttons.
    // 2. fix repaint of pictures, they don't display until a repaint is hit.
    // 3. fix the Quit from program, it doesn't work right.
    // 4. Put in the code for doing Maintenance.
    // 5. Button super.setSize
    // 6. Animate picture on selection.
    public class VendMach extends Applet implements ActionListener
    // Fonts for text and buttons.
    private Font boldSerif16 = new Font("Serif",Font.BOLD,16);
    private Font boldSerif24 = new Font("Serif",Font.BOLD,24);
    private Font boldItalicSerif24 = new Font("Serif",Font.BOLD+Font.ITALIC,24);
    private Font boldItalicSerif13 = new Font("Serif",Font.BOLD+Font.ITALIC,13);
    private Font boldItalicSerif40 = new Font("Serif",Font.BOLD+Font.ITALIC,40);
    //%% private Font boldItalicDialog16 = new Font("Dialog",Font.BOLD+Font.ITALIC,16);
    // Mode flag.
    private int mode = 0;
    // Panels for the buttons
    private Panel mainPanel = new Panel();
    private Panel cashPanel = new Panel();
    private Panel selPanel = new Panel();
    private Panel maintPanel = new Panel();
    // Product selection panel buttons
    private Button selBtn[] = new Button[6];
    // Cash customer puts in machine panel buttons
    private Button viewC = new Button("View The Products");
    private Button quit = new Button("Quit");
    private Button bNickle = new Button("Nickel");
    private Button bDime = new Button("Dime");
    private Button bQuarter = new Button("Quarter");
    private Button b$Paper = new Button("$1 Paper");
    private Button b$Coin = new Button("$1 Coin");
    private Label lCredit = new Label(" Credit:");
    private Label lMsg = new Label("");
    private Button bChange = new Button("Change Return");
    private Button purchase = new Button("Purchase");
    private Button maintenance = new Button("Maintenance");
    private Product productForSale [];
    private CashIn changeOH;
    private int $collected = 0;
    private double total$In = 0.00;
    private NumberFormat nf;
    private Image pic;
    private Image picAnim;
    private int prodSel = 999;
    private String line;
    private String f[] = new String[8];
    private int tokenCount;
    private int int3, int4, int5, int6, int7;
    private double dbl4;
    private StringTokenizer strings;
    private int dispense = 99;
    public void init()
    {  setLayout(new BorderLayout());
    productForSale = new Product[6];
    try
    {  BufferedReader inPut = new BufferedReader(new FileReader("Vend_Machine.txt"));
    while ((line=inPut.readLine()) != null)
    {  strings = new StringTokenizer(line,",");
    tokenCount = strings.countTokens();
    // Loop thru and retrieve each data element.
    for (int i=0; i<tokenCount; i++)
    f[i] = strings.nextToken();
    // Load the money.
    if (f[0].compareTo("M") == 0)
    {  int3 = Integer.parseInt(f[3]);
    int4 = Integer.parseInt(f[4]);
    int5 = Integer.parseInt(f[5]);
    int6 = Integer.parseInt(f[6]);
    int7 = Integer.parseInt(f[7]);
    changeOH = new CashIn(f[1],f[2],int3,int4,int5,int6,int7);
    // Load the products.
    if (f[0].compareTo("P") == 0)
    {  int3 = Integer.parseInt(f[3]);
    dbl4 = (new Double(f[4])).doubleValue();
    int5 = Integer.parseInt(f[5]);
    int6 = Integer.parseInt(f[6]);
    int7 = Integer.parseInt(f[7]);
    productForSale[int3] = new Product(f[1],f[2],dbl4,int5,int6,int7);
    inPut.close();
    catch(IOException e)
    {  e.printStackTrace();
    setBackground(Color.pink);
    setForeground(new Color(120,0,120));
    setFont(boldSerif16);
    cashPanel.setLayout(new GridLayout(10,1));
    cashPanel.add(viewC);
    cashPanel.add(quit);
    cashPanel.add(bNickle);
    cashPanel.add(bDime);
    cashPanel.add(bQuarter);
    cashPanel.add(b$Paper);
    cashPanel.add(b$Coin);
    cashPanel.add(lCredit);
    cashPanel.add(lMsg);
    cashPanel.add(bChange);
    add(cashPanel,"East");
    selPanel.setLayout(new GridLayout(1,6));
    for (int i=0; i<6; i++)
    {  selBtn[i] = new Button(productForSale.getName());
    selPanel.add(selBtn[i]);
    add(selPanel,"South");
    setBackground(Color.black);
    viewC.addActionListener(this);
    quit.addActionListener(this);
    bNickle.addActionListener(this);
    bDime.addActionListener(this);
    bQuarter.addActionListener(this);
    b$Paper.addActionListener(this);
    b$Coin.addActionListener(this);
    bChange.addActionListener(this);
    nf = NumberFormat.getCurrencyInstance();
    for (int i=0; i<6; i++)
    selBtn[i].addActionListener(this);
    } // =======>> END OF INIT METHOD
    // ** PAINT METHOD **
    public void paint(Graphics g)
    {  int xVal = 35;
    int yVal = 85;
    int xValAnim = 0;
    int yValAnim = 0;
    int c = 0;
    // Paint the product pictures on the vending machine.
    g.setColor(Color.cyan);
    g.setFont(boldItalicSerif24);
    g.drawString(changeOH.getLogo1(),115,40);
    g.setFont(boldItalicSerif13);
    g.drawString(changeOH.getLogo2(),200,60);
    for (int z=0; z<2; z++)
    {  xVal = 35;
    yVal = 85;
    c = 0;
    g.setColor(Color.black);
    g.fillRect(xVal,yVal,500,350);
    g.setColor(Color.yellow);
    for (int i=0; i<2; i++)
    {  for (int j=0; j<3; j++)
    {  g.setFont(boldSerif16);
    g.drawString(nf.format(productForSale[c].getPrice()),xVal+45,yVal-5);
    pic = getImage(getCodeBase(),productForSale[c].getPic());
    g.drawImage(pic,xVal,yVal,null);
    // If product is dispensed get ready to animate.
    if (c == dispense)
    {  xValAnim = xVal;
    yValAnim = yVal;
    picAnim = pic;
    xVal = xVal + 170;
    c++;
    yVal = yVal + 160;
    xVal = 35;
    // If product is dispensed, animate it.
    if (dispense < 99)
    {  for (int y=0; y<40; y++)
    {  g.setColor(Color.black);
    g.fillRect(xValAnim,yValAnim-9,125,125);
    g.setColor(Color.yellow);
    g.drawImage(picAnim,xValAnim,yValAnim,null);
    yValAnim = yValAnim + 10;
    pause(3);
    dispense = 99;
    if (mode == 0)
    {  pic = getImage(getCodeBase(),"OutStock.gif");
    g.drawImage(pic,300,300,null);
    g.setColor(Color.black);
    g.fillRect(1,1,500,300);
    g.setColor(Color.pink);
    g.setFont(boldItalicSerif40);
    g.drawString(changeOH.getLogo1(),10,150);
    g.setFont(boldItalicSerif24);
    g.drawString(changeOH.getLogo2(),160,250);
    mode++;
    } // =======>> END OF PAINT METHOD
    // ** ACTIONPERFORMED METHOD **
    public void actionPerformed(ActionEvent event)
    {  Object source = event.getSource();
    lMsg.setText(" Enter up to $1.00");
    // Customer puts money in the vending machine.
    // Customer paid a nickle
    if (source == bNickle && $collected < 96)
    {  changeOH.nickleIn();
    $collected = $collected + 5;
    // Customer paid a dime
    if (source == bDime && $collected < 91)
    {  changeOH.dimeIn();
    $collected = $collected + 10;
    // Customer paid a quarter
    if (source == bQuarter && $collected < 76)
    {  changeOH.quarterIn();
    $collected = $collected + 25;
    // Customer paid a paper dollar
    if (source == b$Paper && $collected == 0)
    {  changeOH.dollarPaperIn();
    $collected = $collected + 100;
    // Customer paid a coin dollar
    if (source == b$Coin && $collected == 0)
    {  changeOH.dollarCoinIn();
    $collected = $collected + 100;
    // Customer makes their product selection.
    for (int i=0; i<6; i++)
    {  if (source == selBtn[i])
    // Do nothing if customer selects item that isn't on-hand.
    if (productForSale[i].getOnHand() == 0)
    repaint();
    // We have product on-hand.
    else
    {  prodSel = i;
    // Tell customer to add more money if they don't have
    // enough in the machine to handle the purchase.
    if ($collected < (int) (productForSale[i].getPrice() * 100))
    { lMsg.setText("    Insert Money");
    // Customer has enough money in machine to cover purchase.
    else
    {  // Take cost of item from customer's money
    dbl4 = productForSale[i].getPrice() * 100;
    int4 = changeOH.giveChange($collected - (int)dbl4,0);
    // Tell customer to put exact amount in the machine
    // because there isn't enough change to handle purchase.
    if (int4 == 9)
    {  lMsg.setText("Exact Amount Only!");
    // **** Here the purchase was made and committed. ****
    else
    {  total$In = productForSale[i].getPrice() * 100;
    $collected = $collected - (int) total$In;
    productForSale[i].sellProduct();
    dispense = i;
    repaint();
    // If the last product item was sold, set picture to OutStock.gif.
    if (productForSale[i].getOnHand() <= 0)
    productForSale[i].setOutOfStock();
    if ((source == bChange || source == quit) && $collected > 0)
    {  $collected = changeOH.giveChange($collected,1);
    // Here we save the machine info file when customer asks
    // for their change back or quits the machine.
    // Customer has selected to Quit the vending machine program.
    // Quit the program.
    if (source == quit)
    System.exit(0);
    // These commands set up variables to show how much money
    // the customer has in the machine.
    total$In = $collected;
    total$In = total$In / 100;
    lCredit.setText(" Credit: " + nf.format(total$In));
    repaint();
    } // =======>> END OF ACTIONPERFORMED METHOD
    // ** PAUSE METHOD **
    public void pause(int i)
    {  for(long l = System.currentTimeMillis() + (long) i; System.currentTimeMillis() < l;);
    // =======>> END OF VENDMACH CLASS APPLET
    // ** CASHIN CLASS **
    class CashIn
    {  private String logo1;
    private String logo2;
    private int numProd;
    private int nickles;
    private int dimes;
    private int quarters;
    private int dollarsP;
    private int dollarsC;
    private int money;
    private double moneyVal;
    private int amtToChange = 0;
    private int hNickle;
    private int hDime;
    private int hQuarter;
    private int hpDollar;
    private int hcDollar;
    public CashIn(String l1, String l2, int p, int q, int d, int n, int dP)
    {  logo1    = l1;
    logo2 = l2;
    numProd = p;
    quarters = q;
    dimes = d;
    nickles = n;
    dollarsP = dP;
    dollarsC = 0;
    money = (n * 5) + (d * 10) + (q * 25) + (dP * 100);
    // Get total of money in machine.
    public double getCashIn()
    {  moneyVal = money;
    moneyVal = moneyVal / 100;
    return moneyVal;
    // Get machine record information.
    public String getLogo1()
    {  return logo1;
    public String getLogo2()
    {  return logo2;
    public int getNumProd()
    {  return numProd;
    public int getNickles()
    {  return nickles;
    public int getDimes()
    {  return dimes;
    public int getQuarters()
    {  return quarters;
    public int getDollarPaper()
    {  return dollarsP;
    public int getDollarCoins()
    {  return dollarsC;
    // Money comes into the machine
    public void nickleIn()
    {  nickles++;
    money = money + 05;
    public void dimeIn()
    {  dimes++;
    money = money + 10;
    public void quarterIn()
    {  quarters++;
    money = money + 25;
    public void dollarPaperIn()
    {  dollarsP++;
    money = money + 100;
    public void dollarCoinIn()
    {  dollarsC++;
    money = money + 100;
    // Give the customer their change.
    public int giveChange(int custMoney, int mode)
    {  hNickle   = nickles;
    hDime = dimes;
    hQuarter = quarters;
    hpDollar = dollarsP;
    hcDollar = dollarsC;
    amtToChange = custMoney / 100;
    for (int i=0; i<amtToChange; i++)
    {  // Give change in dollar coin if possible
    if (hcDollar > 0)
    {  hcDollar--;
    custMoney = custMoney - 100;
    // or else give change in paper dollar
    else
    {  if (hpDollar > 0)
    {  hpDollar--;
    custMoney = custMoney - 100;
    amtToChange = custMoney / 25;
    for (int i=0; i<amtToChange; i++)
    {  if (hQuarter > 0)
    {  hQuarter--;
    custMoney = custMoney - 25;
    amtToChange = custMoney / 10;
    for (int i=0; i<amtToChange; i++)
    {  if (hDime > 0)
    {  hDime--;
    custMoney = custMoney - 10;
    amtToChange = custMoney / 5;
    if (amtToChange > hNickle)
    {  mode = 9;
    for (int i=0; i<amtToChange; i++)
    {  hNickle--;
    custMoney = custMoney - 5;
    if (mode == 1)
    {  nickles   = hNickle;
    dimes = hDime;
    quarters = hQuarter;
    dollarsP = hpDollar;
    dollarsC = hcDollar;
    money = money - custMoney;
    if (mode == 9) custMoney = 9;
    return custMoney;
    } // =======>> END OF CASHIN CLASS
    // ** PRODUCT CLASS **
    class Product
    {  private String name;
    private String image;
    private String picUsed;
    private double price;
    private int onHand;
    private int sold;
    private int maint;
    public Product(String n, String i, double p, int o, int s, int m)
    {  name    = n;
    image = i;
    picUsed = i;
    price = p;
    onHand = o;
    sold = s;
    maint = m;
    // Reset picture used when product is out of stock.
    public void setOutOfStock()
    {  picUsed  = "OutStock.gif";
    // Get product information
    public String getName()
    {  return name;
    public String getImage()
    {  return image;
    public String getPic()
    {  return picUsed;
    public double getPrice()
    {  return price;
    public int getOnHand()
    {  return onHand;
    public int getQtySold()
    {  return sold;
    public int getMaintDate()
    {  return maint;
    // Sell one of the product.
    public void sellProduct()
    {  onHand--;
    sold++;
    // Set the product values.
    public void setName(String n)
    {  name = n;
    public void setImage(String i)
    {  image   = i;
    picUsed = i;
    public void setPrice(double p)
    {  price = p;
    public void setOnHand(int o)
    {  onHand = o;
    public void setQtySold(int s)
    {  sold = s;
    public void setMaintDate(int m)
    {  maint = m; }
    this is the text file
    p,Fritos,Images/FritoLay.gif,
    m,$.50,
    p,Dr. Pepper,Images/Dr.Pepper.gif,
    m,$.60,
    p,Pepsi,Images/Pepsi.gif,
    m,$.60,
    p,Coke,Images/CocaCola.gif,
    m,$.60,
    p,Seven-Up,Images/7-Up.gif,
    m,$.60,
    p,Sprite,Images/Sprite.gif,
    m,$.60,
    c,10,20,40,
    i know that the filereader is supposed to read the fields...i guess i just have a weak start on understanding and implementing arrays.

    I write this sample some time ago, you can use it to start a new project
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class CVM extends JFrame 
         JTextField mw = new JTextField("0");     
         JTextField hf = new JTextField("0");     
         JTextField ds = new JTextField("0");     
         JTextField lr = new JTextField("0");     
         JTextField py = new JTextField("0");     
         JTextField tp = new JTextField("0");     
         JTextField ch = new JTextField("0");     
    public CVM()
         super("Chocolate Vending Machine");
         setBounds(0,0,500,400);
         addWindowListener(new WindowAdapter()
         {      public void windowClosing(WindowEvent ev)
                   dispose();
                   System.exit(0);
         JPanel pan = new JPanel();
    //     pan.setLayout(new GridLayout(0,2,4,4));
         JPanel lp = new JPanel();
         lp.setBackground(Color.pink);
         lp.setLayout(new GridLayout(16,2,4,4));
         addButton(lp,"Milky Way    20$",mw);
         addButton(lp,"Hot Fudge    40$",hf);
         addButton(lp,"Dandy Shandy 50$",ds);
         addButton(lp,"Lovers Rock  80$",lr);
         addClearButton(lp);
         lp.add(new JLabel(""));
         lp.add(new JLabel(""));
         addPayButtons(lp);
         addMoneyBack(lp);
         pan.add(lp);
         setContentPane(pan);
         setVisible(true);
    private void addPayButtons(JPanel pan)
         JPanel lp = new JPanel();
         lp.setOpaque(false);
         lp.setLayout(new GridLayout(0,2,4,4));
         JButton b1 = new JButton("Pay 5");
         addPay(b1,5);
         b1.setMargin(new Insets(0,0,0,0));
         JButton b2 = new JButton("Pay 10");
         addPay(b2,10);
         b2.setMargin(new Insets(0,0,0,0));
         lp.add(b1);
         lp.add(b2);
         pan.add(lp);
         lp = new JPanel();
         lp.setOpaque(false);
         lp.setBackground(Color.cyan);
         lp.setLayout(new GridLayout(0,2,4,4));
         JButton b3 = new JButton("Pay 20");
         addPay(b3,20);
         b3.setMargin(new Insets(0,0,0,0));
         JButton b4 = new JButton("Pay 50");
         addPay(b4,50);
         b4.setMargin(new Insets(0,0,0,0));
         lp.add(b3);
         lp.add(b4);
         pan.add(lp);
         pan.add(new JLabel("    Payd"));
         pan.add(py);
    private void addPay(JButton bt, final int i)
         bt.addActionListener(new ActionListener()
         {     public void actionPerformed( ActionEvent e )
                   int n = Integer.parseInt(py.getText())+i;
                   py.setText(""+n);
                   calculate();
    private void addButton(JPanel pan, String s, final JTextField jt)
         JButton    bt = new JButton(s);
         bt.setHorizontalAlignment(SwingConstants.LEFT);
         bt.setMargin(new Insets(0,0,0,0));
         pan.add(bt);
         bt.addActionListener(new ActionListener()
         {     public void actionPerformed( ActionEvent e )
                   int i = Integer.parseInt(jt.getText())+1;
                   jt.setText(""+i);
                   calculate();
         jt.setHorizontalAlignment(SwingConstants.CENTER );
         jt.setEditable(false);
         jt.setBackground(Color.white);
         pan.add(jt);
    private void calculate()
         int nwi = Integer.parseInt(mw.getText()) * 20;       
         int hfi = Integer.parseInt(hf.getText()) * 40;  
         int dsi = Integer.parseInt(ds.getText()) * 50;  
         int lri = Integer.parseInt(lr.getText()) * 80;  
         int t   = nwi+hfi+dsi+lri;
         if (t >= 100) t = t - (t/10);
         tp.setText(""+t);
         int n = Integer.parseInt(py.getText());
         int c = n-t;
         ch.setText(""+c);
    private void addClearButton(JPanel pan)
         pan.add(new JLabel("    To pay"));
         pan.add(tp);     
         JButton    bt = new JButton("Clear");
         bt.setHorizontalAlignment(SwingConstants.CENTER);
         bt.setMargin(new Insets(0,0,0,0));
         pan.add(bt);
         bt.addActionListener(new ActionListener()
         {     public void actionPerformed( ActionEvent e )
                   mw.setText("0");       
                   hf.setText("0");  
                   ds.setText("0");  
                   lr.setText("0");  
                   tp.setText("0");  
         pan.add(new JLabel(""));
    private void addMoneyBack(JPanel pan)
         JButton    bt = new JButton("Money back");
         bt.setHorizontalAlignment(SwingConstants.CENTER);
         bt.setMargin(new Insets(0,0,0,0));
         pan.add(bt);
         bt.addActionListener(new ActionListener()
         {     public void actionPerformed( ActionEvent e )
                   py.setText("0");
                   ch.setText("0");
         pan.add(new JLabel(""));
         pan.add(new JLabel("    Change"));
         pan.add(ch);     
    public static void main( String[] args)
         new CVM();
    }Noah

Maybe you are looking for

  • Error Code "-5002" While adding a Goods Issue Document

    Hi, While adding a goods issue document for only a specific combination of items I get "Internal Error (-5002) occured" message. The scenario is i am adding 5 rows with following specification Row1- Serial Managed Item Row2- Batch Managed Item Row3-

  • Help please! CC Desktop fails to install -- Adobe cleaner has errors...

    Migod, this CC business is more trouble than it is worth. My latest problem is that I cannot update CC Desktop. I followed the steps outlined in another post, to wit: I downloaded and ran the cleaner tool. It completed, but with errors. I tried to re

  • Cluster 3.0 and CVM

    My configuration is: ) the servers are E6500 ) I have 2 nodes (A and B) ) I installed Cluster 3.0, Volume Manager 3.2, CVM and Oracle I need to make a File System. For example /test. I need to work with this File System in parallel. Domain A ) /test

  • Error in CC 5.2 (Java.lang.indexOutOfBoundException)

    Hello All, When i logon to CC 5.2, I always get the following error on the bottom of the page:  java.lang.IndexOutOfBoundsException: Index: 2, Size: 1 Does anybody have any idea how to fix it ? Best Regards, Amol Bharti

  • Error in RTPPlayerAppet.java

    hi, I tried the sample code RTPPlayerApplet.java, when i compiled it i got the error Package RTP does not exist. Can anybody tell me how to solve this error? Thanks, Kalpana.