This.getJspName();

Hi All,
I have been trying to get the JSP page name in my program, and have used the following code.
public void onPageName(Event event) throws PageException
  String jsp_page = this.getJspName();
  response.write( jsp_page);
The return value is NULL, has anyone been successful in retrieving the page name or faced a similar issue.
Thank you
NAC

Hi NAC,
we are talking of a JSPDynPage, aren't we?!
I expect that you just haven't <i>set</i> the JSPName before. Have in mind that it's the framework which normally utilizes the <i>getJspName</i> to access the information which page should be rendered after your implementation has determined the answer to this question (and used <i>setJspName</i> to provide the corresponding information for the framework).
Hope it helps
Detlev

Similar Messages

  • Tracking Page user clicked (*.jsp)

    Hi,
    I have a custom iView with 5 pages the user can drill. Is there anyway I could find within my Java code which page the user drilled from (Get the name of the *.jsp page user clicked).
    Any help would be appreciated.
    ~NAC

    Hi NAC,
        Try the following code.
    public void OnClick(Event e) {
         String jsp_name = this.getJspName()

  • Can I put more than one user under one Apple ID account. I want to let other family members use imessage on their own Apple device. Or is there another way to get this end result?

    Can I put more than one user under one Apple ID account. I want to let other family members use imessage on their own Apple device. Or is there another way to get this end result?

    You can seach the net for solutions like this one http://appletvvpn.com/how-to-connect-apple-tv-2-to-vpn/ another idea is to use a PC as the control and fit that with a wireless card and set up a ad hoc wireless network that the Apple TV uses. 

  • HT204053 I have multiple family members using one apple id account and all of each others information is going onto each others phones/how do i stop this?

    I have multiple family members using one apple id and all of our data is going onto each others phones/how do i stop this?

    Each person needs to have their own separate Apple ID along with their own separate computer user account and iTunes Library.

  • Error Level 10: I have this error where a plugin broke that I had to remove because it was not finding it. How do i install it back so it functions?

    8/29/2014 7:15am
    It seems to me that if Microsoft's platform can not fix it with the troubleshooter that the troubleshooter sucks.  It does not know when errors are thrown so your developer sucks on creating software for errors that are popping up in your software?
    if a error is thrown in Windows 8 it should catch it upon a thrown error in programming? This hsould be a level 1 ticket. Since when I call you support for error in your product no one wants to address problems in your software and get mea tech to resolve
    it?
    The question now is how do I fix this and why is it causing me an internal error 500 for my web server install?
    I may have other issues but I need access to my web server through my browser I used fsocketopen to troubleshoot it?
    It gets back a internal 500 on Gecko process in firefox and on IE it just won't serve out the document in my web server abyss or apache? So the question is what service is broken so I can't serve my [web server] pages out? Let me go through all the event
    logs that I have with errors below?
    Under Applications:
    1) Failure to load the application settings for package microsoft.windowscommunicationsapps_8wekyb3d8bbwe. Error Code: 10
    2) LMS Service cannot connect to Intel(R) MEI driver. Error level 1
    3) Failure to load the application settings for package microsoft.windowscommunicationsapps_8wekyb3d8bbwe. Error Code: 3
    4) SearchIndexer (3476) Windows: The database engine attached a database (1, C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb). (Time=0 seconds)
    5) Internal Timing Sequence: [1] 0.000, [2] 0.000, [3] 0.125, [4] 0.000, [5] 0.000, [6] 0.000, [7] 0.000, [8] 0.000, [9] 0.000, [10] 0.000, [11] 0.000, [12] 0.000.
    Saved Cache: 1 0: Evenet Id level 326.
    6) SearchIndexer (3476) Windows: The database engine started a new instance (0). (Time=0 seconds)
    7) Internal Timing Sequence: [1] 0.000, [2] 0.000, [3] 0.000, [4] 0.000, [5] 0.000, [6] 0.000, [7] 0.000, [8] 0.000, [9] 0.000, [10] 0.000. eveent level 105
    8) SearchIndexer (3476) Windows: The database engine (6.03.9600.0000) is starting a new instance (0). Error Level 102
    Under Security:
    1) We might want to check this out here User Account Management changed?
    Under Setup: no errors.
    Under System below:
    1) Name resolution for the name win8.ipv6.microsoft.com. timed out after none of the configured DNS servers responded.Event level  1014
    2) Intel(R) 82567LM-3 Gigabit Network Connection
     Network link is disconnected.
    3) The system has returned from a low power state.
    Sleep Time: ‎2014‎-‎08‎-‎29T05:10:07.602701000Z
    Wake Time: ‎2014‎-‎08‎-‎29T13:13:47.945773100Z
    Wake Source: Device -USB Root Hub : Error level 1
    4) The browser has forced an election on network \Device\NetBT_Tcpip_{58565081-3013-43B6-AE07-CC89C71F6036} because a master browser was stopped. Event Id 8033.
    5) The driver \Driver\WudfRd failed to load for the device SWD\WPDBUSENUM\_??_USBSTOR#Disk&Ven_EPSON&Prod_Storage&Rev_1.00#7&2d369789&0&533536503532383375&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}. Event error 219.
    6) The driver \Driver\WudfRd failed to load for the device SWD\WPDBUSENUM\{3c83e4cf-28e9-11e4-827b-b8ac6f8aec21}#0000000000004000. Error Level Id 219.
    7) The UMDF reflector was unable to complete startup because the WUDFPf service was not found.  This service may be started later during boot, at which point Windows will attempt to start the device again. Error Id 10114.
    8) Unable to bind to the underlying transport for [::]:80. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine.  The data field contains the error number. Event Id 15005.
    9) The supersafer64 service failed to start due to the following error:
    The system cannot find the file specified. Event ID 7000.
    10) The SNMP Service encountered an error while accessing the registry key SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration. Error: 1500.
    11) The SAS Core Service service failed to start due to the following error:
    The system cannot find the file specified. 7000
    12 The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://*:80/ for site 1. The site has been disabled. The data field contains the error number. 1004
    13) The driver \Driver\WudfRd failed to load for the device SWD\WPDBUSENUM\_??_USBSTOR#Disk&Ven_EPSON&Prod_Storage&Rev_1.00#7&2d369789&0&533536503532383375&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}. Error level 219
    14) Name resolution for the name win8.ipv6.microsoft.com. timed out after none of the configured DNS servers responded. Error level 1014.
    Now I need help with all these error since Windows 8 with maybe 15 applications is failing after no setup errors? What would cause these we need to find out? Since I can not use your product with so many developer errors? and to put out a products that doesn
    work is pointless? So please call me and have some help me through the errors and tell your support to stop ignoring the errors that broke the products?
    Sincerely, William Dunlap {removed} N. Academy blvd, 201, Colorado Springs, CO 80910 http:\\interfacesone.fnhost.org
    {removed}.  I need a tech to help me get my web server up?

    So now you don't release the security breaches in windows 8. You mean to tell me that you can use Powershell - Using WMI to breach security in VB apps on the web by getting my file structures?
    What is this all about?
     1 Set VPN NIC Settings
        2 Get Network Data from servers
    Set VPN NIC Settings
    $error.clear | out-null
    cls
    $ErrorActionPreference = "SilentlyContinue"
    if ( $Args.Count -ne 1 ) { "
    Not enough arguments
    Usage :
        script.ps1 server
    "; exit }
    $server = $Args[0].ToLower()
    "We are working with $server"
    $netAdapt = get-wmiobject -class Win32_NetworkAdapter -computer $server
    if (!($netAdapt)) {  
        "Failed to connect to the target server!"
        exit(5)
    foreach ($card in $netAdapt) {
        IF (!([string]::IsNullOrEmpty($card.NetConnectionID))) {
            if ($card.NetConnectionID.CompareTo("VPN Virtual NIC") -eq 0) {
                $myID = $card.DeviceID
    $NAC = [wmi]"\\$server\root\cimv2:Win32_NetworkAdapterConfiguration.index='$myid'"
    $guid=$NAC.settingID
    "Setting DNS Toggles"
    $dnsToggle = $NAC.SetDynamicDNSRegistration(0,0)
    if ($dnsToggle) {
            "Success"
        } else {
            "Failure"
    $strShowNicKeyName = "SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\$guid\connection"
    #$strShowNicKeyName
    $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $server)
    $regKey= $reg.OpenSubKey("$strShowNicKeyName",$true)
    $showIcon = $regKey.GetValue("ShowIcon")
    if (!($showIcon -eq 1)) {
        "The icon is hidden.. Setting it now"
        $setIcon = $regKey.SetValue('ShowIcon',1,'DWORD')
       } else {
        "The icon is visible already."
    "Script Ends"
    Get Network Data from servers
    $myfile = get-content servers.txt
    echo "Server    IPs    Subnet    GW" | out-file "Results.txt" -Append
    foreach ($server in $myfile) {
        Write-Host "Looking at $server"
        $colitems = Get-WmiObject win32_NetworkAdapterConfiguration -computer "$server" -Filter 'IPEnabled = "True"' | select ipaddress,ipsubnet,index,defaultipgateway
        foreach($objItem in $colItems) {
        Write-Host ""
        $myip = $objItem.IPAddress -join " "
        $mySubnet = $objItem.IPSubnet  
        $myGW = $objItem.DefaultIPGateway
        $temp = $objItem.index
        $myid = Get-WmiObject win32_NetworkAdapter -computer "$server" -Filter "index = $temp" | select  netconnectionid
        $myid = $myid -replace "@{netconnectionid=",""
        $myid = $myid -Replace "}",""
        echo "$server    $myip    $mySubnet    $myGW    $myid"
        echo "$server    $myip    $mySubnet    $myGW    $myid"  | out-file "Results.txt" -Append
    Is this possible on any machine with power shell and if so how is access done?
    William Dunlap

  • I will give $100 to the person who can solve this problem once and for all.

    I'm not even kidding, dude. We can do PayPay, I'll mail you a check, whatever you want. That is how frustrating this is, that is how badly I want it fixed, and that is how much overtime I've worked lately thanks to being shorthanded at my place of biz-nass. I'm an hombre of my word, so if you actually come up with a solution that works, the cheddar will be yours. Okay let's hit it.
    It's the skipping thing. First 10-12 seconds of a song - every song - will play fine, then iTunes skips, stutters, and basically does the god **** hokey pokey and shakes it all about. It happens most notably with songs that I double-click to play, but I'm pretty much noticing it on any song now after a transition is made. I've been using iTunes for ages and this didn't happen until the upgrade to 7.3. I have poured over these forums for nearly a week, tried every solution offered (even offered one of my own that actually worked for maybe four days before the whole thing started up again) and NOTHING. To save us all some time, here's what I've tried:
    - Downgrading. I'll admit I didn't do this correctly at first. I didn't remove everything according to the support guidelines, but I went down to version 6.05 and that did nothing to quell the skipping. I upgraded back up to 7.3 because hey, why not, and attempted the remaining trial fixes. I have since removed both iTunes and Quicktime, step my step according the the guidelines, and not only have I downgraded to my current running version of 7.2, I put both of the programs on my F drive (as opposed to the default C drive), my gigantic bonus internal drive where I typically keep nothing but my giganto music library. I thought putting the app on the same drive as the music might fix things. I thought wrong. Dead wrong. Dead diddly dum iddly wrong.
    - Quicktime settings. My settings for Quicktime have always been in safe mode with the output size at 16 bits. So when I saw this "fix" I just rolled my eyes. I used to have that dealio back in the dizzle when iTunes would just get all static-y and skip when I'd open other programs or even just minimize it, so that fix worked for that, but it's nothing compared to this. In simpler terms, that fix is like Superman, and this skipping? The kryptonite. Actually that's probably not a great metaphor, but we've got a ways to go and this is going to get mucho boring if I don't throw some chuckles out there. Ready for fix three? Giddy up!
    - Turn off cross-fade? It's never been on. I never really got the appeal of that, and also I think it resulted in some minor skipping back in the d. I also attempted similar fixes like turning off the equalizer, messing with the volume, closing last.fm, REMOVING an old album art retrieval program from back before iTunes got its **** together with album art, ANYTHING that might interfere with playback was turned off, removed, b-slapped, and sent crying home to its moms. Nada.
    - Recreating my library. This was the fix I offered someone else, because it actually did the trick for a few days. After an entire night spent reimporting 73 gigs worth of music, it played fine, but I did lose a ton of album art, playcounts, etc, so you can imagine how ****** I was when this wound up not being a permanent fix. I was beyond ******. I was livid. But I was taught in the dojos of my youth to channel my anger into productivity, and instead of sculpting a lovely bonsai tree, I set out to fix this pup once and for all.
    - That darn anti-virus! This was the final fix I tried, even though I wasn't using any of the culprit programs listed in the forums as causes of the skipping, and even those offering this as a solution confessed it was pretty hit or miss. But having tried everything else, having resorted to playing my music on MediaMonkey of all things, I figured I'd give it a shot. I used (reason for the past-tense forthcoming) AVG Anti-Virus, Lavasoft AdAware and something called Spyware Doctor that I think just came bundled with XP. I removed all of them. I had just done a virus scan recently to see if that's what was causing this, so I figured I'd be okay until I could redownload them after this fix wound up not working. And it didn't work, so there's that.
    There may be a couple of fixes I've tried that I'm forgetting now, since I'm delirious after spending practically every night for the past week trying to fix this problem, while my girlf, Heather, sits and laughs at me while watching Clark and Michael on her MacBook. In fact, she's laughing at the $100 offer as I type this, but I assure you, if you offer a solution that works, the money is as good as yours. If you come up with a workable solution, I'll have to test and make sure it isn't temporary like the recreating my library thing, but I won't leave you hanging once I'm satisfied that it's fixed for good. I know it's unorthodox, perhaps illegal in some states, but I'm desperate here, peeps. The ball is in your court, and I beg you not to give up the rock.
    Gateway E-2000 Windows XP

    I think the problem lays with Last.fm. I had the same exact problem as you. In your processes screen, end the task "lastfmhelper.exe" Last.fm still scrobbles. The tracks don't skip, although I notice there is still a bit of a lag in the first part of the song - but if you can deal with that, no skipping. I think you will have to end that task everytime you boot up your computer, or uninstall last.fm completely until they fix it; it is a bug in their software, as opposed to iTunes.

  • When i send a PDF via e-print, it gets cropped, is there a way to prevent this from happening?

    PDF's are printing fine when i print direct to the printer but when they are sent by e-mail they get cropped, is there a way to get the document to fit to page when sent as an email attachment?
    The Printer in question is a HP LaserJet Enterprise 500 color M551n, the printer is brand new installed last week so i don't know if this is the norm or not.
    Edit: Please can someone please explain how to correct this.

    If you're using a desktop or notebook PC to send the email you could try installing the HP ePrint Mobile Driver software on your machine, the link to the download is here. This will allow you to print the PDF to any ePrint capable printer without having to email it to the printers email address as an attachment.
    Once installed and with your PDF open on your machine, select Print from the File menu, then select "ePrint" from the list of available printers (don't select the actual printer itself) and click Print in the bottom right corner of the box. A dialogue box will open showing the avaialble ePrint printers you can print to. Click on the Connected button on the left of the screen to add your printer to the list if its not listed.  
    Hope this helps.
    If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
    If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
    I am an HP employee.

  • "Cannot send email from this device"?

    I recently purchased the Easy Release App from the ITunes store and when I try to email the release to my email address it says "Cannot send email from this device". Is it the app that is preventing the sending or is it something to do with the iPod? I've tried sending an email from the iPod to see and it is sent fine from the iPod but the app still won't send from the iPod.
    Has this ever happened to someone else? Do I have to change settings on my iPod?
    I have the IPod 4th generation if that helps

    I had the same problem. You have to go into Settings in your ipod touch, scroll down and find "mail, contacts, calendars." Set up your email in there. It will give you a list I.e. yahoo, hotmail, gmail. After you've dont that you'll be able to sent the model release.

  • Cannot send email from my iPhone or iPad. The server rejects a recepient for no apparent reason.  The recipient is not new.  This issue happens on reply or reply to all or froward; not a new email. What is happening?

    Cannot send email from my iPhone or iPad. The server rejects a recepient for no apparent reason.  The recipient is not new.  This issue happens on reply or reply to all or froward; not a new email to the same recepient. What is happening?

    I talked with a tech today and he said I cloud is having problems which should be resolved shortly.
    In the mean time I used the .me smtp server settings which allowed me to send mail.

  • How difficult would it be to create something like this? 

    I'm looking to create a flash widget similar to what WoW has
    on their main page -
    http://www.worldofwarcraft.com/index.xml
    It needs to have images & text that could be called from
    a php or text file, so that it can be dynamically changed. Movies
    will also be integrated in the rotation as well for the Flash.
    How difficult would this be for someone who's new to flash?
    How long would it take and what all is needed to learn how to
    re-create something like this?

    The difficulty and time to do it depends on the learning
    capability of the new programmer. Patience and a drive to learn is
    what all is needed. Accomplishing one step at a time is probably
    the best approach, whether you're new or well-versed.

  • Exist a Jtree node.id or something like this ?

    I would want to retrieve a node using a unique 'id', for example the absolute index (into the total nodes count)
    Is there something like this ?
    Can I add a particular property to a node ? ( for example this 'id' if it does not exist )
    Another question :
    If I want to implement a search code, this 'id' can be useful, or must I transverse the whole Jtree
    Thanks

    Hello.
    Do the following:
    1. Go to the Apple Menu at the top left of the screen
    2. Select Software Update...
    3. Install any updates that are found.
    If the Amazon issue continues after these updates, then do this:
    1. Open Safari
    2. Erase any web address you have currently showing (for example www.apple.com or www.google.com)
    3. Type in www.amazon.com
    4. That should take you directly to amazon.com
    It should look like this in your Safari::

  • Email address change--how does this affect laptop and nook?

    I use my Adobe ID only to authorize my laptop and Nook.  I need to change my email address which seems easy on the FAQs, but how do I then reauthorize my laptop and Nook?  And, if I do this, are all my existing library books unreadable since they were downloaded by what the Nook thinks is a different user?  I'm almost sure I won't be able to return any books in ADE on my laptop, but I can live with that if I can still read the books on the Nook.
    Thanks in advance.

    The sync process with iTunes transfers the email account settings (for your chosen accounts via your iPhone sync preferences) from the Mail application on your Mac to the iPhone's email application.
    The iPhone is running OS X and the iPhone's email client can be considered a mobile version of the Mail application.

  • Help me to Edit this program

    Hi All,
    Can anyone kind enought to help me to add the START and STOP button for this "bouncing ball" program that i got from the internet ? Below is the java coding.
    import java.awt.*;
    import java.applet.*;
    class Obstacle
         public Rectangle r;
         Graphics g;
         public Obstacle(int x,int y,int w,int h)
              r=new Rectangle(x,y,w,h);
         public void paint(Graphics gr)
              g=gr;
              g.setColor(Color.lightGray);
              g.draw3DRect(r.x,r.y,r.width,r.height,true);
    class CollideBall
         int width, height;
         public static final int diameter=20;
         //coordinates and value of increment
         double x, y, xinc, yinc, coll_x, coll_y;
         boolean collide;
         Color color;
         Graphics g;
         Rectangle r;
         //the constructor
         public CollideBall(int w, int h, int x, int y, double xinc, double yinc, Color c)
              width=w;
              height=h;
              this.x=x;
              this.y=y;
              this.xinc=xinc;
              this.yinc=yinc;          
              color=c;          
              r=new Rectangle(150,80,130,90);
         public double getCenterX() {return x+diameter/2;}
         public double getCenterY() {return y+diameter/2;}
         public void alterRect(int x, int y, int w, int h)
              r.move(x,y);
              r.resize(w,h);
         public void move()
              if (collide)
                   double xvect=coll_x-getCenterX();
                   double yvect=coll_y-getCenterY();
                   if((xinc>0 && xvect>0) || (xinc<0 && xvect<0))
                        xinc=-xinc;
                   if((yinc>0 && yvect>0) || (yinc<0 && yvect<0))
                        yinc=-yinc;
                   collide=false;
              x+=xinc;
         y+=yinc;
              //when the ball bumps against a boundary, it bounces off
         if(x<6 || x>width-diameter)
              xinc=-xinc;
                   x+=xinc;
              if(y<6 || y>height-diameter)
              yinc=-yinc;
                   y+=yinc;
              //cast ball coordinates to integers
              int x=(int)this.x;
              int y=(int)this.y;
              //bounce off the obstacle
              //left border
              if(x>r.x-diameter&&x<r.x-diameter+7&&xinc>0&&y>r.y-diameter&&y<r.y+r.height)
              xinc=-xinc;
                   x+=xinc;
              //right border
              if(x<r.x+r.width&&x>r.x+r.width-7&&xinc<0&&y>r.y-diameter&&y<r.y+r.height)
              xinc=-xinc;
                   x+=xinc;
              //upper border
              if(y>r.y-diameter&&y<r.y-diameter+7&&yinc>0&&x>r.x-diameter&&x<r.x+r.width)
                   yinc=-yinc;
                   y+=yinc;
              //bottom border
              if(y<r.y+r.height&&y>r.y+r.height-7&&yinc<0&&x>r.x-diameter&&x<r.x+r.width)
                   yinc=-yinc;
                   y+=yinc;
         public void hit(CollideBall b)
              if(!collide)
                   coll_x=b.getCenterX();
                   coll_y=b.getCenterY();
                   collide=true;
         public void paint(Graphics gr)
              g=gr;
              g.setColor(color);
              //the coordinates in fillOval have to be int, so we cast
              //explicitly from double to int
              g.fillOval((int)x,(int)y,diameter,diameter);
              g.setColor(Color.white);
              g.drawArc((int)x,(int)y,diameter,diameter,45,180);
              g.setColor(Color.darkGray);
              g.drawArc((int)x,(int)y,diameter,diameter,225,180);
    public class BouncingBalls extends Applet implements Runnable
         Thread runner;     
         Image Buffer;
    Graphics gBuffer;          
    CollideBall ball[];
         Obstacle o;
    //how many balls?
    static final int MAX=10;
         boolean intro=true,drag,shiftW,shiftN,shiftE,shiftS;
         boolean shiftNW,shiftSW,shiftNE,shiftSE;
         int xtemp,ytemp,startx,starty;
         int west, north, east, south;
         public void init()
              Buffer=createImage(size().width,size().height);
              gBuffer=Buffer.getGraphics();                         
              ball=new CollideBall[MAX];
              int w=size().width-5;
              int h=size().height-5;          
              //our balls have different start coordinates, increment values
              //(speed, direction) and colors
              ball[0]=new CollideBall(w,h,50,20,1.5,2.0,Color.orange);
    ball[1]=new CollideBall(w,h,60,210,2.0,-3.0,Color.red);
    ball[2]=new CollideBall(w,h,15,70,-2.0,-2.5,Color.pink);
    ball[3]=new CollideBall(w,h,150,30,-2.7,-2.0,Color.cyan);
    ball[4]=new CollideBall(w,h,210,30,2.2,-3.5,Color.magenta);
              ball[5]=new CollideBall(w,h,360,170,2.2,-1.5,Color.yellow);
              ball[6]=new CollideBall(w,h,210,180,-1.2,-2.5,Color.blue);
              ball[7]=new CollideBall(w,h,330,30,-2.2,-1.8,Color.green);
              ball[8]=new CollideBall(w,h,180,220,-2.2,-1.8,Color.black);
              ball[9]=new CollideBall(w,h,330,130,-2.2,-1.8,Color.gray);
              o=new Obstacle(150,80,130,90);
              west=o.r.x;
              north=o.r.y;
              east=o.r.x+o.r.width;
              south=o.r.y+o.r.height;
         public void start()
              if (runner == null)
                   runner = new Thread (this);
                   runner.start();
    public void stop()
              if (runner != null)
         runner.stop();
         runner = null;
         public void run()
              while(true)
                   Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
                   try {runner.sleep(15);}
         catch (Exception e) { }               
                   //move our balls around
                   for(int i=0;i<MAX;i++)
                        ball.move();
                   handleCollision();
                   repaint();     
         boolean collide(CollideBall b1, CollideBall b2)
              double wx=b1.getCenterX()-b2.getCenterX();
              double wy=b1.getCenterY()-b2.getCenterY();
              //we calculate the distance between the centers two
              //colliding balls (theorem of Pythagoras)
              double distance=Math.sqrt(wx*wx+wy*wy);
              if(distance<b1.diameter)                         
                   return true;          
                   return false;     
         void changeCursor(int x, int y)
              Rectangle r=new Rectangle(o.r.x+1,o.r.y+1,o.r.width-1,o.r.height-1);
              Frame BrowserFrame;
              Component ParentComponent;
              ParentComponent = getParent();
              while ( ParentComponent != null &&
              !(ParentComponent instanceof Frame))           
              ParentComponent = ParentComponent.getParent();          
              BrowserFrame = (Frame) ParentComponent;
              if(shiftNW||shiftSE)
                   BrowserFrame.setCursor(Frame.SE_RESIZE_CURSOR);
              else if(shiftNE||shiftSW)
                   BrowserFrame.setCursor(Frame.SW_RESIZE_CURSOR);
              else if(shiftW)
                   BrowserFrame.setCursor(Frame.W_RESIZE_CURSOR);
              else if(shiftN)
                   BrowserFrame.setCursor(Frame.N_RESIZE_CURSOR);
              else if(shiftE)
                   BrowserFrame.setCursor(Frame.W_RESIZE_CURSOR);
              else if(shiftS)
                   BrowserFrame.setCursor(Frame.N_RESIZE_CURSOR);
              else if(r.inside(x,y))
                   BrowserFrame.setCursor(Frame.MOVE_CURSOR);
              else
                   BrowserFrame.setCursor(Frame.DEFAULT_CURSOR);
         public boolean mouseMove(Event evt,int x,int y)
              //the corner areas of the obstacle
              Rectangle nw,sw,ne,se;
              nw=new Rectangle(o.r.x-2,o.r.y-2,4,4);
              if(nw.inside(x,y))
                   shiftNW=true;
              else shiftNW=false;
              sw=new Rectangle(o.r.x-2,o.r.y+o.r.height-2,4,4);
              if(sw.inside(x,y))
                   shiftSW=true;
              else shiftSW=false;
              ne=new Rectangle(o.r.x+o.r.width-2,o.r.y-2,4,4);
              if(ne.inside(x,y))
                   shiftNE=true;
              else shiftNE=false;
              se=new Rectangle(o.r.x+o.r.width-2,o.r.y+o.r.height-2,4,4);
              if(se.inside(x,y))
                   shiftSE=true;
              else shiftSE=false;          
              if(x>o.r.x-2&&x<o.r.x+2&&y>o.r.y&&y<o.r.y+o.r.height)
                   shiftW=true;
              else shiftW=false;
              if(x>o.r.x+o.r.width-2&&x<o.r.x+o.r.width+2
                   &&y>o.r.y&&y<o.r.y+o.r.height)
                   shiftE=true;
              else shiftE=false;
              if(y<o.r.y+2&&y>o.r.y-2&&x>o.r.x&&x<o.r.x+o.r.width)
                   shiftN=true;
              else shiftN=false;
              if(y>o.r.y+o.r.height-2&&y<o.r.y+o.r.height+2
                   &&x<o.r.x+o.r.width)
                   shiftS=true;
              else shiftS=false;
              changeCursor(x,y);
              return true;
         public boolean mouseDown(Event evt,int x,int y)
              Rectangle r=new Rectangle(o.r.x+2,o.r.y+2,o.r.width-4,o.r.height-4);
              if(r.inside(x,y))
                   drag=true;
                   startx=x;
                   starty=y;
                   xtemp=o.r.x;
                   ytemp=o.r.y;
              else drag=false;
              changeCursor(x,y);
              return true;
         public boolean mouseDrag(Event evt,int x,int y)
              intro=false;
              Rectangle bounds=new Rectangle(5,5,size().width-5,size().height-5);
              int endx, endy;          
              endx=x-startx;
              endy=y-starty;     
              //disable mouse actions past boundaries
              if(x<5)x=5;
              if(y<5)y=5;
              if(x>bounds.width)x=bounds.width;
              if(y>bounds.height)y=bounds.height;
              if(drag)
                   //disallow to move past border
                   int ox=endx+xtemp;
                   int oy=endy+ytemp;
                   if(ox<5)ox=5;
                   if(oy<5)oy=5;
                   if(ox>bounds.width-o.r.width)
                        ox=bounds.width-o.r.width;
                   if(oy>bounds.height-o.r.height)
                        oy=bounds.height-o.r.height;     
                   o.r.move(ox,oy);                    
                   west=o.r.x;
                   north=o.r.y;
                   east=o.r.x+o.r.width;
                   south=o.r.y+o.r.height;                              
              else
                   if(shiftNW){west=x;north=y;}
                   else if(shiftNE){east=x;north=y;}
                   else if(shiftSW){west=x;south=y;}
                   else if(shiftSE){east=x;south=y;}
                   else if(shiftW)west=x;
                   else if(shiftE)east=x;
                   else if(shiftN)north=y;
                   else if(shiftS)south=y;                                                       
                   //disallow resizing below 40*40
                   int MIN=40;
                   if(east-west<MIN)
                        //shiftNW=shiftNE=shiftSW=shiftSE=shiftW=shiftE=false;
                        if(shiftW||shiftNW||shiftSW)
                             west=east-MIN;
                        if(shiftE||shiftNE||shiftSE)
                             east=west+MIN;
                   if(south-north<MIN)
                        //shiftNW=shiftNE=shiftSW=shiftSE=shiftN=shiftS=false;
                        if(shiftN||shiftNW||shiftNE)
                             north=south-MIN;
                        if(shiftS||shiftSE||shiftSW)
                             south=north+MIN;
              //report altering of obstacle to ball objects and obstacle
              for(int i=0;i<MAX;i++)
                   ball[i].alterRect(o.r.x,o.r.y,o.r.width,o.r.height);
              o.r.move(west,north);
              o.r.resize(east-west, south-north);
              changeCursor(x,y);
              return true;
         private void handleCollision()
              //we iterate through all the balls, checking for collision
              for(int i=0;i<MAX;i++)
                   for(int j=0;j<MAX;j++)
                             if(i!=j)
                                  if(collide(ball[i], ball[j]))
                                       ball[i].hit(ball[j]);
                                       ball[j].hit(ball[i]);
         public void update(Graphics g)
              paint(g);
         public void paint(Graphics g)
              gBuffer.setColor(Color.lightGray);
              gBuffer.fillRect(0,0,size().width,size().height);
              gBuffer.draw3DRect(5,5,size().width-10,size().height-10,false);               
              //paint the obstacle rectangle
              o.paint(gBuffer);
              //paint our balls
              for(int i=0;i<MAX;i++)
                        ball[i].paint(gBuffer);     
              if(intro)
                   gBuffer.setColor(Color.red);
                   gBuffer.setFont(new Font("Helvetica", Font.PLAIN, 12));               
                   gBuffer.drawString("You can move and resize the rectangle!",20,30);
                   gBuffer.setFont(new Font("Helvetica", Font.PLAIN, 10));
              g.drawImage (Buffer,0,0, this);                    

    Hello, please use code tags next time you post code. You can do so by adding [code] [/code] round blocks of code. So
    [code]
    class Code {
    private static final String codeHere = "code here";
    [/code]
    will be rendered as
    class Code {
      private static final String codeHere = "code here";
    We will not do your homework for you, we will however help when you are stuck and point you in the right direction. So what have you tried? What happened?
    Don't know how to begin? What makes the ball move?

  • I tried to sync some new songs bought from iTunes into my ipod using my laptop, (for the first time).  It would not add the new songs to the ipod.  I tried several times, with same result.  I never had this problem using my desk top computer.

    I also am having a problem with the songs I purchased using the laptop not showing on the desk top itunes, even though it is authorized to do so.  The new songs did show up on the iPad iTunes, however.  Have no idea why.  I thought this happened automatically.

    Welcome to the Apple Community.
    You can re-download content purchased from the iTunes store (availability varies depending on location) using the purchased option from the Quick Links section in the top right corner of the iTunes homepage in your iTunes application on your computer.
    You can re-download content purchased from the iTunes store (availability varies depending on location) using the purchased option which is revealed in the iTunes app on your iOS device by tapping the more button at the bottom of the screen.

  • TS3989 My 5th gen ipod touch was stolen.  I removed the device from my iTunes account, but their pictures still show up on the photostream on the one I purchased to replace it.  How do I get this to stop, the cops have no interest in their faces, nor do I

    My 5th gen iPod touh was stolen a month ago.  I immediately removed that device from my account and yet today I looked at my photostream and there are tons of pics of these people on my photostream.  How do I get this to stop?!?

    Change your iCloud ID password: http://support.apple.com/kb/HT5624.  After doing so, go to Settings>iCloud, tap Delete Account, then sign back in with the new password.

Maybe you are looking for

  • Custom field data is lost or not available after any action

    I added a custom field on ERP_H component and I made this field available through getter methods. I brought this field in to header view and the field looks ok but after I enter the data in that field, the value enter doesn't get retained. I saw the

  • I need a fix for downloads on Mac.  Currently only downloading .part files and can't find the problem.

    I am struggeling to download files in any format (i.e. pdf, dmg etc.).  It deosn't bring up the download list anymore and  in finder under downloads, it has the following suffix eg. xxx.pdf.part.  The file size is usually 0 bites.  Any advice? Anothe

  • Strange units in conky (KiB, MiB, GiB)

    Conky is working fine here (using KDE), but the units are strange: KiB, MiB, GiB. I want kB, MB and GB instead and also a fixed number of digits. How can i format that? I only found a variable for padding percentage-values. Here's my conkyrc: backgro

  • Errors connecting to 8.8

    I have a VB DI-API program for 8.8 which works at a client site, but gives connection errors on my local machine when using the Trusted mode. I recently installed SQL 2008 and SBO 8.8 on my laptop and may have missed a setting.  On the connect, I get

  • Livecycle PDFs too big, how can I

    Hi All, I have made a PDF form which allows users to open in Reader and add text and images. The form itself is small and usable but as soon as anyone imports an image or two it grows witout compression. Therefore the resulting PDFs are huge and ther