Need help in drawing inside the Oval and outside it

I need help in something
I have an array and I want the numbers to be around the oval and I have part of the array and I want to fill part of the oval
and when I want to put a number I would like a line from the center to point at the number
I know its hard to explain so I have picture maybe you will know hwo its work
http://img265.imageshack.us/i/55788522.jpg/
I have almost everything done the oval and all the code but I have no clue how to do what I explained

import static java.lang.Math.*;
import java.awt.*;
import javax.swing.*;
@SuppressWarnings("serial") public class Trefoil extends JComponent {
        setPreferredSize(new Dimension(400, 400));
    @Override protected void paintComponent(Graphics g) {
        Graphics2D g2 = (Graphics2D) g.create();
        int w = getWidth(), h = getHeight();
        g2.setColor(getBackground());
        g2.fillRect(0, 0, w, h);
        g2.setColor(getForeground());
        g2.translate(w/2, h/2);
        g2.setRenderingHint(
            RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
        int rays = 100;
        for(int i=0; i<rays; ++i) {
            double angle = i*(2 * PI)/rays;
            double flange = cos(1.5* angle - PI/4);
            int r = (int)(190 * flange * flange);
            int x = (int)(r* cos(angle));
            int y = (int)(r* sin(angle));
            g2.drawLine(0, 0, x, y);
        g2.dispose();
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable(){
            public void run() {
                JFrame f = new JFrame("Trefoil");
                f.add(new Trefoil());
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.pack();
                f.setLocationRelativeTo(null);
                f.setVisible(true);
}

Similar Messages

  • I need help quick please sold the iPod and before handing it over wanted to clear out info so pushed erase now there is only a plug icon for iTunes but it won't now recognize my computer what can I do??

    I need help quick please sold the iPod and before handing it over wanted to clear out info so pushed erase now there is only a plug icon for iTunes but it won't now recognize my computer what can I do??

    Try
    iOS: Device not recognized in iTunes for Windows
    or
    iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X

  • I need help my computer isn't working and there is no was to get on my iTunes and I just updated my phone and now it's stuck on where it shows the plug connected to iTunes help!!!!

    I need help my computer isn't working and there is no was to get on my iTunes and I just updated my phone and now it's stuck on where it shows the plug connected to iTunes help!!!!

    There is no other way than to plug into a computer to restore the phone. You can use another computer to do so, but in case you did not back up to iCloud your data and settings will be gone.
    Follow this article to connect in recovery mode:
    iOS: Unable to update or restore

  • I need help! I updated the new 6.1.3 last night. Since that time my phone will not charge. The phone is plugged in and shows as charging but the battery still drains. What can I do? I need help!

    I need help! I updated the new 6.1.3 last night. Since that time my phone will not charge. The phone is plugged in and shows as charging but the battery still drains. What can I do? I need help!

    Restore iPhone with iTunes on your computer.

  • I need help syncing my contacts between Outlook and iPhone using iTunes. I followed the steps given and ended up with just email addresses showing in my contacts even though I have phone numbers and snail mail in my Outlook Contacts. Using  Windows 7

    I need help syncing my contacts between Outlook and iPhone using iTunes. I used the knowldge document and set it up to transfer my Outlook contacts to the iphone using itunes.
    In contacts on the iphone I only see the email addresses.
    Yet in Outlook I have email, snail mail and phone numbers.
    I followed the knowledge document from iphone.
    I did it once, didn't work so deleted all the contacts from the phone and tried again. Same result. I have a PC using Windows 7 64 bit.

    You can't access an Exchange account via ActiveSync with the Address Book and iCal on your Mac.
    You can access a MM account with Outlook on your PC at work and keep your MM email account server stored mailboxes synced between your PC at work, your iPhone, and the MM "cloud". Not sure about syncing MM contact info and calendar events with Outlook at the same time with an Exchange account.
    This will not provide for syncing your Exchange account contact info and calendar events with the Addresss Book and iCal on your Mac because the accounts are separate.
    You can access an Exchange account and a MM account at the same time with the iPhone's mail client, and sync contact info and calendar events over the air with both accounts at the same time. You can view combined contact info or separately for each account, and the same for calendar events.

  • I need help! I have iPad mini and I can't use App Store. It always asking my credit card lnformation to download, but the apps I will download are free. I don't know how it will work again.

    I need help!
    I have iPad mini and I can't use App Store.
    It always asking my credit card lnformation to download, but the apps I will download are free.
    I don't know how it will work again.
    Help me please!
    Thank you.

    You need to have a payment method on file. If the apps are free you will not be charged anything. Either enter your credit card information or purchase and enter an iTunes gift card.

  • I need help! I have the iphone 5 and I want to buy the whastsaap, but it turns out I get to put the answers up and answer the questions but I do not remember. Someone could help me? Help! Thank you!

    I need help! I have the iphone 5 and I want to buy the whastsaap, but it turns out I get to put the answers up and answer the questions but I do not remember. Someone could help me? Help! Thank you!

    Security questions:
    https://discussions.apple.com/thread/4533485?tstart=0

  • HT1430 guys, I need help, im trying to the the new software IOS 7.0 and it requires 3.7 GB free space. im using the IPhone4 and it had 6.4 GB capacity. i've deleted so much and it still says I only have 1.4 GB, I dont understand where the 5GB are being us

    guys, I need help, im trying to the the new software IOS 7.0 and it requires 3.7 GB free space. im using the IPhone4 and it has 6.4 GB capacity. i've deleted so much and it still says I only have 1.4 GB, I dont understand where the 5GB are being used.
    has any one experienced that? I cancelled my icloud account coz i tot the 5GB where there. im so confused. please help.
    Dee

    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider should one appear until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • I need help to draw in a frame, please

    Hi Im new to java and I need some help to draw a rainbow in a frame. I already made the frame , but i dont know how to draw inside the frame.
    here is my code so far:
    import java.awt.*;
    import javax.swing.*;
    public class Regnbue {
         public static void main(String[]args){
              JFrame ramme = new JFrame();
              ramme.setSize(600,300);
              Container cp = ramme.getContentPane();
              cp.setBackground(Color.white);
              ramme.setVisible(true);
    any help to finish this simple draw would be nice!!
    thanx

    I forgot , here is my code so far :
    import java.awt.*;
    import javax.swing.*;
    public class Regnbue {
         public static void main(String[]args){
              Rainbowpanel r= new Rainbowpanel();// her is where i make
    // my frame I think.
              JFrame ramme = new JFrame();
              ramme.setSize(600,300);
              Container cp = ramme.getContentPane();
              cp.setBackground(Color.white);
              ramme.setVisible(true);
    class Rainbowpanel extends JPanel {
         public void paintComponent(Graphics g) {// this is the part that I
    // dont understand, how can I put the arc into the container above??
              super.paintComponent(g);
              g.fillArc(5, 5, 10, 50, 0, 180);
         thanks
    elektropan

  • I dropped my iphone and when i picked it up it was working but as soon i got inside the house and turned it on, the screens lights up black then it goes completely white

    he;lpp!! i dropped my iphone and face down on the screen andwhen i picked it up it was working and everything , when i got inside the house and checked it the screen goes black then it goes white and stays then shuts off and the same thing happens when you push the home button, plus im still able to recieve and get text messages i just cant see cause the screen.... help me like NOW !!!!!!!! haha i really dont wanna take it to a shop and pay money !!

    You can try resetting it: Hold down the Home and Power buttons at the same time and continue to hold them down until the Apple appears (up to 30 seconds). If you are able to see the Apple, then the reset is in progress, and the Home screen will display shortly.
    If you are not able to see the Apple, then you are going to need to make a trip to the Apple Store.
    Cheers,
    GB

  • I actually need help but cannot find the answer. Please.......Lately when open a new tab it does not open with a blank page. I don't want to set my homepage as

    I actually need help but cannot find the answer.
    Please.......Lately when open a new tab it does not open with a blank page. I don't want to set my homepage as blank as when I first open Firefox, it automatically loads my hotmail page. But then if I open other pages I don't get a blank page. Help, please?
    Thank you.
    ''[Personal information removed by moderator. Please read [[Forum and chat rules and guidelines]], thanks.]''

    hello, please refer to [[New Tab Page – show, hide and customize top sites]] in order to switch the feature off.

  • I buy for mac app but not for the iPad, so how do I reinstall a program that has already purchased? I need help because I bought the imovie'11 but when he opened it only brought 8 movie trailer templates instead of the 15 it says on the program. How do I

    I buy for mac app but not for the iPad, so how do I reinstall a program that has already purchased? I need help because I bought the imovie'11 but when he opened it only brought 8 movie trailer templates instead of the 15 it says on the program. How do I solve this problem? Once paid for a program incomplete. I also liked that the AppStore itself had a button to reinstall programs already bought, because it is very hard to understand how to do this in the store, only option is to install and hide purchase, and how do I reinstall, attention'm talking about reinstalling a computer mac, not an ipad or iphone.
    Thank you.

    Prodesigntools.com , go ahead and download the software from there and use your serial number to serialize it.

  • Need help my window is in thai and i dont understand at all.how to convert to english?

    need help my window is in thai and i dont understand at all.
    how to convert to english? i been trying for days but still cannot change it.
    because i cannot read thai..please help me step by step..
    my pc is touchsmart 9100 windows 7 professional.
    Not a single word is in english if i go to  'region and language' to change it.
    Everthing is in thai in the system.
    This question was solved.
    View Solution.

    Hi,
    OK. That means the default display lange of the OS is Thai. That is what was purchased. 
    You can try downloading  and using the  language appropriate LIPS (language interface package software) from Microsoft to change the  display language.
    Best regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook.......

    need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook? removal of cmos, resetting laptop, using cccleaner, windows password recovery and hiren's was noneffective, any help is appreciated. thanks

    Hi,
    As your notebook is a business class machine, security is more stringent - the password is stored in non-volatile memory and there are no 'backdoor' passwords.  Your best option would be to contact HP regarding this.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Please help I've lost the question and answer confidential My Account

    Please help I've lost the question and answer confidential My Account

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then the steps half-way down this page should let you reset them : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you will need to contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

Maybe you are looking for

  • Table does not exist

    Folks, My aim is to populate a column with user details who inserts/modifies a record in a table. I am able to use the below sql successfully in PL/SQL but, when I put it into a database trigger (before insert)it comes up with an error 'table not fou

  • SMARTFORM:  How to print on document per row in an internal table

    Hi. I have created a SmatForm that is a one-page document to be printed once for every row in an itab I'm sending it via the Table Interface. I hope I didn't waste my time designing this form but I created several Windows for each section (header, re

  • Strange duplex printing problem with AR 9.1.3

    Hi. I recently upgraded my acroread to 9.1.3 (archive.canonical.com in Ubuntu Hardy). Since I did it, I've got this odd behaviour: - I can print at single side with acroread 9.1.3 - I can not print with duplex option. It states the job as "retained"

  • Icloud receiving emails with NO Sender, No Subject

    Over the last few weeks my iCloud account has been displaying lots of messages with No Sender, No Subject in the header. The majority of these are automated email services like reservation acknowledgements etc. It is effecting all my devices that use

  • Best practice for WFMailer in a cloned environment

    Hi, What are the best practices to purge/clear out old notifications when we refresh dev instances from prod? Also, what steps do we need to restrict future messages going to all the users. I have been clearing out the email from the fnd_user table,