Java in 24 hours

i am just finishing java in 24 hours. but i am having trouble downloading files from the website www.java24hours.com. i also need to know how to put it into the same file as my java programs. how do i do it?

Usually, that's the first chapter in the book.
It's possible you're having trouble downloading the files because the website wasn't working when you tried it. Try again when you next have a chance.
As for actually setting up Java and making the files work - it really should be in the book. Don't get me wrong, but if the book doesn't tell you how to use the example files, then you really shouldn't trust the book to teach you how to program.
I would strongly recommend O'Reilly's "Learning Java" instead. Notice there's no "24 hours" in the title. "Learning Java" is much more thorough and will teach you far more than you can learn in 24 hours.

Similar Messages

  • Java Icon set: Hour glass??

    Hi y'all!!
    I know of the free graphics repository that provides a set of basic icons
    http://java.sun.com/developer/techDocs/hi/repository/
    but this set doesn't contain what I need for my app:
    I would like an hour glass, like the one displayed when you change the mouse cursor to a waiting cursor, but this should be in the Metal Java look and feel.
    If anyone out there knows of anyother graphics repositories which may have an hourglass.. or if you know how else I can obtain one.. please, please could you tell me! You'd be saving me a lot of unnecessary time in painfully drawing one in an icon editor.
    Thanks in advance you guys - later Edd

    Hmmm, google images "hourglass cursor" and may be:
    http://www.uni-heidelberg.de/images/index_AIcons_appl_cursor.html

  • 'Unable to Launch Application Error' - Java Web Start Running Under MS IIS.

    I am attempting to render the following .jnlp in MS IE:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for LottoMadness Application -->
    <jnlp
       codebase="http://localhost/LottoMadness/"
       href="LottoMadness.jnlp">
       <information>
         <title>LottoMadness Application</title>
         <vendor>Rogers Cadenhead</vendor>
         <homepage href="http://localhost/LottoMadness/"/>
         <icon href="lottobigicon.gif"/>
       </information>
       <resources>
         <j2se version="1.5"/>
         <jar href="LottoMadness.jar"/>
       </resources>
       <application-desc main-class="LottoMadness"/>
    </jnlp>I've deployed the .jnlp, .gif, and .jar to MS IIS, running locally on my PC.
    When I attempt to render the .jnlp in IE I obtain an 'Application Error' window stating 'Unable to Launch Application'. Clicking details gives me:
    com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://localhost/LottoMadness/LottoMadness.jnlp
         at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
         at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
         at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
         at com.sun.javaws.Launcher.launch(Unknown Source)
         at com.sun.javaws.Main.launchApp(Unknown Source)
         at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
         at com.sun.javaws.Main$1.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)I have configured MS IIS for Web Start, by setting the Extension/Content Type fields to .jnlp and application/x-java-jnlp-file.
    (The .jnlp is basically from 'Programming with Java in 24 Hours', as this is the book I am learning Java from.)

    AndrewThompson64 wrote:
    I am not used to seeing references to a local server that do not include a port number.
    E.G. http://localhost:8080/LottoMadness/
    I have deployed the following HTML (HelpMe.html) to the web server:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>Untitled</title>
    </head>
    <body>
    Help Me!
    </body>
    </html>When I attempt to render the URL in IE, I see the page just fine. The URL is use is:
    http://localhost/LottoMadness/HelpMe.htmlSo, I think my web server setup and usage is ok.
    >
    As an aside, what happens if (your MS IIS is running and) you click a direct link to..
    [http://localhost/LottoMadness/LottoMadness.jnlp|http://localhost/LottoMadness/LottoMadness.jnlp]
    When I click this link I get the error and exception I cited in my previous post.

  • Emulator runtime error - java.lang.IllegalAccessException

    Hi
    Im working through some example code, and when i build, everything is fine, with no errors, however when i run in the emulator, even though at this moment the program actually does nothing, its just a skeleton, i get the following error:
    Unable to create MIDlet MyC
    java.lang.IllegalAccessException
    at com.sun.midp.midlet.MIDletState.createMIDlet(MIDletState.java:148)
    at com.sun.midp.midlet.Selector.run(Selector.java:151)
    For hours, i have been pondering over the code, but the answer eludes me as to why i get this error
    Here is the main midlet:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.lcdui.game.*;
    public class my extends MIDlet implements CommandListener {
    private MyC canvas;
    public void startApp() {
    if (canvas == null) {
    canvas = new MyC(Display.getDisplay(this));
    Command exitCommand = new Command("Exit", Command.EXIT, 0);
    canvas.addCommand(exitCommand);
    canvas.setCommandListener(this);
    // Start up the canvas
    canvas.start();
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {
    canvas.stop();
    public void commandAction(Command c, Displayable s) {
    if (c.getCommandType() == Command.EXIT) {
    destroyApp(true);
    notifyDestroyed();
    here is the class it uses:
    import javax.microedition.lcdui.*;
    import javax.microedition.lcdui.game.*;
    import java.util.*;
    import java.io.*;
    public class MyC extends GameCanvas implements Runnable
    private Display display;
    private Sprite playerSprite;
    private boolean sleeping;
    private long framedelay;
    public MyC(Display d)
    super(true);
    display = d;
    framedelay = 33;
    public void start()
    display.setCurrent(this);
    try
    playerSprite = new Sprite(Image.createImage("/player.png"),12,12);
    catch (IOException e){}
    sleeping = false;
    Thread t = new Thread(this);
    t.start();
    public void stop()
    public void run()
    Graphics g = getGraphics();
    while (!sleeping)
    update();
    draw(g);
    try
    Thread.sleep(framedelay);
    catch (InterruptedException ie) {}
    private void update()
    return;
    private void draw(Graphics g)
    playerSprite.paint(g);
    flushGraphics();
    }

    im using j2me, and yes, i have gone straight for
    mobile phone midlet programming. That isn't going to be easy.
    When i remove the
    detail at the end of the constructor, the code wont
    exectute at all. By looking at the code i presented
    here, is there anything noticeable as to why i keep
    getting this error?"Won't execute" doesn't tell me anything.
    Removing the parameter means that you need to do other things to the code because there will be undefined items.
    If you are copying code exactly as it appears in a tutorial then you need to be aware that you might be working with different versions of code (java and midlet) and/or there might be mistakes in the tutorial. Of course if you modified the tutorial code then you could be introducing problems as well. You can look for other sources of documentation which might provide more information as to what a minimal set up looks like.

  • App Deployment out of hours

    Hi,
    We are trying to set up our deployments in sccm 2012 to wake up pc out off hours to install software and for the most part this works, however the problem we have is that if for whatever reason a pc doesn't get woken up (no power plugged in, no network connectivity
    etc) it will not get the software and will not be woken up again by system center. The only way we can make this happen is by changing the deployment available time or the install deadline, as this seems to trigger sccm to send out wake up packets again. The
    problem we have with this is that all pc's will wake up again even though there is nothing to be installed on them, so potentially we would have 50 pc's wake up just so 1 or 2 pc's can install some software.
    For example, we want to install java out of hours so we have a deployment targeting a "java installed" collection and the deployment is set to send wake up packets. We schedule it to be available at 11pm and the deadline to be as soon
    as possible. When the app becomes available, system center will send out the wake up packets and any pc's that can wake up will wake up and install the software with out causing any hassle to our users. Now, some pc's won't wake up for whatever reason and
    therefore won't install the software, the user will come in and turn there pc on as normal and then the computer agent will realise that it needs java and try and install it. This means that we could end up with error messages coming up because the user has
    a browser window open or even worse the browser window could close unexpectedly and lose any work the user was doing. We can't have this happen so we would implement a maintenance window to stop this, now the problem would be that come the start of the maintenance
    window that evening, the pc will be turned off but system center won't wake the machine up because the deadline has passed. We would also run into this problem when adding a new machine to the collection, wol won't work because the deadline has passed.
    Is there something we are missing here as it seems the wol functionality in system center is very dum and doesn't recognise non compliant machines?
    Thanks

    Using the built-in toolset, no, there's nothing that will really do this automatically as ConfigMgr has no way truly tracking which systems were and were not woken up and then correlating that with successful deployment execution. Not that is couldn't
    be made to this with some extra design, development, and coding, but it simply doesn't.
    You could though. Based on the compliance of a deployment, you could create a collection of systems where the deployment hasn't run (dynamic based on the compliance) and target a simple package (that doesn't do anything) but would trigger ConfigMgr
    to send a OWL packet. This deployment would execute every night and the collection would contain systems that have not successfully completed any deployments you wish to push put this way.
    Note that if the users aren't logging off at the end of the day though, you've pretty much got the same problems though.
    Another way to handle this is to let the users known why going on using something like the PowerShell Deployment Toolkit on CodePlex.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Interesting difference between books and tutorials

    I started coding in Java about four years ago. When I started I learned from a book (that I no longer have), I think it was "Sam's Teach Yourself Java in 24 Hours". I was just a kid then and I became fairly proficient in all of the basic requirements and such. Now, four years later, I am looking into getting back to Java when I can find the time, and possibly getting a certification. Instead of the book, I now use the online tutorials and API docs. Something I noticed about the tutorials is that they use coding methods that I never saw in the book. For instance from this tutorial on using the SpringLayout, the code follows this syntax:
    import /*neccessary items*/
    public class SpringDemo1 {
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the                  <----I didn't add this. Guessing it has something
         * event-dispatching thread.                                    to do with preventing the thread from crashing...?
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("SpringDemo1");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //SpringLayout code here....
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }whereas, when I learned from the book, I always did this and I still do:
    import /*neccessary items*/
    public class myClass extends JFrame {
        public myClass() {
            //set up GUI here
        public static void main(String args[]) {
            myClass mc = new myClass();
    }If I am going to get my certification, I don't want to be using practices that could cause a program to crash and get someone angry at me. If I am doing something wrong, please chew me out. It's better than losing a job...

    The book is old-fashioned, that's all. Neither version of the code is so bad that it will crash and you will lose your job and become a drug addict accosting people on the street for money.
    The "extends JFrame" version was the usual way to write things back in the early days of Java. And then people started thinking more about object orientation, and noticed that there was nothing in most Swing programs which created a modified JFrame. They simply used the features of a JFrame to get their work done.
    So under the flag of "Prefer composition to inheritance", the OO people rewrote the standard Swing application to do that. And so they should... Java is an object-oriented language, after all, so why not do things right? Let's not extend JFrame (inheritance) if we can just create one and use it (composition).
    Of course they couldn't go back and change all the paper books and all the thousands of programs that people had already written in the old way, but they could change the tutorials. And they did.
    So my suggestion would be to follow the style shown in that tutorial. You won't lose your job over it. In fact being able to explain why you did it might even improve your status at your job.

  • To store value

    SO PLEASE RUN THIS CODE AND TRY TO RECTIFY THE ERROR AND SOLVE THIS PROBLEMS.
    I WILL PLACE THESE TYPE TEXT NEAR BUYME BUTTON
    WHEN RUN THIS CODE FIRST IT WILL COME SCREEN LIKE "WELCOME TO SHOPPING CART"
    SELECT BOOKS AND CLICK ON SHOP YOU WILL COME "BOOK CATALOGUE" SCREEN
    TYPE AN INTEGER VALUE IN QUANTITY FIELD LIKE(2 OR 3 OR 4)
    WHEN YOU CLICK ON BUYME BUTTON THE DATA SHOULD GET SAVED WHICH IS NOT HAPPENING
    IF YOU COULD RESOLVE THIS PROBLEM IT WOULD BE GREAT
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.io.*;
    public class Cart extends Frame implements ActionListener,ItemListener
         Color c;
         CheckboxGroup cbg;
         Label welcome, Se;
         Checkbox Acces, Books, Comp;
         static int Cho=0;
         protected Button shop, exit;
         TextArea inst;
         String str;
         Panel p1,p2,p3,p4,p5;
         Font f1,f2;
         static Valimesg     s0          = null;
         static Cart s1     = null;
         static Books s2               = null;
         //static Computers s3          = null;
         //static Accessories s4     = null;     
         static Purchase s5 = null;
         static Reviewcart s6 = null;
         static {
              s1     = new Cart();
    //          s0     = new Valimesg();
    /*          s2     = new Books();
              s3     = new Computers();*/
         Cart()
         setSize(1025,750);
         setLayout(new BorderLayout());
         str= " Instructions for using the Shopping Cart\n"+
    " ------------------------------------------------------\n"+
    "1. Enter the Quantity of item desired and press the BUY ME button.\n" +
    "2. Repeat step 1 for each item to be purchased.\n"+
    "3. If the quantity is less than or equal to 0 then error message will arise.\n"+
    "4. Press the link Review Cart for review the bill.\n"+
    "5. You may change the quantity of an item on your order now.\n"+
    "6. Press the button labelled 'ReCalculate' to calculate and display the total amount to be paid.\n"+
    "7. Press the link 'Purchase order' in cart and then fill out the format"+"and then press the 'Buy Items'.\n"+
    "8. If unfilled fields in the purchase order format will not save.\n"+
    "9. You should receive a copy of the order in Your e-mail. \n"+
         "Please check this e-mail copy for accuracy, if inaccurate please notify us immmediately.";
         f1=new Font("Verdana", Font.PLAIN,18);
         f2=new Font("Verdana", Font.PLAIN,12);
         p1 = new Panel();     p1.setLayout(new FlowLayout());
         p2 = new Panel();     p2.setLayout(new BorderLayout());
         p3 = new Panel();     p3.setLayout(new BorderLayout());
         p4 = new Panel();     p4.setLayout(new FlowLayout());
         p5 = new Panel();     p5.setLayout(new GridLayout(1,3));
         Panel p6 =new Panel();          p6.setLayout(new GridLayout(3,1));
         Panel p7 = new Panel();          p7.setLayout(new GridLayout(3,1));
         Panel p8 = new Panel();          p8.setLayout(new FlowLayout());
         Panel p9 = new Panel();          p9.setLayout(new BorderLayout());
         Panel p10 =new Panel();          p10.setLayout(new BorderLayout());
         Panel p11 =new Panel();          p11.setLayout(new BorderLayout());
         Panel p12 =new Panel();          p12.setLayout(new BorderLayout());
         Panel p13 =new Panel();          p13.setLayout(new BorderLayout());
         Panel p14 =new Panel();          p14.setLayout(new FlowLayout());
         Panel p15 = new Panel();          p15.setLayout(new FlowLayout());
              welcome = new Label("WELCOME TO SHOPPING CART");
              cbg = new CheckboxGroup();
              Se = new Label("The following are the items available: ");
              Acces = new Checkbox("Accessories",cbg,true);
              Books = new Checkbox("Books",cbg,false);
              Comp = new Checkbox("Computers",cbg,false);
              Button shop = new Button("Shop");
              Button exit = new Button("Exit");
              inst= new TextArea(str, 7, 500);
              inst.setEditable(false);
              welcome.setFont(f1);
              inst.setFont(f2);          
              p1.setForeground(Color.blue);
              exit.addActionListener(this);
              Acces.addItemListener(this);
              Books.addItemListener(this);
              Comp.addItemListener(this);
              shop.addActionListener(this);
              add(Acces);
              add(Books);
              add(Comp);     
              add(inst);
              add(Se);
              p1.add(welcome);
              p2.add(inst, "North");
              p2.add(Se, "Center");
              p3.add(Acces, "North");
              p3.add(Books, "Center");
              p3.add(Comp, "South");
              p4.add(shop);
              p4.add(exit);
              p5.add(p6);//p5.add(p7);p5.add(p8);
              p6.add(p2); p6.add(p3); p6.add(p11);
              //p7.add(p12); p7.add(p13); p7.add(p14);
              //p8.add(p15);
              add(p1, "North");
              add(p5, "Center");
              add(p4, "South");     
    addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent we)
                        System.exit(0);
    }     //ends Cart constructor
    public void actionPerformed (ActionEvent ae)
              try
                   if (ae.getActionCommand().equalsIgnoreCase("Shop"))
                        System.out.println(Cho);
                        if(Cho == 1) {
                             try
                                  s2 = new Books();
                                  s1.setVisible(false);
                                  s2.setVisible(true);
                                  s2.show();
                             catch (Exception e)
                                  System.out.println(e);
                        /*else if(Cho == 2) {
                             try
                                  s3 = new Computers();
                                  s1.setVisible(false);
                                  s3.setVisible(true);
                                  s3.show();
                             catch (Exception e)
                                  System.out.println(e);
                        else {
                             try {
                                  s4 = new Accessories();
                                  s1.setVisible(false);
                                  s4.setVisible(true);
                                  s4.show();
                             catch (Exception e)
                                  System.out.println(e);
                   if (ae.getActionCommand().equalsIgnoreCase("Exit"))
                   System.exit(0);
              catch(Exception e)
                   System.out.println(e);
    public void itemStateChanged(ItemEvent ie)
    String sel;
    sel = cbg.getSelectedCheckbox().getLabel();
         if(sel.equals("Books"))
              Cho = 1;
         else if(sel.equals("Computers"))
              Cho = 2;
         else
              Cho = 0;
    public static void main(String[] args)
         s1 = new Cart();
         s1.show();
    /* function to check for Valid quantity number*/
    public static int Valinum(int val)
    try
                   int test=val;
                   if(test <= 0) {
                        return 0;
                   else {
                        //s0 = new Valimesg();
                        s0.show();
                        return 1;
         catch(NumberFormatException nfe)
              //s0 = new Valimesg();
              s0.show();
              s2.setVisible(false);
              s0.setVisible(true);
              //System.out.println(nfe);
    return 0;
    }     //ends Valinum function
    public class Valimesg extends Cart
         Font f ;
         Panel p1;
         Label mesg;
         Valimesg(){
              f = new Font ("Verdana",Font.PLAIN,18);
              p1 = new Panel();
              p1.setLayout(new FlowLayout());
              mesg=new Label("Enter a valid number");
              add(p1);
              p1.add(mesg);
              p1.setFont(f);
              addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent we)
                        System.exit(0);
    }     //ends Valimesg class
    public class Books extends Cart
         TextField code, price, qty;
    TextArea desp;
         int it_code[] = {1000, 1001, 1002};
    int it_qty[] = {0,0,0};
    String it_price[] = {"125", "150", "100"};
    String des[] = {"This books combines a general introduction to\n"+"application layer network programming with\n"+"complete coverage of Java's networking classes\n",
    "See C through your eyes ! We bring exclusively for you,\n"+"by Yeshwant Kaniktar [Author] print by PBP\n",
    "Red Hat Linux 6 Unleashed shows you how to install, \n"+" configure, and manage version 6.0, the latest \n"+" version of Red Hat operating system."};
         Choice books;
         Button Home, Purchase, Buyme,Review;
         Label itcode, Description, Shopcart, Category, cost, Quantity,cat;
         Panel p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19;
    Books()
         Home = new Button("Home");
    Purchase = new Button("Purchase");
    Review = new Button("Review Cart");
    Buyme = new Button("BuyMe");
    p1 = new Panel();     p2 = new Panel();
    p3 = new Panel();     p4 = new Panel();     
    p5 = new Panel();     p6 = new Panel();
    p7 = new Panel();     p8 = new Panel();
    p9 = new Panel();     p10 = new Panel();
    p11 = new Panel();     p12 = new Panel();
    p13 = new Panel();     p14 = new Panel();
    p15 = new Panel();     p16 = new Panel();
    p17 = new Panel();     p18 = new Panel();
    p19 = new Panel();
         p1.setLayout(new GridLayout(2,1)); p2.setLayout(new GridLayout(1,2)); p3.setLayout(new GridLayout(2,1));
         p4.setLayout(new FlowLayout()); p5.setLayout(new FlowLayout()); p6.setLayout(new FlowLayout()); p7.setLayout(new FlowLayout());
         p8.setLayout(new FlowLayout()); p9.setLayout(new FlowLayout()); p10.setLayout(new FlowLayout()); p11.setLayout(new FlowLayout()); p19.setLayout(new FlowLayout());
         p12.setLayout(new FlowLayout()); p13.setLayout(new FlowLayout()); p14.setLayout(new FlowLayout()); p15.setLayout(new FlowLayout()); p16.setLayout(new FlowLayout());
         p17.setLayout(new GridLayout(5,1)); p18.setLayout(new GridLayout(5,1));
    Shopcart = new Label("BOOK CATALOGUE");
    itcode = new Label("Item Code");
    Description = new Label("Description");
    Category = new Label("Category");
    cost = new Label("Cost");
    Quantity = new Label("Quantity");
    cat = new Label("Books");
    books = new Choice();
    books.add("Learn Java in 2 hours");
    books.add("C has never been so e'c'");
    books.add("Red Hat Linux");
    books.addItemListener(this);
    code = new TextField(10);     code.setEditable(false); code.setText("1000");
    price = new TextField(10);     price.setEditable(false); price.setText("125");
    qty = new TextField(10);          
    desp = new TextArea(des[0], 5,50); desp.setEditable(false);
              p4.add(books);
              p5.add(Shopcart);
              p6.add(itcode);
              p7.add(Description);
              p8.add(cost);
              p9.add(Quantity);
              p10.add(Category);
              p11.add(code);
              p12.add(desp);
              p13.add(price);
              p14.add(qty);
              p19.add(cat);
              p16.add(Buyme);
              p16.add(Home);
              p16.add(Purchase);
              p16.add(Review);
              p1.add(p4); p1.add(p5);
              p2.add(p17); p2.add(p18);
              p17.add(p6); p17.add(p7); p17.add(p8); p17.add(p9); p17.add(p10);      
              p18.add(p11); p18.add(p12); p18.add(p13); p18.add(p14); p18.add(p19);
              p3.add(p16);          
              add(p1, "North");
              add(p2, "Center");
              add(p3, "South");
    Home.addActionListener(this);
    Purchase.addActionListener(this);
    Review.addActionListener(this);
         Buyme.addActionListener(this);
         addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent we)
                        System.exit(0);
    public void itemStateChanged(ItemEvent ie1)
         System.out.println(books.getSelectedIndex());
         code.setText(String.valueOf(it_code[books.getSelectedIndex()]));
         price.setText(it_price[books.getSelectedIndex()]);
         desp.setText(des[books.getSelectedIndex()]);
         qty.setText("");
    public void actionPerformed(ActionEvent ae)
              try
                   if (ae.getActionCommand().equalsIgnoreCase("BuyMe"))
                        try
                        int i,temp;
                        i=books.getSelectedIndex();
                        temp=Integer.parseInt(qty.getText());
                        int c=Cart.Valinum(temp);
                   if (c==1)
    /* MY PROBLEM IS WHEN I ENTER A QUANTITY FIELD ITS NOT STORING THE VALUE IN A VARIABLE it_qty[i] IN BOOK CLASS WHEN I CLICK ON BUYME BUTTON*/
                             it_qty=Integer.parseInt(qty.getText());
                             qty.setText("");
                        else {
                             qty.setText("");
                        temp=0;
                        catch (Exception e)
                        //System.out.println(e);
                   if (ae.getActionCommand().equalsIgnoreCase("Home"))
                        try
                             s1.setVisible(true);
                             s1.show();
                             s2.setVisible(false);s5.setVisible(false);s6.setVisible(false);
                        catch(Exception e)
                             System.out.println(e);
                   if (ae.getActionCommand().equalsIgnoreCase("Purchase"))
                        try
                        {     s5 = new Purchase();
                             s5.setVisible(true);
                             s5.show();
                             s2.setVisible(false);s6.setVisible(false);
                        catch(Exception e)
                             System.out.println(e);
                   if (ae.getActionCommand().equalsIgnoreCase("Review Cart"))
                        try
                        {     s6 = new Reviewcart();
                             s6.setVisible(true);
                             s6.show();
                             s2.setVisible(false);s5.setVisible(false);
                        catch(Exception e)
                             System.out.println(e);
              catch(Exception e)
                   System.out.println(e);
    }     //ends Books class
    public class Purchase extends Cart
         Label Name,Address,City,State,Zip;
         Label Phone,Fax,Email,Credit_card,CC_number,CC_owner,Comment,Expiry_date;
         TextField Name_text,Add_text,City_text,State_text,Email_text,CC_text,CCowner_text;
         TextField Phone_text,Fax_text,CCno_text,Zip_text;
         TextField Comments_text,Expdate_text;
         String Str;
         Panel p1,p2,p3,p4,p5,p6,p7,p8,p9,p10;
         Purchase()
              setLayout(new BorderLayout());
              Font f,f1;
              f = new Font ("Verdana",Font.PLAIN,14);
              setFont(f);
              f1 = new Font ("Verdana",Font.PLAIN,18);
              p1 = new Panel();
              p2 = new Panel();
              p3 = new Panel();
              p4 = new Panel();
              p5 = new Panel();
              p6 = new Panel();
              p7 = new Panel();
              p8 = new Panel();
              p9 = new Panel();
              p10 = new Panel();
              p1.setFont(f1);
              //panel3.setFont(f1);
              p1.setForeground(Color.blue);
              p1.setLayout(new FlowLayout());
              p2.setLayout(new GridLayout(8,1));
              p3.setLayout(new FlowLayout());
              p4.setLayout(new FlowLayout());
              p5.setLayout(new FlowLayout());
              p6.setLayout(new FlowLayout());
              p7.setLayout(new FlowLayout());
              p8.setLayout(new FlowLayout());
              p9.setLayout(new FlowLayout());
              p10.setLayout(new FlowLayout());
              Label purchase = new Label("PURCHASE ORDER");
              Label Name = new Label("Name");
              Label Address = new Label("Address");
              Label City = new Label("City");
              Label State = new Label("State");
              Label Zip = new Label("Zip");
              Label Phone = new Label("Phone");
              Label Fax = new Label("Fax");
              Label Email = new Label("Email");
              Label Credit_card = new Label("Credit Card");
              Label CC_number = new Label("Credit Card Number");
              Label Expiry_date = new Label("Expiry Date");
              Label CC_owner = new Label("Credit Card Owner");
              Label Comment = new Label("Comment");
              Name_text = new TextField(40);
              Add_text = new TextField(60);
              City_text = new TextField(8);
              State_text = new TextField(10);
              Zip_text = new TextField(10);
              Phone_text = new TextField(10);
              Fax_text = new TextField(20);
              Email_text = new TextField(15);
              CC_text = new TextField(8);
              CCno_text = new TextField(16);
              Expdate_text = new TextField(10);
              CCowner_text = new TextField(20);
    Comments_text=new TextField(25);
              String Str = "";
              TextArea text2 = new TextArea(Str,2,75);
              add(Name_text);
              add(Add_text);
              add(City_text);
              add(State_text);
              add(Zip_text);
              add(Phone_text);
              add(Fax_text);
              add(Email_text);
              add(CC_text);
              add(CCno_text);
              add(Expdate_text);
              add(CCowner_text);
    add(Comments_text);
              Button Buyitems = new Button("Buy Items");
              Buyitems.addActionListener(this);
              Button Reset = new Button("Reset");
              Reset.addActionListener(this);
    Button home = new Button("Home");
              home.addActionListener(this);
              Button Review = new Button("Review Cart");
              Review.addActionListener(this);
              p1.add(purchase);
              p4.add(Name);
              p4.add(Name_text);
              p5.add(Address);
              p5.add(Add_text);
              p6.add(City);
              p6.add(City_text);
              p6.add(State);
              p6.add(State_text);
              p6.add(Zip);
              p6.add(Zip_text);
              p7.add(Phone);
              p7.add(Phone_text);
              p7.add(Fax);
              p7.add(Fax_text);
              p7.add(Email);
              p7.add(Email_text);
              p8.add(Credit_card);
              p8.add(CC_text);
              p8.add(CC_number);
              p8.add(CCno_text);
              p9.add(Expiry_date);
              p9.add(Expdate_text);
              p9.add(CC_owner);
         p9.add(CCowner_text);
              p10.add(Comment);
         p10.add(Comments_text);
              p3.add(Buyitems);
              p3.add(Reset);
              p3.add(home);
              p3.add(Review);
              add(p1,"North");
              add(p2 ,"Center");
              add(p3,"South");
              p2.add(p4);
              p2.add(p5);
              p2.add(p6);
              p2.add(p7);
              p2.add(p8);
              p2.add(p9);
              p2.add(p10);
    addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent we)
                        System.exit(0);
    public void actionPerformed (ActionEvent ae1)
         String str=ae1.getActionCommand();     
         if (ae1.getActionCommand().equalsIgnoreCase("Home"))
                        try
                             s1.setVisible(true);
                             s1.show();
                             s5.setVisible(false);s6.setVisible(false);s2.setVisible(false);
                        catch(Exception e)
                             System.out.println(e);
         if (ae1.getActionCommand().equalsIgnoreCase("Buy Items"))
    System.out.println("Items");
         if (ae1.getActionCommand().equalsIgnoreCase("Reset"))
              Name_text.setText("");
              Add_text.setText("");
              City_text.setText("");
    State_text.setText("");
              Zip_text.setText("");
              Phone_text.setText("");
              Fax_text.setText("");
              Email_text.setText("");
              CC_text.setText("");
              CCno_text.setText("");
              Expdate_text.setText("");
              CCowner_text.setText("");
         if (ae1.getActionCommand().equalsIgnoreCase("Review Cart"))
                        try
                        {     s6 = new Reviewcart();
                             s6.setVisible(true);
                             s6.show();
                             s5.setVisible(false);
                        catch(Exception e)
                             System.out.println(e);
    }     //ends Purchase class
    public class Reviewcart extends Cart
         Label Item,Quantity,Rate,Total,Amount,Shipping,Subtotal,Review;
         Button home,order,recal;
         //Review review;
         String Str;
         TextArea text3;
    Panel pan[] = new Panel[120];
         String lab[] = {"Sub-Total","Shipping","Total Amount"};
         TextField c[] = new TextField[10];
         Panel p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15;
         Font f,f1;
         Reviewcart()
              setLayout(new BorderLayout());
              f = new Font ("Verdana",Font.PLAIN,18);
              setFont(f1);
              f1 = new Font ("Verdana",Font.PLAIN,16);
              p1 = new Panel();
              p2 = new Panel();
              p3 = new Panel();
              p4 = new Panel();
              p5 = new Panel();
              p6 = new Panel();
              p7 = new Panel();
              p8 = new Panel();
              p9 = new Panel();
              p10 = new Panel();
              p11 = new Panel();
              p12 = new Panel();
              p13 = new Panel();
              p14 = new Panel();
              p15 = new Panel();
              p0 = new Panel();
              p2.setFont(f1);
              p1.setForeground(Color.blue);
              p4.setForeground(Color.blue);
              p1.setFont(f);
              p4.setFont(f);
              p1.setLayout(new FlowLayout());
              p2.setLayout(new BorderLayout());
              p3.setLayout(new FlowLayout());
         p0.setLayout(new GridLayout(2,1));
         p5.setLayout(new FlowLayout());
              p6.setLayout(new FlowLayout());
              p7.setLayout(new FlowLayout());
              p8.setLayout(new FlowLayout());
              p9.setLayout(new FlowLayout());
              p10.setLayout(new FlowLayout());
              p11.setLayout(new FlowLayout());
              p12.setLayout(new GridLayout(1,4));
              p13.setLayout(new FlowLayout());
              p4.setLayout(new FlowLayout());
              Review= new Label("REVIEW CART");
              Item = new Label("Items");
              Subtotal= new Label("Sub-Total");
              Shipping = new Label("Shipping");
              Amount = new Label("Amount");
              Rate = new Label("Rate");
              Quantity = new Label("Quantity");
              Total = new Label("Total Amount");
              home = new Button("Home");
              order = new Button("Purchase Order");
              recal = new Button("Re-Calculate");
              home.addActionListener(this);
              order.addActionListener(this);
              recal.addActionListener(this);
              Str = "Thank You for the Order\n"+
    "5% Sales Tax will be added to all MA Orders\n"+
    "Freight is based on Shipments within India only";
         text3 = new TextArea(Str,3,50);
              text3.setEditable(false);
              add(text3);
              add(p1,"North");
              add(p2 ,"Center");
              add(p3,"South");
              p1.add(text3);
              p3.add(recal);
              p3.add(home);
              p3.add(order);
              p4.add(Review);
              p5.add(Item);
              p6.add(Quantity);
              p7.add(Rate);
              p8.add(Amount);
              p9.add(Total);
              p10.add(Shipping);
              p11.add(Subtotal);
              p12.add(p5);
              p12.add(p6);
              p12.add(p7);
              p12.add(p8);
              p0.add(p4);
              p0.add(p12);
              p2.add(p0,"North");
    int start = 17;
    int iCount = 0,i,j=0;
    float Sbtot = 0.0f;
              for (i=0;i<3;i++)
                   if (Cart.s2.it_qty[i] != 0)
                        iCount++;
                        pan[start] = new Panel();
                        pan[start+1] = new Panel();
                        pan[start+2] = new Panel();
                        pan[start+3] = new Panel();
                        pan[start+4] = new Panel();
                        pan[start].setLayout(new GridLayout(1,4));
                        pan[start+1].setLayout(new FlowLayout());
                        pan[start+2].setLayout(new FlowLayout());
                        pan[start+3].setLayout(new FlowLayout());
                        pan[start+4].setLayout(new FlowLayout());
                        pl5.add(pan[start]);
                        pan[start].add(pan[start+1]);
                        pan[start].add(pan[start+2]);
                        pan[start].add(pan[start+3]);
                        pan[start].add(pan[start+4]);
                        pan[start+1].add(new Label(Cart.s2.it_code[i]));
    pan[start+2].add(new Label(Cart.s2.it_price[i]));     
                        c[j] = new TextField(5);
                   pan[start+3].add(c[j]);
                        c[j].setText(String.valueOf(Cart.s2.it_qty[i]));
                        float tot = (Cart.s2.it_qty[i]*(Float.parseFloat(Cart.s2.it_price[i])));
                        Sbtot = Sbtot + tot;
                        pan[start+4].add(new Label(String.valueOf(tot)));
                        start = start + 5;
                        j=j+1;
         }     //ends Reviewcart constructor
         public void actionPerformed (ActionEvent ae1)
         String str=ae1.getActionCommand();     
         if (ae1.getActionCommand().equalsIgnoreCase("Home"))
                        try
                             s1.setVisible(true);
                             s1.show();
                             s6.setVisible(false);s2.setVisible(false);s5.setVisible(false);
                        catch(Exception e)
                             System.out.println(e);
         if (ae1.getActionCommand().equalsIgnoreCase("Purchase Order"))
                        try
                        {     s5 = new Purchase();
                             s5.setVisible(true);
                             s5.show();
                             s6.setVisible(false);
                        catch(Exception e)
                             System.out.println(e);
         if (ae1.getActionCommand().equalsIgnoreCase("Re-Calculate"))
              int i,j=0;
              for (i=0;i<3;i++)
                   if (Cart.s2.it_qty[i] != 0)
                   Cart.s2.it_qty[i]=Integer.parseInt(c[j].getText());     
                   j=j+1;
              hide();
    }     //ends reviewCart class
    }     //ends Cart class

    Naveen,
    If you truely want someone to work with your code then you need to follow a few points of curtesy (I would say this thread is fairly dead).
    1.) When you post know that you need to use code tags to get the code to show indents, which will help anyone that may be willing to look at your code.
    2.) CAPITLAIZATIONS IN A TEXT MESSAGE IS CONSIDERED YELLING AT THE AUDIENCE.
    3.) post what you have done to correct the problem and what symptoms you see. Specific errors and where you believe you are having problems.
    4.) know this--if you cannot get it done, and are not seamingly willing to put any more effort into getting the problem corrected than putting it out on the web in a public forum and saying: "Here it is, fix it for me." Don't expect us to care if you fail your class or not. Many of us have already been through the classes and have had to do it ourselves or fail, so we buckled down and spent many sleep deprived years earning our degrees rather than asking others to do our work for us.
    If you want help, post in a new thread and follow some curtesy and formatting.

  • Problem redering h:outputText tag on a jsp fragment

    Hello to all... I'm trying to understand and use this new technology and I have encountered a problem that I cannot find any documentation as how to solve it. First I have my welcome.jsp page that I am using to call my fragment:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <f:view>
                <h1><h:outputText value="Java Server Faces" /></h1>
                <f:subview id="banner">
                    <c:import url="/banner.jsp"/>
                </f:subview>
            </f:view>
        </body>
    </html>then I have my jsp fragment, banner.jsp:
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
        <f:loadBundle basename="com.gm.gsip.messages" var="msgs"/>
        <table border="1">
            <tr>
                <td> <h:outputText value="#{msgs.hour}"/> � </td>
                <td> <h:outputText value="#{msgs.hour1}"/> �</td>
                <td> <h:outputText value="#{msgs.hour2}"/>� </td>
                <td> <h:outputText value="#{msgs.hour3}"/> �</td>
                <td> <h:outputText value="#{msgs.hour4}"/>� </td>
                <td> <h:outputText value="#{msgs.hour5}"/> �</td>
                <td> <h:outputText value="#{msgs.hour6}" /> �</td>
                <td> <h:outputText value="#{msgs.hour7}" /> �</td>
                <td> <h:outputText value="#{msgs.total}" />� </td>
            </tr>
        </table>My problem is that the <h:outputText> tag is rendering the values outside the table. This is what gets displayed:
    Java Server Faces
    Hour1234567TOTAL
    If I copy/paste the table tags (including the <h:outputText> tags) on the main jip, it renders without any problem:
    Java Server Faces
    Hour 1 2 3 4 5 6 7 TOTAL
    I'm guessing that I might be missing some other jsf tag inside the jsp fragment. Any help will be greatly appreciated.
    -thanks
    Rolando

    I can suggest you with the following solutions
    1. try having <%out.flush();%> before and after c:import
    2. try with jsp:include with flush=true
    Can you reply back with which one works? I didnt try out both of them
    Thanks

  • JVM core dump - JNI code

    I am using JNI in my Java application , 12 hours after running my test case get a JVM crash -
    1) These are the parameters with which i invoke my Java program
    java -d64 -Xcheck:jni -Xmx2560M -Xms2560M -Xss256k RunQueries
    2) The Heap output at the time of the core shows "from space" as 100% used , does this signify anything?
    Heap at VM Abort:
    Heap
    def new generation total 848128K, used 672342K [0xfffffffe93c00000, 0xfffffffec9150000, 0xfffffffec9150000)
    eden space 822464K, 78% used [0xfffffffe93c00000, 0xfffffffebb385b90, 0xfffffffec5f30000)
    from space 25664K, 100% used [0xfffffffec7840000, 0xfffffffec9150000, 0xfffffffec9150000)
    to space 25664K, 0% used [0xfffffffec5f30000, 0xfffffffec5f30000, 0xfffffffec7840000)
    tenured generation total 1747648K, used 1350866K [0xfffffffec9150000, 0xffffffff33c00000, 0xffffffff33c00000)
    the space 1747648K, 77% used [0xfffffffec9150000, 0xffffffff1b884830, 0xffffffff1b884a00, 0xffffffff33c00000)
    compacting perm gen total 16384K, used 13550K [0xffffffff33c00000, 0xffffffff34c00000, 0xffffffff37c00000)
    the space 16384K, 82% used [0xffffffff33c00000, 0xffffffff3493b860, 0xffffffff3493ba00, 0xffffffff34c00000)
    Local Time = Mon Feb 12 21:49:40 2007
    Elapsed Time = 61687
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.4.2_07-b05 mixed mode)
    3) A dbx on the Java core shows the location in the JNI code where the core dump occured.
    dbx `which java` core
    For information about new features see `help changes'
    To remove this message, put `dbxenv suppress_startup_message 7.3' in your .dbxrc
    Reading java
    dbx: internal warning: writable memory segment 0x7cb00000[16384] of size 0 in core
    core file header read successfully
    Reading ld.so.1
    Reading libthread.so.1
    Reading libdl.so.1
    Reading libc.so.1
    Reading libc_psr.so.1
    Reading libjvm.so
    Reading libCrun.so.1
    Reading libsocket.so.1
    Reading libnsl.so.1
    Reading libm.so.1
    WARNING!!
    A loadobject was found with an unexpected checksum value.
    See `help core mismatch' for details, and run `proc -map'
    to see what checksum values were expected and found.
    dbx: warning: Some symbolic information might be incorrect.
    t@1 (l@1) terminated by signal ABRT (Abort)
    0xffffffff7eea822c: lwpkill+0x0008: bcc,a,pt %icc,_lwp_kill+0x18 ! 0xffffffff7eea823c
    Current function is Java_getLoid (optimized)
    7239 e = cod_to_long (*(o_object*) data, &loid_as_long);
    (dbx) where
    current thread: t@1
    [1] lwpkill(0x0, 0x6, 0xffffffffffffffe6, 0x0, 0x0, 0x0), at 0xffffffff7eea822c
    [2] raise(0x6, 0x0, 0xffffffff7fffad30, 0x7fbffeff00003ff6, 0x0, 0x2), at 0xffffffff7ee58a8c
    [3] abort(0x0, 0xffffffff7fffae10, 0x0, 0xfffffffffffffff8, 0x0, 0xffffffff7fffae39), at 0xffffffff7ee3e3b8
    [4] os::abort(0x1, 0xffffffff7e9d295c, 0xffffffff7fffaf10, 0xffffffff7e9d24a9, 0x4b007c, 0xffffffff7eb78878), at 0xffffffff7e90951c
    [5] os::handle_unexpected_exception(0x10011e600, 0xa, 0xfffffffe90345704, 0xffffffff7fffbeb0, 0xffffffff7e69c6f8, 0x0), at 0xffffffff7e907e08
    [6] JVM_handle_solaris_signal(0xffffffff7fffbeb0, 0xffffffff7e9d443e, 0xffffffff7fffbbd0, 0x1, 0x0, 0x1), at 0xffffffff7e69c800
    [7] __sighndlr(0xa, 0xffffffff7fffbeb0, 0xffffffff7fffbbd0, 0xffffffff7e69cb9c, 0x0, 0x0), at 0xffffffff7f2188d8
    ---- called from signal handler with signal 10 (SIGBUS) ------
    =>[8] Java_getLoid(vjEnv = ???, cls = ???, handle = ???, attr = ???) (optimized), at 0xfffffffe90345704 (line ~7239) in "j.c"
    I have added checks for this function call to ensure that no invalid pointer is being sent to it which could cause a segmentation violation.
    Please could someone give me some pointers on how to solve this problem, the error occurs at this point only 12 hours after running the test case..

    First step is to add the option -Xcheck:jni to your java command line. It will flag common JNI errors.
    If that doesn't identify the problem, then compile your jni code with debugging symbols (-g) and add the following option to the java command line when you run your test: -XX:+ShowMessageBoxOnError. When you hit the problem again, the VM will keep the process alive instead of calling abort(). Then you can use dbx to attach to the live process and should be able to get a better idea of what went wrong.

  • Background application in Mac OS

    Is it possible to run a Java application purely the background in Mac OS X?
    I can set up a cron-like job to execute a java application every hour or something, but then the application takes up space in the Dock. I'd like it to run as a daemon or something.
    Thanks in advance!
    Ben

    Get Easy Find - VersionTracker or MacUpdate - and search for it, then delete it. Contact Canon for tech support.

  • Help Learner Creating applet

    I need help. I am trying to learn using the Sams teach yourself Java in 24 hours. In its HOUR 4 it says to create an applet. it uses something called "Graphics screen" in its paint method. but when i use this it says that it cannot find symbol Graphics2d. i have no idea what is happening.
    The code looks like this
    package rootapplet;
    import java.awt.*;
    public class RootApplet extends javax.swing.JApplet {
    int number;
    public void init() {
    number = 225;
    public void paint(Graphics screen) {
    Graphics2d screen2d = (Graphics2d) screen;
    screen2d.drawString("The square root of "
    + number
    + "is"
    + Math.sqrt(number), 5, 50);
    i am using JDK 1.6.0_02 and netbeans 6.0 beta. Can anyone help. i really want to learn and i don't want to skip any lesson. i had no problem in that book uptill now

    java is case sensative. Graphics2d is not the same as Graphics2D.
    next time please use code tags when posting code.

  • Applets are not loading.

    Hey I am about 3/4 through the book Teach yourself java in 24 hours...and so far every applet I have done has not loaded in the browser but stayed the gray box of doom... bla bla not found.
    I am using Jcreater as a compiler and have the newest runtime enviroment.
    Java:
    import java.awt.*;
    public class BigDeptApplet extends java.applet.Applet{
    int debt;
    public void init(){
    debt = 59000000;
    debt = debt / 1440;     
    public void paint(Graphics screen){
    screen.drawString("A minute's worth of debt is $" + debt, 5, 50);
    Html:
    <html>
    <head>
    <title>The Big Debt Applet</title>
    </head>
    <body bgcolor="#000000" text="#FF00FF">
    <center>
    This a Java applet:<br>
    <applet code="BigDebtApplet.class" height=150 width=300>
    You need a Java-enabled browser to see this.
    </applet>
    </body>
    </html>
    please help...the code is straight from the book and compiled fine..Just when I open the html the applet doesn't load.

    I also noticed your class is called BigDeptApplet and your HTML refers to <applet code="BigDebtApplet.class". Not much difference, but enough. I only wish I could only spot my own mistakes.
    That said I still haven't got your applet working in I.E. 6 on X.P. even though I know in the past I have managed it in the same browser & O.S.
    Hopefully somebody will add to this thread, good luck.

  • Initial setup problems and beginner code questions ...please help?

    Hi,
    Two days ago i started playing around with Java but it has been one pitfall after another for me. I am a visually impaired user, the fun started when i wanted to install the JDK. I think i got EE 5.0 by mistake, but that doesnt even bother me that much. The installer somehow managed to totally elude the screenreader I was using and I needed sighted help to get the thing installed. I think something went wrong with the environment variables during that process because when I first tried compiling a snippet of code it couldn't find Javac. I had to enter:
    c:\sun\sdk\jdk\bin\javac.exe c:\saluton.java
    to get anything done. I have been trying to learn java using a three-year old copy of teach yourself Java in 24 hours, which might explain my following questions. Here is the code snippet i got from the first chapter:
    class Saluton {
    public static void main(string[] arguments) {
    // my first Java program goes here
    String greeting = "Saluton mondo!";
    System.out.println(greeting);
    This code didn't compile, complaining about Cannot find symbol.
    I took out another book, Learning Java, and i got the following code out of this:
    public class HelloJava {
    public static void main( String[] args ) {
    System.out.println("Hello, Java!");
    This code did compile, but when i tried:
    c:/sun/sdk/jdk/bin/java.exe HelloJava it said the class couldn't be found. I am assuming this has to do with the .class file not being in the folder where it should be, but again I don't know.
    I got the JAB (java access bridge) but I had the feeling the info that came with it is rather outdated ...could someone give me some insight on this as well?
    Thanks very much for any help you all can provide,
    Florian

    Hi,
    Using your help I've been able to find the error in the saluton mondo program, the caps of the String in the main function declaration was wrong. I have set my Path to the right setting now, and javac and java behave as they should now which is good.
    What about my question about the access bridge? How do i use it, exactly? (just telling me where that info can be found is enough really) I'm really confused by all the different .jar files and such ...
    Also, once it is installed do i need to somehow ...activate it or reference it in my code to make my apps readable? I would like to see if my program did what I wanted it to do so yeah ...
    Thanks for any help,
    Florian

  • Help needed in date formating

    Hi guys merry Christmas in advance .i was trying to write a code to compare given string with current date .
    So i have written a piece of code to set hour minute second millisecond of current date to 0.
    It worked fine for minute second millisecond but hour always shows 12.
    Here is the code.
    Please help
    import java.util.*;
    public class SampleDate
    public static void main(String[] args)
    java.util.Date date = new java.util.Date();
    //convert current date to cal format and set hour min sec mill to 0
    java.util.Calendar cal1=java.util.Calendar.getInstance();
    cal1.setTime(date);
    cal1.set(java.util.Calendar.HOUR,0);
    cal1.set(java.util.Calendar.MINUTE, 0);
    cal1.set(java.util.Calendar.SECOND, 0);
    cal1.set(java.util.Calendar.MILLISECOND, 0);
    //convert from cal to date format
    date=cal1.getTime();
    System.out.println("Current Date in Date Object: " + date);
    }Output:
    C:\TIMECOMPARE>java SampleDate
    Current Date in Date Object: Thu Dec 24 12:00:00 IST 2009Expected output is :Current Date in Date Object: Thu Dec 24 00:00:00 IST 2009

    The HOUR field of the Calendar class represents a 12 hour clock format where 0 indicates 12 noon. Instead use the HOUR_OF_DAY in the code as shown below:
    cal1.set(java.util.Calendar.HOUR_OF_DAY,0);

  • Jdk Won't Appear under Program Files

    I recently grabbed "Java Programming 24-hour Trainer" and began learning Java, and I encountered a problem that I have no clue how to fix.
    I downloaded the latest Java Developer Kit, and when I had it installed, I couldn't locate the JDK Bin under Program Files to link up with the Command Prompt to emulate the "HelloWorld" script. Is there a solution to this?

    Hi,
    When you had installed jdk in drive, suppose its shows as below
    C:\Program Files\Java\jdk1.6.0_26\bin
    once again check.

Maybe you are looking for

  • Solution Manager Key info

    Hi Guru's, As we are planning to migrate / system copy all systems like SAP Portal , BI & XI to a new hardware, from P5-P590 to P6-P570 (The OS version, TL level and Patch Level for the both LPAR's remains same, i.e  No change on OS versions). My que

  • How do i get a printer to work?

    Hello i am new to mac os i have used windows all my life so im not quite use to mac os yet so iv tried to set up  the printer to work from my macbook pro but i cant get it to work. the printer is on a homenetwork connected to a windows computer which

  • Scanner recognition

    Hello, PSE9 apparently can't see my Microtek ScanMaker 6800. It says there's no compatible device connected. PSE7 and all my other programs are having no problem with seeing the scanwizard driver and utility. I'm running WIN7 Ultimate 64. Thanks for

  • Edge running slow/not displaying some items on stage

    My project's growing quite large but I'm keeping everything very tidy and importing only small files (tiny PNGs, well compressed short videos, etc) but I've found the file slowing down and now it's not displaying some of my images and symbols. Also w

  • When I downloan anything, I can`t find it when I go look for it, because I don`t know where to look.

    Whenever I download anything, I don`t know where to look for it. I tried my downloads and documents and they were not there. How do I find them?