Who wants to earn some dukes in the swing forum?

just take a look at my riddle:
http://forum.java.sun.com/thread.jspa?threadID=5117753&tstart=0
Cheers!
Annette

Ok, rookie :)
Imagine a servlet as just a regular java class that happens to be able to be called from a webpage using Jakarta-Tomcat or one of the other JSP/Servlet engines out there. If you are familiar with server-side programming then passing information from a Servlet to your GUI should be easy. As for passing info from a GUI to a servlet, I'm not too sure how, but that's just because I haven't written many applets in Java yet. I suggest highly "Using Java Server Pages and Servlets Special Edition" from Que as a good reference book for a technically minded programmer starting in Servlets. Now, enough of the rookie-speak, and on to the problem. If you want to pass information from a servlet to an applet, there are probably many ways to do this, but the first way I can think of is to:
a) create a servlet from scratch.
b) In the doGet() or doPost() methods, instantiate any variables you need to pass.
c) Attach these variables to the datastream using the method .setAttribute() in the HttpServletRequest object
d) Redirect your page to the page containing the <APPLET> tag using the following line:
getServletContext().getRequestDispatcher(URL).forward(request,response);     
e) Inside your page with the <APPLET>, use <% String blah = (String) request.getAttribute("Whatever"); %>
f) To reference the passed variable, use <%=blah%> and it will output a string in that place.
g) MAKE SURE YOU RENAME THAT PAGE FROM *.html to *.jsp IF IT HAS <% %> tags.
Thats about all the help I can give online.....if I've totally confused you, try looking in that book. It's really helpful....
Dan from Canada

Similar Messages

  • My iTunes says I owe $5.25 for songs that I have already paid for and am not going to pay for again but I want to get some apps from the store and now there's a hold on my account. Who do I talk to get the hold taken off

    I explained it most in my question but I am getting charged double for songs that I have already paid for and am not going to pay for twice because that is messed up. But I want to get some apps from the store and it wont let me because of $5.25. Who can I talk to about resolving this issue?

    You're right, it would have been covered under warranty. But because of the user damage, chances are there's a 200-something dollar fee . If you explain to them that it had a defect previously, they might replace it for you at no charge. **MIGHT**. But they would have to believe that it had a defect previously.

  • I want to add some fields in the report of FBL5N, Can anybody tell me how ?

    I want to add some fields in the report of FBL5N, Can anybody tell me how to do it?
    The fields are sales order, delivery, order quantity, net value and others.
    I can only find the shipment number in FI document.
    Thank you very much.

    Dear Jie,
    Billing document number can be displayed in customer line item display
    (FBL5N) and not in G/L line item display (FBL3N).
    The value of VBELN is saved in table BSEG. So, this means, you
    have to define the field BSEG-VBELN as a special field in table
    T021S. Then you can use it in FBL3N, because then the report looks
    directly in BSEG-VBELN.
    For further information,please read the SAP note 207436. You don't have to
    implement the coding corrections, if they are already in your system
    with the hotpackage. But it explains very detailed the system
    behaviour. The example in the note with field EBELN could be
    replicated on your field VBELN.
    About the MEINS field, please refer to 1-U_MEINS (bseg-meins field).
    The SAP note 215798 may also be helpful.
    Mauri

  • TS1702 Want to buy some donuts on the Simpsons tapped out game and it is telling me to contact support. I have updated my info and credit card. Help

    Want to buy some donuts on the Simpsons tapped out game and it is telling me to contact support. I have updated my info and credit card. Help

    Contact the app's support, at a guess. Have you?

  • I want to delete some photos of the user pictures. Where can I find them?

    I want to delete some photos of the user pictures. Where can I find them?
    I mean those pictures, which come on when clicking on the user-picture, here "latest".

    Unfortunately I don't speak German.
    Go back to Recents (Letzte), select a picture, and then hit the delete key. Delete all that you want to. At this point the 'Done' button will be grayed out.
    Click the Show All button at the top left.
    Then go back to see if the user pictures were removed. It worked for me.

  • ICloud I do not want to share some documents in the cloud.  I f I turn off iCloud it says I will delete everything already there. How do I know what is already in the cloud

    iCloud I do not want to share some documents in the cloud.  I f I turn off iCloud it says I will delete everything already there. How do I know what is already in the cloud

    Thank you.  When I go into system preferences, then iCloud, then manage, it does not let me view what is there only says:  ex: The documents stored inside Pages take up 623.3KB and gives me the option to: Delete Documents and Data.  It does not let me see what files are there.   I think it is time for me to go back to my apple store and get more acquainted with iCloud and storage and how to manage it.  I had some issues with my mac about a month ago after downloading an updated version.  The issue was related to syncing, iCloud, iTunes, calendar and storage.  I am nervous about loosing more documents, photos, etc..from my Mac.  Thank you for the information.  

  • I want to display some fields using the BDC and i want to know thruogh whic

    I want to display some fields using the BDC and i want to know thruogh which transaction these fields are displayed.Could you please help me out.

    You can use JFreeChart which is a free and good tool to generate graphs in Java. It has samples and other guides which you can use to get started...

  • I have bought a new iPad 2 charger and it works absolutely fine but then I wanted to upload some pictures on the computer so I put the wire in the right places but it doesn't work so I tried my iPhone and it worked fine?

    I have bought a new iPad 2 charger and it works absolutely fine but then I wanted to upload some pictures on the computer so I put the wire in the right places but it doesn't work so I tried my iPhone and it worked fine?

    Plz answer as soon as possible

  • I want to purchase some games in the App Store but I forget the answers. But I haven't received any email from Apple. Why is it so?

    I want to purchase some games in the App Store for my I-pad air but I forget the answers to my security questions.  Apple said that email has been sent to my account but I haven't received any email and I realized that the email below my security question is not mine because my email ad starts in letter j not w..... 

    Reset Security Questions
    http://support.apple.com/kb/ht5312
    If you still have problem, call Apple to help reset your Security Question.
    http://support.apple.com/kb/HT5699

  • Unlike some users, I want to send some files in the body of my email NOT as an attachment. How do I do that?

    Some literary agents want a chapter or two in the body of an email. They do NOT want an attachment. How do I do that?

    ppress and hold on email section until the select and select all show up. Ussually I select text and then hit paste instead.
    Other option on pc or if you have a Bluetooth keyboard
    On windows
    control + c
    to copy
    control + v
    to paste
    on mac
    command + c
    to copy
    command + v
    to paste

  • Want to draw some rectangles inside a swing panel object

    HI,
    I want to draw some rectangles inside one JPanel object in swing. The JPanel object should also hold some buttons, labels, etc.. I can add simple buttons, label etc. easily to the panel object but how do I add graphics (like lines, rectangles) to it ??
    an immediate response would be highly appreciated!!

    I am not sure why you are talking about the rectangle.
    To repeat I fill in a bit of code (subject to compiler errors since I Do not have a machine where I can compile or test on at the moment):
      private class ColourCube extends JPanel 
         // The size of each rectangle with colour
         private static final int ROWS = 10;
         private static final int COLS = 10;
         // To store current selection
         private int selectedIndex[] = null;
         public ColourCube()
             addMouseListener( new MouseAdapter() {
                public void mouseReleased(MouseEvent me)
                   // Find the rectangle index by dividing
                   // x and y positions then set selectedIndex
                   // unless it is the same positions as previous
                   // then set it to be null
                   fireActionEvent();
         // needed listener methods for firing events
         public void addActionListener( ActionListener al)
            // add to list
         // remove etc....
         protected void fireActionEvent()
            // Construct action event
            // call actionPerformed( ae ) on all listeners
         public void paintComponent(Graphics g)
             // Depending on size and height of this component
             // calculate out colWidth and rowHeight
             // Loop and paint the rectangles in their different colours
             for(int i = 0; i < ROWS; i++)
                for(int j = 0; j < COLS; j++)
                   // set the colour to the graphics object here from the list of colours available
                   g.setColor( ... );
                   // Added a little bit extra to have some space between
                   // each rectangle
                   g.fillRect( i * rowHeight + 1, j * colWidth + 1, colWidth - 2, rowHeight - 2 );
             if( selectedIndex != null )
                // We have a selection, lets paint the selection
                g.setColor( Color.white ); // Selection colour
                // The index contains the row in index 0 and the col in index 1
                g.drawRect( selectedIndex[0] * rowHeight, selectedIndex[1] * colWidth, colWidth, rowHeight );
      }Lacking from the above component is lacking stuff like preferedSize.
    Now, all you do is instantiate the ColourChooser, add it to your applet iether by drag and drop if you have an WYSIWYG editor, or by hand if you are so inclined.
    Voila! A composite component appears, doing the stuff it needs to be doing.
    Regards,
    Peter Norell

  • I can't figure out the Keynote title option. I'm a newbie so forgive my ignorance. I want to put an image in the swing arm, but I can't figure it out.

    I even tried opening in Motion and inserting it there, but when I bring it back to fc it's not there. I also want to change the background to an image or at least solid white. When I put an image in the Dropzone it doesn't show up. Any help would be GREATLY appreciated!

    To change the title background to use a clip in the drop zone, do just as Jim said.
    Also, place the clip that want to appear in the "swing arm" right below the title in the timeline.

  • For some reason, firefox has changed something in my laptop so that when I play games on facebook, such as deal or no deal, who wants to be a millionaire, ect. the games load only to half size, so half of my games are cut off.

    everything i have done has not fixed this problem, its only on my laptop on my parents laptops it works. V

    Oh no... NOT THE 99-PAGER!!! Anything but THAT!!!

  • I want to purchase some thing in the game.

    but it said can not be complet, contact itunes support. on gane Iron force.i want to ask how can i purchase in that game.
    thanks

    The link that Dah•veed gave works ok for me, there is 'contact support' link at the bottom of the left-hand column of links on that page i.e. http://www.apple.com/support/itunes/contact/

  • I have reinstalled my OS without time machine (using the disc). I want to restore some pictures in the iPhotos which are already in the time machine i was using previously. How can I restore iPhoto from previous time machine?

    My mac book was incredibly slow. When I went to Mac store, they asked me to reinstall the OS with CD and not with the time machine. I reinstalled the operating system. But when I opened the applications, all those started as fresh applications as usual. I have the backup of all other data in another hard disc. But unfortunately, I forgot to copy the photos before reinstallation. I have those photos in my time machine back up. But when I opened time machine, it started like a fresh (very new) time machine and it started backing up my present OS (the reinstalled one). I cannot open the previous time machine, which is in the same hard drive. I wish to open the previous time machine to get the photos which are backed up previuosly. When opened the time machine disc (manually by clicking the icon), i can see all the thigs which I had previously in my macbook. But unfortunately, i cannot access those through time machine! Can anybody help me please?

    How to redownload purchased apps from the App Store

Maybe you are looking for

  • Importing animated gif

    I am trying to import an animated gif into a pre-existing layered photoshop file. I am using photoshop CS3 on a Mac OS X 10.5. I tried file -> import -> video frames to layers, but it does not recognize the gif file and there is no place to manually

  • How do you go back to iOS 7 on iPhone 5?

    My iPhone doesn't work properly after update to iOS 8.

  • How can I remove a recommended Update?

    I have a Brother Printer that, for some reason, works well with the driver that came with the system. Later releases cause numerous problems. How can I keep Snow Leopard from continually recommending to update this software but still keep me up-to-da

  • Error message in va02

    Hi, When i am any sale document in va02 , its giving error message as 'Specify either address number or address handle'. I searched in sdn, but no solution found. Provide any solution Thanks in advance

  • Sync Mac to Mac

    I'm sure this must have been asked, but can't see it. Is it possible to sync address books between two Macs?