How to expand an oval in an animation?

I am taking a beginner Java online course and am at the 2nd to last lesson and I am having a hard time figuring out the following assignment and have only gotten the oval to move across the screen not to expand. Any suggestions or tips with the following are appreciated.
Assignment instructions:
Create an applet named GoOval that draws a gradually- growing, small blue oval. Increase the width of the oval by perhaps one pixel every fifth of a second or so.
If you'd like, you can try increasing the height of the oval by one pixel at the same time its width is increasing by one pixel. Don't create another loop--you should be able to increase the width in the exact same loop that you are using to increase the height.
If you'd like a real challenge, try to make the oval move around in the applet window as it grows (perhaps by allowing the oval's x or y position to change in the same loop you are using to change the oval's width and height).
No need to send me your applet, but please post a message within the Discussion Area if you have any difficulties.
What I did so far:
import java.awt.*;
public class GoOval extends java.applet.Applet implements Runnable
int pos=10;
Thread animator;
public void start()
animator = new Thread(this);
animator.start();
public void stop()
animator = null;
} public void paint(Graphics g)
g.setColor(Color.blue);
     g.fillOval(pos,10,10,10);
public void run()
{        while (Thread.currentThread() == animator)
pos=pos+10;
repaint();
try
Thread.sleep(100);
catch (InterruptedException e)
break;
if (pos >= 300)
pos=10;
     

You about had it, just added three more variables; maybe yo only wanted two for size and not height:
/*<applet code=GoOval.class width=400 height=300></applet>*/
import java.awt.*;
public class GoOval extends java.applet.Applet implements Runnable {
  int pos=10, posy=10, wdth=10, hght=10; // Added three more variables
  Thread animator;
  public void start() {
    animator = new Thread(this);
    animator.start();
  public void stop() {
    animator = null;
  public void paint(Graphics g)  {
    g.setColor(Color.blue);
    g.fillOval(pos,posy,wdth,hght); // Chgd
  public void run() {
    while (Thread.currentThread() == animator)  {
      pos+=10;
      posy+=10; // added
      wdth+=10; // added
      hght+=10; // added
      repaint();
      try {
        Thread.sleep(100);
      catch (InterruptedException e) {
        break;
      if (pos >= 300) {
        pos=10;
        posy=10; // added
        wdth=10; // added
        hght=10; // added
}~Bill

Similar Messages

  • How to make a oval shape in java

    how to make an oval shape in java

    here's a simple example:
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.Color;
    /* <applet code="OvalTest" width=83 height=43></applet> */
    public class OvalTest extends Applet {
         public void init() {
              setBackground(Color.white);
         public void paint(Graphics g) {
              g.setColor(Color.blue);
              g.fillOval(1,1,80,40);
    }

  • How to make a Transparence Background GIF Animated??

    Hi,
    How to make a Transparence Background GIF Animated??
    Any Special Pro software do i need like Photoshop ?
    Posible to use Keynote or something like that?
    Thanks

    See my response to your other topic in this forum.
    OT

  • How to expand the hierarchy column automatically when delivery reports by a

    Hi Experts,
    In OBIEE 11.1.1.6.0,how to expand the hierarchy column automatically when delivery reports by agent?
    For example:
    In SampleLite RPD, when we drag "Time Hierarchy" and Sales column into the report , and sent it by agent ,it will only display "Total" sales, not show all level value,such as Year,Month,Day.So how to expand the hierarchy column automatically when delivery reports by agent?
    If we expand all levels and save them, it will be ok, however, when we add new data, it will be collpased automatically and not show the lowest level data, requiring Users or Developer to modify this report for expanding the hierarchy. We think it is very trouble, is there any good suggestion or method for achieving our requirement?

    958054 wrote:
    Hi Dpka,
    Is it any difference? I look at the result is same.
    Firstly, you said it is 'Add member of ',
    Now, you said it is 'Keep member of'
    Could you please tell me which options I must select ? Thanks very much.Here is some notes from the documentation to make a better sense of how those two options would work:
    •Selection steps — When you create selection steps, you can add a group or a calculated item in a step. Subsequent Keep Only or Remove steps might reference members that were included in the group or calculated item.
    ◦A group list is affected by members that are kept or removed in subsequent steps, but the group outline value remains the same. For example, suppose the MyNewYork group contains Albany and Buffalo and its value is 100. Suppose Albany is removed in a later step. The value of the MyNewYork group remains at 100, but Albany is no longer listed with the group.
    ◦A calculated item is not affected by members that are kept or removed in subsequent steps, because removals can affect the components of the formula.
    •Groups and calculated items — A step can include a group or calculated item. Groups and calculated items can be used only with Add steps; they cannot be used in Keep Only or Remove steps.

  • How to Expand the Screen of Windows Server 2003 on VMware Server 2 ?

    Folks,
    Hello. Because Windows 7 is not compatible to be installed PeopleSoft PIA, I have to install VMware Server 2 and then install Windows Server 2003, that is compatible with PIA, on the virtual machine.
    But when I open Windows Server 2003 on the virtual machine, the screen of Win2K3 is very small, and its size is about 1/4 of the screen of my computer screen. This is not comfortable to work for a long time.
    Does any folks know how to expand the screen of Windows Server 2003 on VMware Server 2 virtual machine so that its size covers the entire screen of my computer ?
    Thanks in advance !
    Lucy

    Did you already installed the VMWare tools onto your VMWare guest OS ? Generally, it helps a lot to be able to redefine a larger screen definition.
    Nicolas.

  • How to expand the folder via applescript?

    Dear apple experts,
    How to expand the folder via applescript?
    Manually we are using command + option + right arrow, but how we handle this in applescript?
    Thanks in advance,
    Velladurai.G

    Hello
    Finder's container's "expanded" and "completely expanded" properties have long been marked "NOT AVAILABLE YET" under OSX:
    Finder.sdef > Containers and Folders suite
    container n [inh. item] : An item that contains other items
        elements
            contains items, containers, folders, files, alias files, application files, document files, internet location files, clippings, packages.
        properties
            entire contents (specifier, r/o) : the entire contents of the container, including the contents of its children
            expandable (boolean, r/o) : (NOT AVAILABLE YET) Is the container capable of being expanded as an outline?
            expanded (boolean) : (NOT AVAILABLE YET) Is the container opened as an outline? (can only be set for containers viewed as lists)
            completely expanded (boolean) : (NOT AVAILABLE YET) Are the container and all of its children opened as outlines? (can only be set for containers viewed as lists)
            container window (specifier, r/o) : the container window for this folder
    A way to expand a given folder is to use keystroke command of System Events to invoke the keyboard shortcut in Finder. Something like the following script.
      kLeftArrowCharCode            = 28,
      kRightArrowCharCode           = 29,
      kUpArrowCharCode              = 30,
      kDownArrowCharCode            = 31,
    --set f to (path to downloads folder from user domain) -- target folder e.g.
    set f to (choose folder)
    tell application "Finder"
        reveal f
        tell Finder window 1
            set cv to current view
            if cv = column view then return -- do nothing
            if cv = icon view then set current view to list view
        end tell
        my _keystroke(it, character id 29, {option down, command down}, 0.2)
    end tell
    on _keystroke(_app, _key, _modifiers, _delay)
            reference _app : application reference
            string _key : character(s) to be keystroked [1]
            list _modifiers : list of modifier key to be pressed; enumerations are
                    command down
                    option down
                    shift down
                    control down
            number _delay : post-delay amount [sec]
            [1] Character must be present on the current keyboard layout. Otherwise, it is replaced by 'a'.
        tell _app to activate
        tell application "System Events"
            tell (process 1 whose bundle identifier = (_app's id))
                keystroke _key using _modifiers
            end tell
        end tell
        if _delay > 0 then delay _delay
    end _keystroke
    Regards,
    H

  • How do I create a line-Map animation effect

    How do I create a Line-Map animation effect?
    i am trying to highlight a 'Route' on a map.

    Are you using PSE or Premiere Elements? You can't do this in PSE. For PRE, better to ask in their forum, since very few of us here use it:
    http://forums.adobe.com/community/premiere_elements

  • I'm using adobe photo shop elements 9. I can't figure how to put an oval haze around the picture

    I'm using adobe photoshop elements 9. I'm trying to figure out how to put an oval haze around a picture

    Use the menu:
    Filter >> Camera Distortion
    There is a vignette option which you can get by using the sliders.

  • How to expand B2B document

    I login B2B and click the document link.
    The Document Protocols are listed but are not expanded. I have to click the + icon to view the docu I have created and discard the change.
    How to expand them?

    B2B version is 11.1.1.2
    I am new in B2B and learing the B2B sample (b2b-101-custom-generic-file.pdf) download from Oracle.
    I create Custom (version 1.0 and import the schema file) Document Protocol.
    Then, I turn off the PC.
    After I trun on the B2B, I find all protocols are not expanded. I need to view the document protocol which I have not finished.
    I have to click the Add icon (+). Then the Custom protocol is expanded. But I have to discard the change.
    What I want to do is I want all the protocols are expanded automatically after the page is loaded.

  • How to create a oval shape JButton?

    Dear All,
    Can you please tell me how to create an Oval shaped Jbutton. Please send me code if possible.
    Regards,
    Sat

    You can check out the Substance look-and-feel project at:
    https://substance.dev.java.net/
    https://substance-button-shaper-pack.dev.java.net/
    A substance plugin is also available for NetBeans:
    http://www.netbeans.org/kb/50/substance-look-and-feel.html

  • Beginner Flash question: How do I create a "step" style animation?

    How do I create a "step" style animation? For certain movements, I don't want a smooth transition. I want position A to jump to position B immediately at the appropriate marker in the Timeline, not a gradual movement from point A to point B. Thanks in advance!
    Alex
    N33Z

    just create keyframes with your displayobject positioned and do not using tweening between the keyframes.  or use actionscript and a timer to change the object's position.

  • How do you get to use an animated finger instead of the cursor?

    Hello. I've seen in a screenshot video that a developer was showing how his app works by using an animated finger instead of the regular arrow (cursor). Does anybody know what's the name of that finger program/app?
    Thanks!

    Actually, i just found it. It's called PhoneFinger: wonderwarp.com/phonefinger/

  • I need to know how to expand the browser window so it fills my laptop screen

    i need to know how to expand the browser window so it fills my laptop screen this isnt  about the + or - tabs

    have a look at the top left of your browser window that looks like two arrows pointing up and down in a slant, click it and it will put your browser in full screen mode...

  • How do I center objects (photos and animations) so they stay centered with the other page elements?

    How do I center objects (photos and animations) so they stay centered with the other page elements?

    Geez .. Your class doesn't fulfill the javabean specifications. The properties should not be public.
    It should rather look likepublic class TheAddress {
        // Properties ---------------------------------------------------------------------------------
        private String address1;
        private String address2;
        // Constructors -------------------------------------------------------------------------------
        public TheAddress() {
            // Default constructor.
        public TheAddress(String address1, String address2) {
            // Full constructor.
            this.address1 = address1;
            this.address2 = address2;
        // Getters ------------------------------------------------------------------------------------
        public String getAddress1() {
            return address1;
        public String getAddress2() {
            return address2;
        // Setters ------------------------------------------------------------------------------------
        public void setAddress1(String address1) {
            this.address1 = address1;
        public void setAddress2(String address2) {
            this.address2 = address2;
    }

  • How can I change  oval shape applet to (plot)

    Hi this is not my code so, the orignal code is freeware to www.neuralsemantics.com and is Copyright 1989 by Rich Gopstein and Harris Corporation.
    The site allows permission to play with the code or ammend it.
    how could I modify the applet to display (plot) several cycles of the audio signal instead of the elliptical shape. The amplitude and period of the waveform should change in accordance with the moving sliders
    Here is the code from www.neuralsemantics.com /applets/jazz.html
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class JazzMachine extends Applet
                 implements Runnable, AdjustmentListener, MouseListener {
      // program name
      final static String TITLE = "The jazz machine";
      // Line separator char
      final static String LSEP = System.getProperty("line.separator");
      // Value range
      final static int MIN_FREQ = 1;   // min value for barFreq
      final static int MAX_FREQ = 200; // max value for barFreq
      final static int MIN_AMPL = 0;   // min value for barVolume
      final static int MAX_AMPL = 100; // max value for barVolume
      // Sun's mu-law audio rate = 8KHz
      private double rate = 8000d;      
      private boolean audioOn = false;     // state of audio switch (on/off)
      private boolean changed = true;      // change flag
      private int freqValue = 1;           // def value of frequency scrollbar
      private int amplValue = 70;          // def value of volume scrollbar
      private int amplMultiplier = 100;    // volume multiplier coeff
      private int frequency, amplitude;    // the requested values
      private int soundFrequency;          // the actual output frequency
      // the mu-law encoded sound samples
      private byte[] mu;
      // the audio stream
      private java.io.InputStream soundStream;
      // graphic components
      private Scrollbar barVolume, barFreq;
      private Label labelValueFreq;
      private Canvas canvas;   
      // flag for frequency value display
      private boolean showFreq = true;
      // width and height of canvas area
      private int cw, ch;
      // offscreen Image and Graphics objects
      private Image img;
      private Graphics graph;
      // dimensions of the graphic ball
      private int ovalX, ovalY, ovalW, ovalH;
      // color of the graphic ball
      private Color ovalColor;
      // default font size
      private int fontSize = 12;
      // hyperlink objects
      private Panel linkPanel;
      private Label labelNS;
      private Color inactiveLinkColor = Color.yellow;
      private Color activeLinkColor = Color.white;
      private Font inactiveLinkFont = new Font("Dialog", Font.PLAIN, fontSize);
      private Font activeLinkFont = new Font("Dialog", Font.ITALIC, fontSize);
      // standard font for the labels
      private Font ctrlFont;
      // standard foreground color for the labels
      private Color fgColor = Color.white;
      // standard background color for the control area
      private Color ctrlColor = Color.darkGray;
      // standard background color for the graphic ball area
      private Color bgColor = Color.black;
      // start value for the time counter
      private long startTime;
      // maximum life time for an unchanged sound (10 seconds)
      private long fixedTime = 10000;
      // animation thread
      Thread runner;
    //                             Constructors
      public JazzMachine() {
    //                                Methods
      public void init() {
        // read applet <PARAM> tags
        setAppletParams();
        // font for the labels
        ctrlFont = new Font("Dialog", Font.PLAIN, fontSize);
        // convert scrollbar values to real values (see below for details)
        amplitude = (MAX_AMPL - amplValue) * amplMultiplier;
        frequency = (int)Math.pow(1.2d, (double)(freqValue + 250) / 10.0);
        setLayout(new BorderLayout());
        setBackground(ctrlColor);
        setForeground(fgColor);
        Label labelVolume = new Label(" Volume ");
        labelVolume.setForeground(fgColor);
        labelVolume.setAlignment(Label.CENTER);
        labelVolume.setFont(ctrlFont);
        barVolume = new Scrollbar(Scrollbar.VERTICAL, amplValue, 1,
                         MIN_AMPL, MAX_AMPL + 1);
        barVolume.addAdjustmentListener(this);
        // assign fixed size to the scrollbar
        Panel pVolume = new Panel();
        pVolume.setLayout(null);
        pVolume.add(barVolume);
        barVolume.setSize(16, 90);
        pVolume.setSize(16, 90);
        Label labelFreq = new Label("Frequency");
        labelFreq.setForeground(fgColor);
        labelFreq.setAlignment(Label.RIGHT);
        labelFreq.setFont(ctrlFont);
        barFreq = new Scrollbar(Scrollbar.HORIZONTAL, freqValue, 1,
                      MIN_FREQ, MAX_FREQ);
        barFreq.addAdjustmentListener(this);
        // assign fixed size to the scrollbar
        Panel pFreq = new Panel();
        pFreq.setLayout(null);
        pFreq.add(barFreq);
        barFreq.setSize(140, 18);
        pFreq.setSize(140, 18);
        // show initial frequency value
        labelValueFreq = new Label();
        if (showFreq) {
          labelValueFreq.setText("0000000 Hz");
          labelValueFreq.setForeground(fgColor);
          labelValueFreq.setAlignment(Label.LEFT);
          labelValueFreq.setFont(ctrlFont);
        Panel east = new Panel();
        east.setLayout(new BorderLayout(10, 10));
        east.add("North", labelVolume);
        Panel pEast = new Panel();
        pEast.add(pVolume);
        east.add("Center", pEast);
        Panel south = new Panel();
        Panel pSouth = new Panel();
        pSouth.setLayout(new FlowLayout(FlowLayout.CENTER));
        pSouth.add(labelFreq);
        pSouth.add(pFreq);
        pSouth.add(labelValueFreq);
        south.add("South", pSouth);
        linkPanel = new Panel();
        this.composeLink();
        Panel west = new Panel();
        // dummy label to enlarge the panel
        west.add(new Label("      "));
        add("North", linkPanel);
        add("South", south);
        add("East", east);
        add("West", west);
        add("Center", canvas = new Canvas());
      private void composeLink() {
        linkPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
        linkPanel.setFont(inactiveLinkFont);
        linkPanel.setForeground(Color.yellow);
        Label labelName = new Label(TITLE + " \u00a9");
          labelName.setForeground(inactiveLinkColor);
          labelName.setAlignment(Label.RIGHT);
        labelNS = new Label(" Neural Semantics   ");
          labelNS.setForeground(inactiveLinkColor);
          labelNS.setFont(inactiveLinkFont);
          labelNS.setAlignment(Label.LEFT);
        linkPanel.add(labelName);
        linkPanel.add(labelNS);
        // link to Neural Semantics website
        String h = getDocumentBase().getHost();
        if ((h.length() > 4) && (h.substring(0, 4).equals("www.")))
          h = h.substring(4);
        if ((h != null) && (! h.startsWith("neuralsemantics.com"))) {
          // create a hand cursor for the hyperlink area
          Cursor linkCursor = new Cursor(Cursor.HAND_CURSOR);
          linkPanel.setCursor(linkCursor);
          labelName.addMouseListener(this);
          labelNS.addMouseListener(this);
      private void switchAudio(boolean b) {
        // switch audio to ON if b=true and audio is OFF
        if ((b) && (! audioOn)) {
          try {
            sun.audio.AudioPlayer.player.start(soundStream);
          catch(Exception e) { }
          audioOn = true;
        // switch audio to OFF if b=false and audio is ON
        if ((! b) && (audioOn)) {
          try {
            sun.audio.AudioPlayer.player.stop(soundStream);
          catch(Exception e) { }
          audioOn = false;
      private void getChanges() {
        // create new sound wave
        mu = getWave(frequency, amplitude);
        // show new frequency value
        if (showFreq)
          labelValueFreq.setText((new Integer(soundFrequency)).toString() + " Hz");
        // shut up !
        switchAudio(false);
        // switch audio stream to new sound sample
        try {
          soundStream = new sun.audio.ContinuousAudioDataStream(new
                            sun.audio.AudioData(mu));
        catch(Exception e) { }
        // listen
        switchAudio(true);
        // Adapt animation settings
        double prop = (double)freqValue / (double)MAX_FREQ;
        ovalW = (int)(prop * cw);
        ovalH = (int)(prop * ch);
        ovalX = (int)((cw - ovalW) / 2);
        ovalY = (int)((ch - ovalH) / 2);
        int r = (int)(255 * prop);
        int b = (int)(255 * (1.0 - prop));
        int g = (int)(511 * (.5d - Math.abs(.5d - prop)));
        ovalColor = new Color(r, g, b);
        // start the timer
        startTime = System.currentTimeMillis();
        // things are fixed
        changed = false;
    //                               Thread
      public void start() {
        // create thread
        if (runner == null) {
          runner = new Thread(this);
          runner.start();
      public void run() {
        // infinite loop
        while (true) {
          // Volume or Frequency has changed ?
          if (changed)
            this.getChanges();
          // a touch of hallucination
          repaint();
          // let the children sleep. Shut up if inactive during more
          // than the fixed time.
          if (System.currentTimeMillis() - startTime > fixedTime)
            switchAudio(false);
          // let the computer breath
          try { Thread.sleep(100); }
          catch (InterruptedException e) { }
      public void stop() {
        this.cleanup();
      public void destroy() {
        this.cleanup();
      private synchronized void cleanup() {
        // shut up !
        switchAudio(false);
        // kill the runner thread
        if (runner != null) {
          try {
            runner.stop();
            runner.join();
            runner = null;
          catch(Exception e) { }
    //                     AdjustmentListener Interface
      public void adjustmentValueChanged(AdjustmentEvent e) {
        Object source = e.getSource();
        // Volume range : 0 - 10000
        // ! Scrollbar value range is inverted.
        // ! 100 = multiplier coefficient.
        if (source == barVolume) {
          amplitude = (MAX_AMPL - barVolume.getValue()) * amplMultiplier;
          changed = true;
        // Frequency range : 97 - 3591 Hz
        // ! Scrollbar value range represents a logarithmic function.
        //   The purpose is to assign more room for low frequency values.
        else if (source == barFreq) {
          freqValue = barFreq.getValue();
          frequency = (int)Math.pow(1.2d, (double)(freqValue + 250) / 10.0);
          changed = true;
    //                     MouseListener Interface
      public void mouseClicked(MouseEvent e) {
      public void mouseEntered(MouseEvent e) {
        // text color rollover
        labelNS.setForeground(activeLinkColor);
        labelNS.setFont(activeLinkFont);
        showStatus("Visit Neural Semantics");
      public void mouseExited(MouseEvent e) {
        // text color rollover
        labelNS.setForeground(inactiveLinkColor);
        labelNS.setFont(inactiveLinkFont);
        showStatus("");
      public void mousePressed(MouseEvent e) {
        try {
          java.net.URL url = new java.net.URL("http://www.neuralsemantics.com/");
          AppletContext ac = getAppletContext();
          if (ac != null)
            ac.showDocument(url);
        catch(Exception ex){ }
      public void mouseReleased(MouseEvent e) {
    //                              Painting
      public void update(Graphics g) {
        Graphics canvasGraph = canvas.getGraphics();
        if (img == null) {
          // get canvas dimensions
          cw = canvas.getSize().width;
          ch = canvas.getSize().height;
          // initialize offscreen image
          img = createImage(cw, ch);
          graph = img.getGraphics();
        // offscreen painting
        graph.setColor(bgColor);
        graph.fillRect(0, 0, cw, ch);
        graph.setColor(ovalColor);
        graph.fillOval(ovalX, ovalY, ovalW, ovalH);
        // canvas painting
        if (canvasGraph != null) {
          canvasGraph.drawImage(img, 0, 0, canvas);
          canvasGraph.dispose();
    //                          Sound processing
      // Creates a sound wave from scratch, using predefined frequency
      // and amplitude.
      private byte[] getWave(int freq, int ampl) {
        int lin;
        // calculate the number of samples in one sinewave period
        // !! change this to multiple periods if you need more precision !!
        int nSample = (int)(rate / freq);
        // calculate output wave frequency
        soundFrequency = (int)(rate / nSample);
        // create array of samples
        byte[] wave = new byte[nSample];
        // pre-calculate time interval & constant stuff
        double timebase = 2.0 * Math.PI * freq / rate;
        // Calculate samples for a single period of the sinewave.
        // Using a single period is no big precision, but enough
        // for this applet anyway !
        for (int i=0; i<nSample; i++) {
          // calculate PCM sample value
          lin = (int)(Math.sin(timebase * i) * ampl);
          // convert it to mu-law
          wave[i] = linToMu(lin);
        return wave;
      private static byte linToMu(int lin) {
        int mask;
        if (lin < 0) {
          lin = -lin;
          mask = 0x7F;
        else  {
          mask = 0xFF;
        if (lin < 32)
          lin = 0xF0 | 15 - (lin / 2);
        else if (lin < 96)
          lin = 0xE0 | 15 - (lin-32) / 4;
        else if (lin < 224)
          lin = 0xD0 | 15 - (lin-96) / 8;
        else if (lin < 480)
          lin = 0xC0 | 15 - (lin-224) / 16;
        else if (lin < 992)
          lin = 0xB0 | 15 - (lin-480) / 32;
        else if (lin < 2016)
          lin = 0xA0 | 15 - (lin-992) / 64;
        else if (lin < 4064)
          lin = 0x90 | 15 - (lin-2016) / 128;
        else if (lin < 8160)
          lin = 0x80 | 15 - (lin-4064) / 256;
        else
          lin = 0x80;
        return (byte)(mask & lin);
    //                             Applet info
      public String getAppletInfo() {
        String s = "The jazz machine" + LSEP + LSEP +
                   "A music synthetizer applet" + LSEP +
                   "Copyright (c) Neural Semantics, 2000-2002" + LSEP + LSEP +
                   "Home page : http://www.neuralsemantics.com/";
        return s;
      private void setAppletParams() {
        // read the HTML showfreq parameter
        String param = getParameter("showfreq");
        if (param != null)
          if (param.toUpperCase().equals("OFF"))
            showFreq = false;
        // read the HTML backcolor parameter
        bgColor = changeColor(bgColor, getParameter("backcolor"));
        // read the HTML controlcolor parameter
        ctrlColor = changeColor(ctrlColor, getParameter("controlcolor"));
        // read the HTML textcolor parameter
        fgColor = changeColor(fgColor, getParameter("textcolor"));
        // read the HTML fontsize parameter
        param = getParameter("fontsize");
        if (param != null) {
          try {
            fontSize = Integer.valueOf(param).intValue();
          catch (NumberFormatException e) { }
      private Color changeColor(Color c, String s) {
        if (s != null) {
          try {
            if (s.charAt(0) == '#')
              c = new Color(Integer.valueOf(s.substring(1), 16).intValue());
            else
              c = new Color(Integer.valueOf(s).intValue());
          catch (NumberFormatException e) { e.printStackTrace(); }
        return c;
    }thanks LIZ
    PS If you can help how do I Give the Duke dollers to you

    http://www.google.ca/search?q=java+oval+shape+to+plot&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N
    Ask the guy who made it for more help

Maybe you are looking for

  • How to center title text and table across two columns

    Hello, I want to be able to center a table and its title across a two column page. The pages where I want to do this contain text in both columns or text in the left column and graphics in the right. On the same pages as the text and graphics, I'd li

  • Windows 10: I can't find a audio driver that will work with my HP Touchsmart 520.

    I am beta-testing Windows 10; It handles many HP Touchsmart operations well; but it can't find a driver for audio. I have tried many download sites; and Windows Update (which apparently does have some problems as well) and have been unsuccessful in a

  • Can i use this Apple id

    Can i use this Apple ID

  • Why java is very secure

    tell the reasons why java is very secure compare than other languages

  • SRM Ehp1 CPPR Functionality

    Dear All, Please let me knwo the advanytages of CPPR in SRM 7.0. Also, if am using CPPR doe this mean am not using plan driven procurement and hence have not to make any changes in the SRM org structure like creation of RFC channels etc,,, pls advise