I did write a simple java program but it is not working please help me.....

This is the program I wrote LineRect just to draw a line a rectangle etc...... Y it is not working How can i used the same program to run without using applet that is by using awt and swing.........Pls Help me.............
import java.awt.*;
import java.io.*;
public class LineRect
{public void paint(Graphics g)
     {g.drawLine(10,10, 50,50);
     g.drawRect(10, 60, 40,30);
     g.fillRect(60,10,30,80);
     g.drawRoundRect(10,100,80,50,10,10);
     g.fillRoundRect(20,110,60,30,5,5);
     g.drawLine(100,10,230,140);
     g.drawLine(100,140,230,10);
<APPLET
CODE =LineRect.class
WIDTH=250
HEIGHT=200>
</APPLET>

There are many significant errors here for instance you are using a class file as if it were an applet yet you do not subclass applet. Your code has no init method (if it is to be an applet). Your best bet is to go through the tutorials one step at a time. One thing to consider is to subclass a JPanel and draw on the jpanel overriding the paintComponent method. This can then be added to a JFrame or a JApplet's contentPane and would allow the same graphics in both. But again, please study the tutorials on all of this, otherwise you will be doing hit-or-miss programming, and that is no way to learn.
Much luck!
Addendum: Also, if you are just beginning in Java programming, I suggest you start with the basics and not with Swing / AWT / graphics programming. Otherwise you will just end up bruised and disappointed. You have to learn to walk before you can run.
Edited by: Encephalopathic on Dec 26, 2007 5:09 AM

Similar Messages

  • Hi,my name is Hemanth.Im using ipod touch and my ipod is not detecting in itunes  but detecting in my computer.Im using windows7 os.I tried the troubleshooting process given in web but still it not working please help me.

    Hi,my name is Hemanth.Im using ipod touch and my ipod is not detecting in itunes  but detecting in my computer.Im using windows7 os.I tried the troubleshooting process given in web but still it not working please help me.

    Did you try everything here:
    iOS: Device not recognized in iTunes for Windows
    Then try a different computer to help determine if yo have an IPod or computer problem.

  • My ipad mini and iphone 4s are not connecting over bluetooth. iphone cannot locate ipad mini or says it is not supported. It used to work perfectly but now its not working. please help.

    my ipad mini and iphone 4s are not connecting over bluetooth. iphone cannot locate ipad mini or says it is not supported. It used to work perfectly but now its not working. please help.

    Hi
    Thanks for the support but I had already tried this . Again did it as you advised. Still not able to connect the ipad mini with Bluetooth.
    Could it be that some app is causing issue. I can connect my car and computer over Bluetooth but not ipad mini.
    On the other had ipad is connecting to other iPhone but only not mine.
    Still showing ipad not supported message. And also shows not paired.
    Please help.

  • Hey, I wanna download Lion for free, so i need UP-TO-DATE , but it do not works , please help

    Hey, I wanna download Lion for free, so i need UP-TO-DATE , but it do not works , please help

    I think you misunderstood the guy. The up-to-date program isn't working for a lot of people. I'm eligible for the free upgrade but it fails to recognise my serial. From what I've read, this is affecting a lot of people who purchased their computers online. Apple seems to be fixing the issue though, so my advice would be to keep trying. Alternatively, click on the manual verificaton link so they can check your order for you and send the redemption code after they do.

  • HT201320 I have ne iphone 5, i been setting my email using AT&T global but it is not working, please help me on the correct configuration

    I have ne iphone 5, i been setting my email using AT&T global but it is not working, please help me on the correct configuration

    Contact the email provider and obtain the correct setup information.

  • HT1320 i have tried all of the above to reset my 30gb ipod but its still not working, please help

    Hi, i have a ipod classic, it now wont turn on or do anything, i have charged it, toggled the HOLD button and tried all the suggested press and hold, but nothing. Ive tried conecting it to the computer via a USB cable again nothing, its not even showing on my Itunes account when thats turned on.
    Any one got any ideas, TIM

    Have you left the iPod to charge for a couple of hours and then tried resetting it again? It can take up to at least 30 minutes of charging before an iPod with a dead battery shows any signs of life.  By a reset, I assume you mean pressing and holding both the Select/Center and Menu buttons together long enough for the Apple logo to appear?
    iPod won't turn on
    B-rock

  • I just got a new ipod and i dont know how to use it. it keeps asking me for wifi connection or to log on to itunes. i logged on to itunes but its still not working please help

    please help me use my ipod touch. i just got it and im a little confused on how to use it. it keeps asking for a wifi connection even while im logged in on itunes

    iPod touch User Guide (For iOS 5.1 Software)
    Are you connected to wi-fi?
    If not, then connect.

  • HT1222 I just installed this update and now I cannot access "Mail" at all.  I tried reinstalling the program, but that does not work, either.  Help!!!!!!

    I just installed this update and now I cannot access "Mail" at all.  I tried reinstalling the program, but that does not work, either.  Help!

    Paldeng, thanks for the suggestion.  I've done all that.  I can connect to the server, but apparently they are not recognizing my ID and password.  I can use the server program if I don't go through Mail (using the same ID and password).  My mother in another state with another provider has had the same email issue, as also my husband on his laptop who uses the same internet connection I do.  His worked fine until we had it repaired at the Apple store and all the original programs reloaded (with the required updates, I assume).  We can receive email in Mail, we just cannot send.
    I contacted my service provider, and we went over my connections.  They said it was not their problem and connected me with Apple, resulting in a charge to me because my warranty is long expired.  Apple swears it is not their problem, it is the provider, so here I sit.  My son was able to fix my Mom's Mail (she's 97) and got my husband's working also, until mine went out, by tweaking connection descriptions and ports remotely.  The thing is, we had not messed with any of those settings, so what changed?  I just did not want to bother my son again, as he has many other demands on his time.
    Since this fiasco with the Mail v4.6 update, I'm wondering if something else was updated that works well with Lion and Mountain Lion, but does not work well with Snow Leopard and Leopard.  I think the problem I had with the Mail update was that my Mail program had been renamed to Mail (original), and therefore was not being recognized by the update.  Perhaps they had another tweak in there somewhere that is affecting outgoing mail connections?

  • HT1338 i qualified for free mac os upgradation program but i lost the password. please help me out...

    i qualified for free mac os upgradation program but i lost the password. please help me out...
    my apple id is: [email protected]

    What password, you don't need a password... Just go here...
    https://uptodate.apple.com/UtdPrepareAction?program=Mountain%20Lion&locale=en_us

  • I qualified for free mac os upgradation program but i lost the password. please help me out...

    i qualified for free mac os upgradation program but i lost the password. please help me out...

    http://support.apple.com/kb/HE57

  • My ipod touch is disabled for 212,456,786 minutes! I have tried to restore and followd all instructions on the apple support site but this has not worked. Help!

    My ipod touch has been disabled for 212,456,875 minutes! I have followed all instructions on the apple support site to restore it but this has not worked. Help!

    Without know exactly what you did or what happened:
    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Forgot passcode or device disabled
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:                                                             
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes       
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:                         
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.

  • TS1398 I have an iPad 2 that is updated and using 6.0.1. It is connecting to my wifi just fine. I just purchased a 4th generation iPad. It shows it is connected to the same wifi, same strong signal, but it will not work. HELP!!!

    I have an iPad 2 that is updated and using 6.0.1. It is connecting to my wifi just fine. I just purchased a 4th generation iPad. It shows it is connected to the same wifi, same strong signal, but it will not work. HELP!!!

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • I installed windows 7 on my macbook pro. all is working but lan adaptor and sound od laptop is not working. please help me or send the link where i can download the these drivers.

    I installed windows 7 on my macbook pro. all is working but lan adaptor and sound od laptop is not working. please help me or send the link where i can download the these drivers.I have lost my resource cd .

    If you are running Lion or Mountain Lion, the drivers are downloaded from within Bootcamp Assistant. If you are running Snow Leopard the drivers are on your Snow Leopard install disk.
    Read the Bootcamp Install Guide for your version of OSx. http://www.apple.com/support/bootcamp/
    Bootcamp questions should be asked in the Bootcamp forum where the Bootcamp gurus hang out https://discussions.apple.com/community/windows_software/boot_camp

  • HT4623 iOS 6.1 no longer available because you are no longer connected to the internet- this is what my iphone 4 shows. iv tried switching off again and again, closing apps by double tapping the home button but still not working. please help.

    this is what my iphone 4 shows. iv tried switching off again and again, closing apps by double tapping the home button but still not working. please help.
    is there any other method to download ios 6.1.2.
    my phone is not being recognized by itunes on my new windows 8. neither its working on touch copy.
    kindly help.
    thanks

    well in thatcase, i need another help .
    thanks for your instant reply.
    i have currently bought a new laptop (windows 8) and my iphone is not being recognized by itunes.
    because i have no backup on my previous laptop, i downloaded touchcopy but even touch copy is not recognizing my iphone.

  • I have deployed one application containing youtube video but it is not working pls help

    I have deployed one application containing youtube video but it is not working pls help Application is build using struts2 and is deployed in oracle cloud, login page works fine but the success page is not displayed please help

    Hello,
    A wild guess, given the lack of details:
    I wonder whether it would violate the http://en.wikipedia.org/wiki/Same-origin_policy ?
    This is part of the security infrastructure.
    "Stealing" content to insert it anywhere else might also violate copyrights?
    Technically, does it at least work "on premises" onto WLS 10.3.6?
    Regards
    Patrick.

Maybe you are looking for

  • ODI 11g Logical Schema Error [Error Code: 1222]

    Hi, One of my ODI Jobs is failing with an error "ODI-1222: Session start failure on agent Internal: logical schema BIAPPS_11g_RA cannot be found in the master repository." BIAPPS_11g_RA = Logical Schema in our System. However, all the other Jobs of t

  • PSE 7 Disappointing  Email Options...

    Hi all, I purchased PSE 7 for Windows as a gift for my wife, since PS Extended is a bit over the top for her. With all the awards and hype in the videos, I was geared up for a great program. Some stuff is great, but some stuff is, well, kind of insan

  • Java.lang.IndexOutOfBoundsException: SelectOne submittedValue's index 1 is

    I have two drop down. If i change value in 1st drop down, the 2nd drop down value list changes( i am using using autoSubmit and partialTriggers ). But when i try to change the value in 2nd drop down list, and again change the value in the 1st dropdow

  • More quality questions

    Wait, for best quality on my video should I use best performance or professional quality setting. My movie is 27 minutes long shot from a Sony Handy Cam? And I should set the encoding speed to 4X? Also, I have a wide screen setting on my Handy Cam, s

  • Complaints department contact details

    Is there a contact number / email for complaints about poor Apple customer service? I had a beyond ridiculous conversation with one of their non-support staff, and when I shared my perception of the customer service that she was offering and asked to