Can I do that like this?

Example:
public Class A extends Applet {
void init()
Class B = new B(this);
Class B {
Applet applet;
public B(Applet applet) {
this.applet = applet;
}

Please do not cross post
http://forum.java.sun.com/thread.jsp?forum=54&thread=265731
The code will not compile.

Similar Messages

  • How can i generate xml like this?

    Hi all,
    How can i generate xml like this & i need to send it to via HTTP :
    <mms>
                 <subject>message subject</subject>
                 <url_image>http://image_url</url_image>
                 <url_sound>http://sound_url</url_sound>
                 <url_video>http://video_url</url_video>
                 <text>message text</text>
                 <msisdn_sender>6281XYYYYYY</msisdn_sender>
                 <msisdn_receipient>6281XYYYYYY</msisdn_receipient>
                 <sid>to be define later</sid>
                 <trx_id>Unique number</trx_id>
                 <trx_date>yyyyMMddHHmmss</trx_date>
                 <contentid>see note</contentid>
    </mms>& how can i get the value of the sid (for example)?
    I hav tried to generate that xml by using StringBuffer & append, but it's not what i mean...
    Anyone can help me?

    Ok...i got it. But i still hav some problems.
    This is the sample code that i used :
    public class XMLCreator {
         //No generics
         List myData;
         Document dom;
            Element rootEle, mmsEle, mmsE;
            StringWriter stringOut;
            mms mms;
         public XMLCreator(String subject, String image, String sound,
                    String video, String text, String sender, String recipient,
                    int id, String date, String contentid) {
              mms = new mms(subject, image, sound, video, text, sender,
                            recipient, id, contentid, date);
                    createDocument();
         public void run(){
              createDOMTree();
              print();
         private void createDocument() {
              //get an instance of factory
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              try {
              //get an instance of builder
              DocumentBuilder db = dbf.newDocumentBuilder();
              //create an instance of DOM
              dom = db.newDocument();
              }catch(ParserConfigurationException pce) {
                   //dump it
                   System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
         private void createDOMTree(){
              //create the root element <Mms>
              rootEle = dom.createElement("mms");
              dom.appendChild(rootEle);
              createMmsElement(mms);
         private Element createMmsElement(mms b){
              Element subjectEle = dom.createElement("subject");
              Text subjectText = dom.createTextNode(b.getSubject());
              subjectEle.appendChild(subjectText);
              rootEle.appendChild(subjectEle);
              //create url_image element and author text node and attach it to mmsElement
              Element imageEle = dom.createElement("url_image");
              Text imageText = dom.createTextNode(b.getUrl_image());
              imageEle.appendChild(imageText);
              rootEle.appendChild(imageEle);
              // & etc....
              return rootEle;
          * This method uses Xerces specific classes
          * prints the XML document to file.
         private void print(){
              try
                   //print
                   OutputFormat format = new OutputFormat(dom);
                   format.setIndenting(true);
                            stringOut = new StringWriter();
                   //to generate output to console use this serializer
                   XMLSerializer serializer = new XMLSerializer(stringOut, format);
                   //to generate a file output use fileoutputstream instead of system.out
                   //XMLSerializer serializer = new XMLSerializer(
                   //new FileOutputStream(new File("mms.xml")), format);
                   serializer.serialize(dom);
              } catch(IOException ie) {
                  ie.printStackTrace();
            public String getStringOut() {
                return stringOut.toString();
    }when i tried to show the stringOut.toString() in my jsp, it's only showed string like this :
    The Lords Of The Ring http://localhost:8084/movie/lotr.3gp 6281321488448 6281321488448 123 0 20070220114851 LOTR.
    1. Why this is happen?i want to generate xml which its format is like above.
    2. How can i send this xml (put in msg parameter) using jsp (via web) without creating the mms.xml?
    3. if i want to set the msg parameter equal to mms.xml - means that msg = mms.xml, what is the data type for msg? is it an object or anything else?
    Thx b4 in advance...

  • How do I pay for my storage plan when I don't have a credit card? Last year I used an iTunes voucher but can't find that option this year. Please help!

    How do I pay for my storage plan when I don't have a credit card? Last year I used an iTunes voucher but can't find that option this year. Please help!

    Create an iTunes credit by redeeming a gift card and it will be charged to your credit.  From http://support.apple.com/kb/ht4874:
    "payment methods accepted include iTunes store credit, credit cards, and debit cards"

  • Can I trust something like this?

    Okay, I'm searching eBay for Macbooks, and I find this: click here
    How can I trust that? $35? And no reserve? Something makes no sense....
    And no, I am not selling this, I'm looking for a good deal.

    I've been selling on eBay for several years and the saying "If it's too good to be true it probably isn't(true), really applies to anything on eBay. Nobody is going to sell a real Macbook for $35, it was a scam and that's why it has been removed. Many times you'll see a post like that for ipods, mackbooks etc. and if you read close it will say something like "We will tell you how to get a Macbook for $35...." But the auction will have pics and info on the Macbook and make it appear you are getting a ipod or computer. btw Macbooks tend to hold their value quite well I sold a first gen for almost what I paid for it.
    MacBook, C2.0 duo, black   Mac OS X (10.4.7)   120 gb hd, 2 gb ram, 250 gb ext drive, 5g ipod, 2g ipod

  • How can I do sth like this ${requestScope.list.size} ?

    Hi, I have 2 attributes which I pass like this
    requsest.setAttribute("startPoint", 3);
    request.setAttribute("myList", myList);
    where myList is a ArrayList filld with objects. On jsp page I want to count 2 values first and last number:
    <c:set var="firstNumber" value="${requestScope.startPoint+1}"/> - this works fine.
    <c:set var="lastNumber" value="${requestScope.startPoint+requestScope.myList.size}"/> - this is impropper.
    How can I use as integer size of list which is passed as request attribute. Is this possible?
    I would appreciate any hepl.

    Hang on. For such things you can build your own EL functions - it is very easy and involves only 4 steps.
    1. Write a class containing a method (must be static) to calculate size of any list.
    [Put the class in /WEB-INF/classes, so your file will reside as /WEB-INF/classes/myfunctions/MyFunctions.class]
    package myfunctions;
    import java.util.List;
    public class MyFunctions{
         public static int getListSize(List list){
              return list==null?0:list.size();
    }2. In your taglib add an entry (in case you don't have already create one) for the EL function:
    [Say our taglib is mytags.tld in /WEB-INF]
    <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
         version="2.0">
         <tlib-version>1.0</tlib-version>
         <short-name>MyTagLib</short-name>
         <function>
              <description>List Size</description>
              <name>size</name>
              <function-class>myfunctions.MyFunctions</function-class>
              <function-signature>int getListSize(java.util.List)</function-signature>
         </function>
    </taglib>3. Now in your JSP add following line to use your new EL function:
    <%@taglib uri="/WEB-INF/mytags.tld" prefix="mt"%>4. And use as:
    <input type=text value="${mt:size(requestScope.myList)}" />Note that there no issues using JSTL EL functions. My intention is to resolve your problem and at the same time to give you a glance how to write and use your own EL functions (might be useful in future).
    Thanks,
    Mrityunjoy

  • Can a photo gallery like this be created in html/CSS?

    http://jeffsullivan.smugmug.com/Landscapes/National-Parks/Zion-National-Park-Utah/1946310_ 6PtgP#136213013_XVhBQ
    I like the way these galleries expand to browser width - both the thumbs and big image enlarge. I want to learn to make a photo gallery (+ slideshow) perform like this or hire someone with the specific skill set needed to make it for me. I've looked around quite a bit online at photo gallery apps, both free and for sale, including some offered by forum regulars (thanks!), but haven't found one I really liked.
    My intent is not to copy this gallery (that would be stealing),  just to adopt the expanding images- to browser width feature.
    I know Flash could do it but I don't see .swf anywhere in the source... would it be done with Javascript or a combination of apps?

    What I didn't mention before is that the photo gallery I want will be only one part of a community-based commercial site under development that needs to integrate with other parts.
    That's why I'm asking what sort of developer/skills I'd need to make this happen.
    I see.  OK, for starters you'll need a firm grasp of XHTML, CSS, JavaScripting, and server-side programming such as PHP and MySql databases.
    You also might like to look at an open source Groupware solution such as TikiWiki that has a lot of stuff already built into it.
    http://info.tikiwiki.org/tiki-index.php
    Good luck,
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How can i produce xml like this ?

    <mms>
    <subject>message subject</subject>
    <url_image>http://image_url</url_image>
    <url_sound>http://sound_url</url_sound>
    <url_video>http://video_url</url_video>
    <text>message text</text>
    <msisdn_sender>6281XYYYYYY</msisdn_sender>
    <msisdn_receipient>6281XYYYYYY</msisdn_receipient>
    <sid>to be define later</sid>
    <trx_id>Unique number</trx_id>
    <trx_date>yyyyMMddHHmmss</trx_date>
    <contentid>see note</contentid>
    </mms>
    How can i produce that xml?
    Can i produce it with this?
    public Element getXML(Document document) {
            // create sentContent Element
            Element sentContent = document.createElement( "mms" );
            // create subject Element
            Element temp = document.createElement( "subject" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getJudulFilm() ) ) );
            sentContent.appendChild( temp );
            // create url_image Element
            temp = document.createElement( "url_image" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create url_sound Element
            temp = document.createElement( "url_sound" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create url_video Element
            temp = document.createElement( "url_video" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getUrl_video() ) ) );
            sentContent.appendChild( temp );
            // create text Element
            temp = document.createElement( "text" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create msisdn_sender Element
            temp = document.createElement( "msisdn_sender" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getMsisdn() ) ) );
            sentContent.appendChild( temp );
            // create msisdn_recipient Element
            temp = document.createElement( "msisdn_recipient" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getMsisdn() ) ) );
            sentContent.appendChild( temp );
            // create sid Element
            temp = document.createElement( "sid" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getSid() ) ) );
            sentContent.appendChild( temp );
            // create trx_id Element
            temp = document.createElement( "trx_id" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getTrx_id() ) ) );
            sentContent.appendChild( temp );
            // create trx_date Element
            temp = document.createElement( "trx_date" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getTrx_date() ) ) );
            sentContent.appendChild( temp );
            // create contentid Element
            temp = document.createElement( "contentid" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getContentid() ) ) );
            sentContent.appendChild( temp );
            return sentContent;
        }& how can i send it to the server using HTTP request post method?

    <mms>
    <subject>message subject</subject>
    <url_image>http://image_url</url_image>
    <url_sound>http://sound_url</url_sound>
    <url_video>http://video_url</url_video>
    <text>message text</text>
    <msisdn_sender>6281XYYYYYY</msisdn_sender>
    <msisdn_receipient>6281XYYYYYY</msisdn_receipient>
    <sid>to be define later</sid>
    <trx_id>Unique number</trx_id>
    <trx_date>yyyyMMddHHmmss</trx_date>
    <contentid>see note</contentid>
    </mms>
    How can i produce that xml?
    Can i produce it with this?
    public Element getXML(Document document) {
            // create sentContent Element
            Element sentContent = document.createElement( "mms" );
            // create subject Element
            Element temp = document.createElement( "subject" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getJudulFilm() ) ) );
            sentContent.appendChild( temp );
            // create url_image Element
            temp = document.createElement( "url_image" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create url_sound Element
            temp = document.createElement( "url_sound" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create url_video Element
            temp = document.createElement( "url_video" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getUrl_video() ) ) );
            sentContent.appendChild( temp );
            // create text Element
            temp = document.createElement( "text" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create msisdn_sender Element
            temp = document.createElement( "msisdn_sender" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getMsisdn() ) ) );
            sentContent.appendChild( temp );
            // create msisdn_recipient Element
            temp = document.createElement( "msisdn_recipient" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getMsisdn() ) ) );
            sentContent.appendChild( temp );
            // create sid Element
            temp = document.createElement( "sid" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getSid() ) ) );
            sentContent.appendChild( temp );
            // create trx_id Element
            temp = document.createElement( "trx_id" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getTrx_id() ) ) );
            sentContent.appendChild( temp );
            // create trx_date Element
            temp = document.createElement( "trx_date" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getTrx_date() ) ) );
            sentContent.appendChild( temp );
            // create contentid Element
            temp = document.createElement( "contentid" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getContentid() ) ) );
            sentContent.appendChild( temp );
            return sentContent;
        }& how can i send it to the server using HTTP request post method?

  • Can iMovie make slideshows like this?

    I assure you, I am not a shill for this company. I'm just impressed with the slideshows they can put together and want the tools to make one myself.
    Can iPhoto 08 provide the tools to make something like this finished product:
    http://urltea.com/1zrt
    (multiple photos in a single frame)

    mil8 wrote:
    ... Can iPhoto 08 provide the tools to make something like this finished product: .. .
    no.
    and iM either..
    these are those typical 'options packed' PC-made shows, my ex-father-in-law likes to impresss me with.. you stare at the effects, but don't 'see' the content anymore..
    anyhow:
    prepare your pics before use in iPhoto/iMovie, to show more than one.. (not exactly , what you want, but look at my example here)
    or, purchase a bunch of plug-ins from geethree.com (plug-ins are only avail for iMHD6!), to teach iM zillions of new transitions..
    or, have a look at 3rd party 'slideshow makers' as PhotoMagico or Photo2Movie ..
    ... but two tumblin' on all axis cubes, showing 12 pics, simultanously seen on a screen.. ? a rare attemp for Mac apps..

  • Can I get templates like this from somewhere?

    I'm looking for this template: International Needs Australia | Facebook
    I was told that this was available online, I just can't remember where from. I'm pretty sure the fellow who made it was using Adobe Premiere Pro too.
    Any ideas?

    It was likely done using After Effects.  The animations were probably done in After Effects and brought into Premiere Pro for the final edit.
    There are many After Effects templates available:
    https://www.google.com/search?q=After+Effects+templates&oq=After+Effects+templates&aqs=chr ome..69i57j69i61&sourceid=chro…

  • My password protected phone was stolen and hacked into.  How can I prevent someone like this from hacking into/getting around the passcode?  They now have access to everything on my phone (I had a passcode to prevent this)

    How can you prevent a hacker from bypassing your iphone passcode?  My phone was stolen and someone hacked in and has access to everything on my phone and turned off "find my iphone."  This is exactly what I wanted to prevent from happening and the reason why I had a passcode. 

    Turn on "Erase Data" in Settings>Passcode. That will wipe the data after 10 incorrect password attempts.
    Turn off "Simple Passcode" in the same place and use something other than a 4 digit pin as your passcode.
    Also make sure Find my iPhone is enabled so you can locate and if necessary, forcibly wipe the phone.

  • How can I make navigation like this...?

    http://timeger.com/work/JoseCuervo/JoseCuervo_Facebook.php
    I want to the user to be able to navigate within my site, like the navigation on this site. (the numbers on the right side of the screen re-populate the area with different images.)
    Thanks so much!

    Use mouse rollover with two images, one with just the text and the other image, rollover, with the oval around the text. You can link the first image to the page you want. This demo page has some examples: Mouse Rollover. The first two examples are hyperlink to other pages.
    OT

  • How can I join images like this

    I have downloaded many wallpaper images and they come in left.jpg and right.jpg packs (I use dual monitors) and I would like to join them together but it takes too long in Gimp, as the process is Image > Canvas size, resize, then paste and align and save. Is there a quick CLI way or something to do this ?? What would be the method? Much appreciated if possible, thanks.

    tesjo,
    Thank you so much!! I was fiddling with it and kept messing it up trying -append and -adjoin. That works perfect, thanks a lot

  • Love this but can I do something like this using Fireworks?

    Hi all,
    Saw this site recently and really liked the background, http://www.rareview.com/ the subtule colours and gradients etc. I do not want to recreate this in Flash I am looking to hopefully do this in Fireworks for my site.
    I would love to use the image attached and add very subtle colors and gradients to this. Am I pushing it with Fireworks? I have Photoshop and never really got into it, its just to complicated for its own good ;-)
    Any thoughts or advice would be great.
    Thanks, P.

    Yes I do have Firefox and I see what you mean. Hmmm I guess if you know these things it is very simple, posted this in Flash also and it has been pointed out there also.
    I am toying with the idea of either trying this as a static image in Fireworks for my site or even venturing into trying to create a similar effect using Fireworks then Flash.
    Attached is the image I love and would like that as the main image with only a third of it being displayed behind a solid header or footer, do you think in Fireworks I could add the type of subtle rainbow and vapor effect with gradients over the image?
    My strengths have never been good with gradients and messing with colours in both Fireworks and Photoshop, I tend to make so much work for myself I then end up hating the result ;-)

  • Can I chang sag_target like this?

    Hi,
    my current setting:
    SQL> show parameter sga
    NAME TYPE VALUE
    lock_sga boolean FALSE
    pre_page_sga boolean FALSE
    sga_max_size big integer 512M
    sga_target big integer 512M
    because sga_max_size is static, so I have to bounce database,
    TO avoid bouncing database, can I just chang sga_target directly like :
    SQL>alter system set sga_target=1504M;
    or
    I have to change sga_max_size first, then bounce db, and then change sga_target?
    Any friends can confirm this for me??
    thanks a lot in advance

    Since your SGA_MAX_SIZE is equal to SGA_TARGET you
    cannot increase it, though its a dynamic parameter
    (which doesnt require db restart). Agreed.
    You must first increase your SGA_MAX_SIZE in pfile, recreate spfileBit of a long way around... you can just set this in the spfile before bouncing the database:
    SQL> show parameter sga_max_size
    NAME                                 TYPE        VALUE
    sga_max_size                         big integer 576M
    SQL> alter system set sga_max_size = 600M scope=spfile;
    System altered.
    SQL> startup force;
    ORACLE instance started.
    Total System Global Area  629145600 bytes
    Fixed Size                  1263368 bytes
    Variable Size             264243448 bytes
    Database Buffers          356515840 bytes
    Redo Buffers                7122944 bytes
    Database mounted.
    Database opened.
    SQL> show parameter sga_max_size;
    NAME                                 TYPE        VALUE
    sga_max_size                         big integer 600M
    SQL>

  • I can't get drop-down menus to work, I scroll over & click, NOTHING happens. When clicking on certain thumbnail pics to change the larger view, the pic doesn't change. So annoying! I can't use FF like this. I'm newly updated, 10.0.1. Help anyone?

    This sites (http://video.pbs.org/) drop downs "Programs" and "Topics" don't work when clicked.
    This page (http://www.modcloth.com/shop/dresses/ain-t-over-until-it-s-clover-dress) when clicking on the thumbnails of the green dress, the larger view pic does NOT change.

    I'm running the new version as well. I tested the last page you mentioned, and it works fine for me. I'm not sure if i can help without more information.

Maybe you are looking for

  • Collective Processing VL10 is not grouping deliveries for same sales parame

    Hi. Created multiple sales orders for same sales parameters like ship to, sold to, sales org, etc. When tried to process collectively the delivery ceation via VL10, system generated group for each delivery selected instead of creating group for multi

  • PrE 11 will not import .jpg files from organizer

    Hi, I just upgraded from PS & PrE 8 to the lastest version 11. I'm running on a Windows 7 pc.  My catalog was successfully converted and new pictures were added.  I now want to create a dvd with both pictures and videos.  I tried various ways to impo

  • Why does the 'Downloads' gives me a full page which I can not just minimize to the task bar.

    I'm running Firefox 34.05 as opposed to what the data will say (34.0) Lately, when I press the 'Downloads' in Tools, I get a full page as if it is a new tab. I use to have a small block that I could minimize to the task bar. Is there something I can

  • Help please and thank you

    why does my phone get hot when charging, liker REALLY hot!? >>Personal information removed<< Message was edited by: Verizon Moderator

  • Moving object in JFrame

    Hello, I am starting to look into how to work with graphics in Java for the first time. So what I am trying to achieve is a simple circle moving across a frame. Here is the code that I thought would do the trick. package com.game.begin; import java.a