Color filling problem in fillarc() method of Graphics class

I draw a circle in a panel. The circle space is divided to more than one sectors.The sectors are filled to particular color using fillarc(int x, int y, int start_angle, int end_angle) method of java.awt.Graphics class.
When i fill the color, i faced a problem. That is i have seen the panel background Color in some pixels of thet arc spaces.
How will i fill the particular color in full arc spaces? How will i solve this problem?
Thanks for your advance reply.
Regards
Murali.R

import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class ArcFill extends JPanel {
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        int w = getWidth();
        int h = getHeight();
        double radius = Math.min(w,h)*7/16.0;
        double x = (w - 2*radius)/2;
        double y = (h - 2*radius)/2;
        Ellipse2D.Double circle = new Ellipse2D.Double(x,y,2*radius,2*radius);
        // Fill east sector with Arc2D.
        Rectangle r = circle.getBounds();
        double start = -45.0;
        double extent = 90.0;
        int type = Arc2D.PIE;
        Arc2D.Double arc = new Arc2D.Double(r, start, extent, type);
        g2.setPaint(Color.red);
        g2.fill(arc);
        // Fill south sector.
        arc.setAngleStart(-135.0);
        g2.setPaint(Color.green.darker());
        g2.fill(arc);
        arc.setAngleStart(-225);
        g2.setPaint(Color.blue);
        g2.fill(arc);
        arc.setAngleStart(-315);
        g2.setPaint(Color.orange);
        g2.fill(arc);
        // Draw circle and lines.
        g2.setPaint(Color.black);
        g2.draw(circle);
        double theta = -Math.PI/4;
        double cx = circle.getCenterX();
        double cy = circle.getCenterY();
        for(int j = 0; j < 4; j++) {
            x = cx + radius*Math.cos(theta);
            y = cy + radius*Math.sin(theta);
            g2.draw(new Line2D.Double(cx, cy, x, y));
            theta += Math.PI/2;
    public static void main(String[] args) {
        ArcFill panel = new ArcFill();
        panel.setPreferredSize(new Dimension(400,400));
        JOptionPane.showMessageDialog(null, panel, "", -1);
}

Similar Messages

  • Problem using repaint() method from another class

    I am trying to make tower of hanoi...but unable to transfer rings from a tower to another...i had made three classes....layout21 where all componentents of frame assembled and provided suitable actionlistener.....second is mainPanel which is used to draw the rods n rings in paintComponent.....and third is tower in which code for hanoi is available...i had made an object of mainPanel at layoout21 n tower but i m not able to call repaint from tower..gives an error : cannot find the symbol....method repaint in tower.
    code fragments od three classes are:
    LAYOUT21
    class layout21 extends JFrame implements ActionListener
    { private Vector rod1 = new Vector();
    private Vector rod2 = new Vector();
    private Vector rod3 = new Vector();
    private String elem; //comment
    public String r22;
    public boolean in=false;
    public int count=0; //no of times the transfer to other rods performed
    private int r3,rings; // current no of rings
    private JComboBox nor,col;
    private JLabel no;
    private JLabel moved;
    private JLabel no1;
    private JButton start;
    private JButton ref;
    private AboutDialog dialog;
    private JMenuItem aboutItem;
    private JMenuItem exitItem;
    private tower t;
    final mainPanel2 p =new mainPanel2();
    public layout21()
    { t = new tower();
         Toolkit kit =Toolkit.getDefaultToolkit();
    Image img = kit.getImage("java.gif");
    setIconImage(img);
    setTitle("Tower Of Hanoi");
    setSize(615,615);
    setResizable(false);
    setBackground(Color.CYAN);
         JMenuBar mbar = new JMenuBar();
    setJMenuBar(mbar);
    JMenu fileMenu = new JMenu("File");
    mbar.add(fileMenu);
    aboutItem = new JMenuItem("About");
    aboutItem.addActionListener(this);
    fileMenu.add(aboutItem);
    exitItem = new JMenuItem("Exit");
    exitItem.addActionListener(this);
    fileMenu.add(exitItem);
    Container contentPane =getContentPane();
    JPanel bspanel = new JPanel();
    JPanel bnpanel = new JPanel();
    setBackground(Color.CYAN);
         //JComboBox
    nor = new JComboBox();
    nor.setEditable(false);
    nor.addItem("3");
    nor.addItem("4");
    nor.addItem("5");
    nor.addItem("6");
    nor.addItem("7");
    nor.addItem("8");
    nor.addItem("9");
    bspanel.add(nor);
    col = new JComboBox();
    col.setEditable(false);
    col.addItem("BLACK");
    col.addItem("GREEN");
    col.addItem("CYAN");
    bspanel.add(col);
    JLabel tl = new JLabel("Time");
    tl.setFont(new Font("Serif",Font.BOLD,12));
    bspanel.add(tl);
    JTextField tlag = new JTextField("0",4);
    bspanel.add(tlag);
    start =new JButton("Start");
    bspanel.add(start);
    ref =new JButton("Refresh");
    bspanel.add(ref);
    JButton end =new JButton("End");
    bspanel.add(end);
    start.addActionListener(this);
    nor.addActionListener(this);
    col.addActionListener(this);
    ref.addActionListener(this);
    end.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    dispose(); // Closes the dialog
    contentPane.add(bspanel,BorderLayout.SOUTH);
    JLabel count = new JLabel("No of Transfer reguired:");
    count.setFont(new Font("Serif",Font.BOLD,16));
    bnpanel.add(count);
    no = new JLabel("7");
    no.setFont(new Font("Serif",Font.BOLD,16));
    bnpanel.add(no);
    JLabel moved = new JLabel("Moved:");
    moved.setFont(new Font("Serif",Font.BOLD,16));
    bnpanel.add(moved);
    no1 = new JLabel("0");
    no1.setFont(new Font("Serif",Font.BOLD,16));
    bnpanel.add(no1);
    contentPane.add(bnpanel,BorderLayout.NORTH);
    contentPane.add(p,BorderLayout.CENTER);
         String r = (String)nor.getSelectedItem();
    rings = Integer.valueOf(r).intValue();
    p.draw(rings,1) ;
    public void actionPerformed(ActionEvent evt)
    {  Object source = evt.getSource();
    if(source == start)
    r3 = Integer.valueOf((String)nor.getSelectedItem()).intValue();
    p.transfer(false);
    t.initialise(rod1,rod2,rod3,0);
    t.towerOfHanoi(r3);
         //repaint();
         if(source == ref)
    { rod1.removeAllElements() ;
    rod2.removeAllElements() ;
    rod3.removeAllElements() ;
    count=0;
              r3 = Integer.valueOf((String)nor.getSelectedItem()).intValue();
              p.draw(r3,1);
    p.transfer(true);
    no1.setText(""+0);
    p.trans_vec(rod1,rod2,rod3);
    t.initialise(rod1,rod2,rod3,0);
              System.out.println("");
              repaint();
    if(source == nor)
    { JComboBox j = (JComboBox)source;
    String item = (String)j.getSelectedItem();
    int ring1 = Integer.valueOf(item).intValue();
    int a=1;
    for(int i=1;i<=ring1;i++)
    { a = a*2;
    a=a-1;
    no.setText(""+a);
    p.draw(ring1,1);
    repaint();
    if(source == aboutItem)
    {  if (dialog == null) // first time
    dialog = new AboutDialog(this);
    dialog.setVisible(true);
    if(source == exitItem)
    {  System.exit(0);
         if (source==col)
         { JComboBox j = (JComboBox)source;
    String item = (String)j.getSelectedItem();
              repaint();
    TOWER
    class tower extends Thread
    { private Vector rod1 = new Vector();
    private Vector rod2 = new Vector();
    private Vector rod3 = new Vector();
    private int count ;
    private String elem;
    final mainPanel2 z =new mainPanel2();
    public void initialise(Vector r1,Vector r2,Vector r3,int c)
    { rod1 = r1;
    rod2 = r2;
         rod3 = r3;
         count =c;
    public void towerOfHanoi(int rings)
    for(int i=0;i<rings;i++)
    rod1.add(" "+(i+1));
    System.out.println("rod1:"+rod1.toString());
    hanoi(rings,1,2);
    public void hanoi(int m,int i, int j)
    if(m>0)
    { hanoi(m-1,i,6-i-j);
    if(i==1 && j==2 && rod1.isEmpty()==false)
    { count++;
    //no1.setText(""+count);
    elem = (String)rod1.remove(0);
    rod2.add(0,elem);
         //z.trans_vec(rod1,rod2,rod3);
    repaint(); //NOT ABLE TO USE METHOD HERE...WHY??
    //z.hanoi_paint();
    try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 2:"+rod2.toString());
    if(i==1 && j==3 && rod1.isEmpty()==false)
    { count++;
         //no1.setText(""+count);
         elem = (String)rod1.remove(0);
    rod3.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();//
    // z.hanoi_paint();
                   try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 3:"+rod3.toString());
    if(i==2 && j==1 && rod2.isEmpty()==false)
    { count++;
         //no1.setText(""+count);
         elem = (String)rod2.remove(0);
    rod1.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();
    //z.hanoi_paint();
    try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 1:"+rod1.toString());
    if(i==2 && j==3 && rod2.isEmpty()==false)
    { count++;     
         //no1.setText(""+count);
         elem = (String)rod2.remove(0);
    rod3.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();
    //z.hanoi_paint();
    try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 3:"+rod3.toString());
    if(i==3 && j==1 && rod3.isEmpty()==false)
    { count++;
         //no1.setText(""+count);
    elem = (String)rod3.remove(0);
    rod1.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();
    //z.hanoi_paint();
         try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 1:"+rod1.toString());
    if(i==3 && j==2 && rod3.isEmpty()==false)
    { count++;
         //no1.setText(""+count);
    elem = (String)rod3.remove(0);
    rod2.add(0,elem);
    //z.trans_vec(rod1,rod2,rod3);
    repaint();
    //z.hanoi_paint();
    try
              this.sleep(2000);      
              catch (Exception e) { e.printStackTrace() ;  }
    System.out.println(count+". ROD 2:"+rod2.toString());
    hanoi(m-1,6-i-j,j);
    MAINPANEL
    class mainPanel2 extends JPanel //throws IOException
    public Vector line = new Vector();
    public Vector rod11= new Vector();
    public Vector rod22= new Vector();
    public Vector rod33= new Vector();
    public int no_ring;
    public int rod_no;
    String pixel;
    StringTokenizer st,st1;
    int x,y;
    public boolean initial =true;
    public void paintComponent(Graphics g)
    { System.out.println("repaint test");
    bresenham(100,60,100,360);
         bresenham(101,60,101,360);
    bresenham(102,60,102,360);
    bresenham(103,60,103,360);
    bresenham(104,60,104,360);     
    g.setColor(Color.BLUE);
    while(line.size()>0)
    { pixel = (String)line.remove(0);
    st = new StringTokenizer(pixel);
    x = Integer.valueOf(st.nextToken()).intValue();
    y = Integer.valueOf(st.nextToken()).intValue();
    g.drawLine(x,y,x,y);
    bresenham(300,60,300,360);
    bresenham(301,60,301,360);
    bresenham(302,60,302,360);
    bresenham(303,60,303,360);
    bresenham(304,60,304,360);     
    while(line.size()>0)
    { pixel = (String)line.remove(0);
    st = new StringTokenizer(pixel);
    x = Integer.valueOf(st.nextToken()).intValue();
    y = Integer.valueOf(st.nextToken()).intValue();
    g.drawLine(x,y,x,y);
    bresenham(500,60,500,360);
    bresenham(501,60,501,360);
    bresenham(502,60,502,360);
    bresenham(503,60,503,360);
    bresenham(504,60,504,360);     
    while(line.size()>0)
    { pixel = (String)line.remove(0);
    st = new StringTokenizer(pixel);
    x = Integer.valueOf(st.nextToken()).intValue();
    y = Integer.valueOf(st.nextToken()).intValue();
    g.drawLine(x,y,x,y);
    bresenham(0,361,615,361);//used to get a pixel according to algo.. . func not provided
    bresenham(0,362,615,362);
    bresenham(0,363,615,363);
    bresenham(0,364,615,364);
    bresenham(0,365,615,365);     
    while(line.size()>0)
    { pixel = (String)line.remove(0);
    st = new StringTokenizer(pixel);
    x = Integer.valueOf(st.nextToken()).intValue();
    y = Integer.valueOf(st.nextToken()).intValue();
    g.drawLine(x,y,x,y);
    if(initial==true)
    g.setColor(Color.RED);
    for(int i = no_ring;i>0;i--)
    { g.drawLine(100-(i*8),360-(no_ring - i)*10,100+(i*8)+5,360-(no_ring - i)*10);
    g.drawLine(100-(i*8),359-(no_ring - i)*10,100+(i*8)+5,359-(no_ring - i)*10);
    g.drawLine(100-(i*8),358-(no_ring - i)*10,100+(i*8)+5,358-(no_ring - i)*10);
    g.drawLine(100-(i*8),357-(no_ring - i)*10,100+(i*8)+5,357-(no_ring - i)*10);
    g.drawLine(100-(i*8),356-(no_ring - i)*10,100+(i*8)+5,356-(no_ring - i)*10);
    // draw for each rod
    //System.out.println("rod11:"+rod11);
    //System.out.println("rod22:"+rod22);
    //System.out.println("rod33:"+rod33);
         int r1 = rod11.size();
         int r2 = rod22.size();
         int r3 = rod33.size();
    String rd1,rd2,rd3;
    int r11,r12,r21,r22,r31,r32;
    if(initial == false)
         { g.setColor(Color.RED);
         while(rod11.size()>0)
    { r12 = rod11.size()-1;
              rd1 = (String)rod11.remove(r12);
    r11 = Integer.valueOf(rd1).intValue();
    g.drawLine(100-((r11+1)*8),360-(r1 - (r11+1))*10,100+((r11+1)*8)+5,360-(r1 - (r11+1))*10);
    g.drawLine(100-((r11+1)*8),359-(r1 - (r11+1))*10,100+((r11+1)*8)+5,359-(r1 - (r11+1))*10);
              g.drawLine(100-((r11+1)*8),358-(r1 - (r11+1))*10,100+((r11+1)*8)+5,358-(r1 - (r11+1))*10);
              g.drawLine(100-((r11+1)*8),357-(r1 - (r11+1))*10,100+((r11+1)*8)+5,357-(r1 - (r11+1))*10);
              g.drawLine(100-((r11+1)*8),356-(r1 - (r11+1))*10,100+((r11+1)*8)+5,356-(r1 - (r11+1))*10);
         while(rod22.size()>0)
    { g.setColor(Color.RED);
              r22 = rod22.size()-1;
         System.out.println("TEST *************************:"+r22);
              try
         // e.printStackTrace();      
              InputStreamReader isr = new InputStreamReader(System.in);
         BufferedReader br = new BufferedReader(isr)      ;
         br.readLine() ;
         }catch(Exception f) {}
              rd2 = ((String)rod22.remove(r22)).trim();
    r21 = Integer.valueOf(rd2).intValue();
    g.drawLine(300-((r22+1)*8),360-(r2 - (r22+1))*10,300+((r22+1)*8)+5,360-(r2 - (r22+1))*10);
    g.drawLine(300-((r22+1)*8),359-(r2 - (r22+1))*10,300+((r22+1)*8)+5,359-(r2 - (r22+1))*10);
              g.drawLine(300-((r22+1)*8),358-(r2 - (r22+1))*10,300+((r22+1)*8)+5,358-(r2 - (r22+1))*10);
              g.drawLine(300-((r22+1)*8),357-(r2 - (r22+1))*10,300+((r22+1)*8)+5,357-(r2 - (r22+1))*10);
              g.drawLine(300-((r22+1)*8),356-(r2 - (r22+1))*10,300+((r22+1)*8)+5,356-(r2 - (r22+1))*10);
         while(rod33.size()>0)
    { g.setColor(Color.RED);
              r32 = rod33.size()-1;
              rd3 = (String)rod33.remove(r32);
    r31 = Integer.valueOf(rd3).intValue();
    g.drawLine(500-((r32+1)*8),360-(r3 - (r32+1))*10,500+((r32+1)*8)+5,360-(r3 - (r32+1))*10);
    g.drawLine(500-((r32+1)*8),359-(r3 - (r32+1))*10,500+((r32+1)*8)+5,359-(r3 - (r32+1))*10);
              g.drawLine(500-((r32+1)*8),358-(r3 - (r32+1))*10,500+((r32+1)*8)+5,358-(r3 - (r32+1))*10);
              g.drawLine(500-((r32+1)*8),357-(r3 - (r32+1))*10,500+((r32+1)*8)+5,357-(r3 - (r32+1))*10);
              g.drawLine(500-((r32+1)*8),356-(r3 - (r32+1))*10,500+((r32+1)*8)+5,356-(r3 - (r32+1))*10);
    why i m not able to use repaint() method in tower class? from where i can use repaint() method

    i can't read your code - not formatted with code tags
    I have no chance of getting it to compile (AboutDialog class?? p.draw() ??)
    here's a basic routine - add a couple of things to this to demonstrate what is not
    being redrawn
    (compare the readability of below code (using tags) to yours)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Testing extends JFrame
      public Testing()
        setSize(400,300);
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        final DrawPanel dp = new DrawPanel();
        JButton btn = new JButton("Change Text Location/Repaint");
        getContentPane().add(dp,BorderLayout.CENTER);
        getContentPane().add(btn,BorderLayout.SOUTH);
        btn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            dp.x = (int)(Math.random()*300);
            dp.y = (int)(Math.random()*150)+50;
            repaint();}});
      public static void main(String[] args){new Testing().setVisible(true);}
    class DrawPanel extends JPanel
      int x = 50, y = 50;
      public void paintComponent(Graphics g)
        super.paintComponent(g);
        g.drawString("Hello World",x,y);
    }

  • Problems calling a method in another class

    I have the following method in a class called recordCalls -
    public static void objectCreated(String type, String name)
            System.out.println("An object of type " + type + " called " + name + " has been created.");
    //       addObjectToPanel(type, name);  
        }I am attempting to call addObjectToPanel(type, name) which is a method inside a class called test.
    I do not want to create an instance of test an call it like test.addObjectToPanel(type, name)
    Is there any other way of doing this.
    Thanks.

    You either have to make the method static, and call
    test.addObjectToPanel or you have to create an
    instance of test and invoke the method on that
    instance.
    I don't know what that class is supposed to do, so I
    don't know which is more appropriate.
    You should name your classes starting with capital
    letters, and Test is a very undescriptive (and hence
    bad) name for that class.I will be chaning the names of everything when the class works.
    Test contains the UI for my program.
    When I run test then my UI is runing, once I run addObjectToPanel from the record calls class it should put images into my UI,
    the problem is that each time the method is run it open up a different UI and adds an image to it instead of just adding the images to the window which is already open.

  • Problem with getState() method in Thread class

    Can anyone find out the problem with the given getState() method:
    System.out.println("The state of Thread 1: "+aThread.getState());
    The Error message is as follows:
    threadDemo.java:42: cannot resolve symbol
    symbol : method getState ()
    location: class incrementThread
    System.out.println("The state of Thread 1: "+aThread.getState())
    ^
    1 error

    the api doc shows Since: 1.5
    You do use Java 5...if not... it's not available.

  • Paint bucket and Pencil color fill problem

    Hi,
    I'm coloring a comic book and I'm having an annoying bug with CS4.
    Say I want to color these bushes:
    I put the color on another layer set to Multiply. Using the Pencil tool (no anti-aliasing), I close all the gaps.
    Then fill it with the Paint bucket (anti-aliasing off, contiguous, sample all layers) using the same color.
    Now say I later decide to change that color; naturally I'll use the Paint bucket.
    This is what happens:
    As you can see the pencil strokes are still there, as if they were a different color, even if they're not!
    But on closer inspection, it turns out the CMYK values are off by 1%. I have no idea why this happens. The tools are all set at the exact same color and opacity.
    Someone posted a thread 9 months ago about this problem but it wasn't solved: http://forums.adobe.com/thread/781035
    He says it also occurs on CS5.
    I can only assume it's a bug. Help?

    I just tried with the pencil set to Multiply, and it happened. And contradicting what I said earlier, the problem happened with Normal as well.
    Well, here's another update: the real culprit seems to be the paint bucket tool. I experimented with color samplers to precisely measure the CMYK values. This is completely bizarre:
    The paint bucket will occasionnally fill with a color that is off by 1% from the intended color. It seems to happen randomly, but more often with darker colors.
    Check this out:
    Sampler 1 is where I closed the gap with the pencil. Sampler 2 is the paint bucket fill.

  • Problem with skip() method of Scanner class

    public static void main(String args[]){
    try{
    String regEx = "had";
    String parseString = "Smith, wherer Jones had had \'had \'";
    //System.out.println(parseString);
    Pattern pat=Pattern.compile(regEx);
    Matcher matcher = pat.matcher(regEx);
    Scanner scan=new Scanner(parseString);
    if(matcher.find()){
    System.out.println("Pattern found!");
    scan.skip(pat);
    System.out.println("Pattern");
    System.out.println(parseString);
    catch(NoSuchElementException e){}
    After this line program is not working,
    scan.skip(pat);
    suggest me in using the skip() method.
    Please suggest me on this,its very urgent.
    Thanks,
    Valaboju.
    Edited by: praveenmca09 on Mar 13, 2008 5:51 AM

    Not Working means what. Are u getting some error or u r not getting proper output.
    very little info.
    i think the problem is with
    scan.skip(pat);
    it returns Scanner object
    And ur not handling it

  • Re: problem calling a method from another class

    This line here:
    app.computeDiscount(ord,tentativeBill);... You are not capturing the returned amount.
    double d = app.computeDiscount(ord,tentativeBill);

    what kind of problem r u facing?
    plz highlight the code where u r facing the problem

  • The fillArc method (question about)

    Hi all,
    I'm studying basics of awt Graphics. Now i'm trying to use the fillArc method, but I found something that make me a question...
    So, I'm trying to draw a arc sucession, but I don't understand some parameters that are different of the rect delimiter. I used the drawArc method also to see the diferences.
    Here is part of the code (please see the comments in loop for):
    public class DesenhaArco extends JPanel{
    final Color VIOLETA = new Color(128, 0, 128);
    final Color AZULMARINHO = new Color(75, 0, 130);
    private Color colors[] = {Color.WHITE, Color.WHITE, VIOLETA, AZULMARINHO, Color.BLUE,
    Color.GREEN, Color.YELLOW, Color.ORANGE, Color.RED};
    public DesenhaArco(){
    setBackground(Color.WHITE);
    public void paintComponent(Graphics g){
    super.paintComponent(g);
    //obtain the width center
    int centerX = getWidth() / 2;
    int arcEspessure;
    //calculate the arcs espessure based in panel metrics
    if (getHeight() > getWidth()){
    arcEspessure = getWidth() / (colors.length * 2);
    else {
    arcEspessure = getHeight() / colors.length;
    if (arcEspessure * colors.length * 2 > getWidth()){
    arcEspessure = getWidth() / (colors.length * 2);
    for (int contArco = colors.length; contArco > 0; contArco--){
    g.setColor(Color.BLACK);
    //draw a rect delimiter with black borders to test
    g.drawRect(centerX - arcEspessure * contArco, getHeight() - arcEspessure * contArco,
    arcEspessure * contArco * 2, arcEspessure * contArco);
    g.setColor(colors[contArco - 1]);
    //here is the problem (above, in fillArc)
    //the x, y, width and height parameters is equals the parameters of drawRect method,
    //but results in arcs with only part of the height inserted in height argument
    //if I multiplicate the height argument (4th parameter) for 2
    //(arcEspessure * contArco * 2) I obtain the correct results
    //but I think this is'nt a correct mode...
    g.fillArc(centerX - arcEspessure * contArco, getHeight() - arcEspessure * contArco,
    arcEspessure * contArco * 2, arcEspessure * contArco, 0, 180);
    }Sorry for my wrong english.
    Thanks. :-)

    "The center of the arc is the center of the rectangle whose origin is (x, y) and whose size is specified by the width and height arguments." (JSE 6 API Specification)
    I think I have understanded... The Y start point of an arc begins in center of height metric.
    So I changed the arguments of fillArc method, specificatly the 2th and 4th parameters, making an rectangle delimiter with double of the metrics that I need and starting out of the panel delimiters (1/2 out panel):
    g.fillArc(centerX - espessuraArco * contArco, -contArco * espessuraArco,
    espessuraArco * contArco * 2, espessuraArco * contArco * 2, 0, -180);Thanks for all. :-)

  • Problems with invokeing method

    Hey,
    I'm trying to create an splash screen before my app starts but i have alot of troubles with this. Here is my code:
    package classes;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import clientmanager.Delta;
    * A Splash window.
    *  <p>
    * Usage: MyApplication is your application class. Create a Splasher class which
    * opens the splash window, invokes the main method of your Application class,
    * and disposes the splash window afterwards.
    * Please note that we want to keep the Splasher class and the SplashWindow class
    * as small as possible. The less code and the less classes must be loaded into
    * the JVM to open the splash screen, the faster it will appear.
    * <pre>
    * class Splasher {
    *    public static void main(String[] args) {
    *         SplashWindow.splash(Startup.class.getResource("splash.gif"));
    *         MyApplication.main(args);
    *         SplashWindow.disposeSplash();
    * </pre>
    * @author Werner Randelshofer
    * @version 2.2.1 2006-05-27 Abort when splash image can not be loaded.
    public class SplashWindow extends Window {
         * The current instance of the splash window.
         * (Singleton design pattern).
        private static SplashWindow instance;
         * The splash image which is displayed on the splash window.
        private Image image;
         * This attribute indicates whether the method
         * paint(Graphics) has been called at least once since the
         * construction of this window.<br>
         * This attribute is used to notify method splash(Image)
         * that the window has been drawn at least once
         * by the AWT event dispatcher thread.<br>
         * This attribute acts like a latch. Once set to true,
         * it will never be changed back to false again.
         * @see #paint
         * @see #splash
        private boolean paintCalled = false;
         * Creates a new instance.
         * @param parent the parent of the window.
         * @param image the splash image.
        private SplashWindow(Frame parent, Image image) {
            super(parent);
            this.image = image;
            // Load the image
            MediaTracker mt = new MediaTracker(this);
            mt.addImage(image,0);
            try {
                mt.waitForID(0);
            } catch(InterruptedException ie){}
            // Abort on failure
            if (mt.isErrorID(0)) {
                setSize(0,0);
                System.err.println("Warning: SplashWindow couldn't load splash image.");
                synchronized(this) {
                    paintCalled = true;
                    notifyAll();
                return;
            // Center the window on the screen
            int imgWidth = image.getWidth(this);
            int imgHeight = image.getHeight(this);
            setSize(imgWidth, imgHeight);
            Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
            setLocation(
            (screenDim.width - imgWidth) / 2,
            (screenDim.height - imgHeight) / 2
            // Users shall be able to close the splash window by
            // clicking on its display area. This mouse listener
            // listens for mouse clicks and disposes the splash window.
            MouseAdapter disposeOnClick = new MouseAdapter() {
                public void mouseClicked(MouseEvent evt) {
                    // Note: To avoid that method splash hangs, we
                    // must set paintCalled to true and call notifyAll.
                    // This is necessary because the mouse click may
                    // occur before the contents of the window
                    // has been painted.
                    synchronized(SplashWindow.this) {
                        SplashWindow.this.paintCalled = true;
                        SplashWindow.this.notifyAll();
                    dispose();
            addMouseListener(disposeOnClick);
         * Updates the display area of the window.
        public void update(Graphics g) {
            // Note: Since the paint method is going to draw an
            // image that covers the complete area of the component we
            // do not fill the component with its background color
            // here. This avoids flickering.
            paint(g);
         * Paints the image on the window.
        public void paint(Graphics g) {
            g.drawImage(image, 0, 0, this);
            // Notify method splash that the window
            // has been painted.
            // Note: To improve performance we do not enter
            // the synchronized block unless we have to.
            if (! paintCalled) {
                paintCalled = true;
                synchronized (this) { notifyAll(); }
         * Open's a splash window using the specified image.
         * @param image The splash image.
        public static void splash(Image image) {
            if (instance == null && image != null) {
                Frame f = new Frame();
                // Create the splash image
                instance = new SplashWindow(f, image);
                instance.setVisible(true);
                // Note: To make sure the user gets a chance to see the
                // splash window we wait until its paint method has been
                // called at least once by the AWT event dispatcher thread.
                // If more than one processor is available, we don't wait,
                // and maximize CPU throughput instead.
                if (! EventQueue.isDispatchThread()
                && Runtime.getRuntime().availableProcessors() == 1) {
                    synchronized (instance) {
                        while (! instance.paintCalled) {
                            try { instance.wait(); } catch (InterruptedException e) {}
         * Open's a splash window using the specified image.
         * @param imageURL The url of the splash image.
        public static void splash(URL imageURL) {
            if (imageURL != null) {
                splash(Toolkit.getDefaultToolkit().createImage(imageURL));
         * Closes the splash window.
        public static void disposeSplash() {
            if (instance != null) {
                instance.getOwner().dispose();
                instance = null;
         * Invokes the main method of the provided class name.
         * @param args the command line arguments
        public static void invokeMain(String className, String[] args) {
            try {
                //Class.forName(className).getMethod("main", new Class[] {String[].class}).invoke(null, new Object[] {args});
            } catch (Exception e) {
                InternalError error = new InternalError("Failed to invoke main method");
                error.initCause(e);
                throw error;
    }But when i run my application i get this:
    Exception in thread "main" java.lang.InternalError: Failed to invoke main method
            at classes.SplashWindow.invokeMain(SplashWindow.java:199)
            at clientmanager.Main.main(Main.java:14)
    Caused by: java.lang.ClassNotFoundException: Delta
            at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:169)
            at classes.SplashWindow.invokeMain(SplashWindow.java:197)
            ... 1 moreAnd i don't know why i get that error. Can anybody help me?
    Thanks alot!
    Sincerely,
    NightFox

    this i have created in java 2d
    the code: -
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    public class Draw2 extends Frame
         Shape s[] = new Shape[5];
         public static void main(String args[])
              Draw2 app = new Draw2();
         public Draw2()
              super("Draw2");
              add("Center", new MyCanvas());
              setSize(600, 400);
              show();
         class MyCanvas extends Canvas
              public void paint(Graphics graphics)
                   Graphics2D g = (Graphics2D) graphics;
                   for (int i=0; i<=5; i++)
                        g.draw(new Ellipse2D.Double(20+(60*i), 50.0, 50, 50));
                   for (int i=0; i<=5; i++)
                        g.draw(new Ellipse2D.Double(20+(50*i), 100.0, 50, 50));
                   for (int i=0; i<=5; i++)
                        g.draw(new Ellipse2D.Double(20+(40*i), 150.0, 50, 50));
                   for (int i=0; i<=5; i++)
                        g.draw(new Ellipse2D.Double(20+(30*i), 200.0, 50, 50));
                   for (int i=0; i<=5; i++)
                        g.draw(new Ellipse2D.Double(20+(20*i), 250.0, 50, 50));
    }hope this helps
    thanks
    Pradyut
    http://pradyut.tk

  • How do I auto set stroke weight, stroke colors & fill color?

    Hi,
    I'd like to make it easier for our 100,000 designers to use AI to make custom products using a laser cutter.
    Current Practice
    Designers open our AI laser cutting design templates, add their designs using the AI settings our online pricing system can read, then upload their designs to our website for instant pricing, making and shipping.
    The Problem
    Designers have to manually setup AI with settings that can be read by our online pricing system. If they get these settings wrong, our system can not read their designs. So they are rejected and can not be priced or made. This happens more often that you'd imagine.
    The Solution
    Designers do not like design rejections. So I'd like to eradicate them by providing our designers with a version of AI that provides the following settings only:
    * Set document to RGB
    * Stroke weight = 0.01mm
    * Stroke colors = RGB 0, 0, 255 and 255, 0, 0
    * Fill color = RGB 0, 0, 0
    This will mean designers have a very limited number of AI choices, with nothing to distract them or to get wrong. Which will result in less (or zero?) design rejections. And products made faster than before. Rejoice!
    Question
    How do we program our AI laser cutting design templates so that when they are opened in AI, they auto set AI settings as defined above?
    Thanks so much.
    Derek

    Ponoko wrote:
    Your first point - yes, that's what our system does currently. As a result designers get lots of 'how to fix' messages as a result of design rejections. We wish to reduce these rejections and resulting 'how to fix' messages by limiting their choices in AI - because this is where the problems are created.
    Ok, yeah gotcha, so customers/designers think they do it right (cough/laugh) upload, then get surprised to find out they didn't by your upload system. That's kind of what I thought. I feel your pain. ;-) I sense you want to reduce this aspect to keep the customers/designers happy and thinking they do nothing but work magic all day right? ;-) So you don't want to lose customers in the midst of frustration of file rejection thinking there files are right and your system is certainly wrong, when in fact it's the opposite. Good luck explaining that to a designer however, right? ;-)
    Ponoko wrote:
    Your second point - You go on to talk about using a complex "action" we could distribute within the design templates. Although I suspect this is different, the path we're thinking is to include something in the templates that, when imported into AI, sets AI with the color palette we need, line weight we need. Possible?
    As Monika hinted at you can't rigidly restrict or control what a user is allowed to do and use in Illustrator. You can try to reduce the parameters by saving the file as a Template.ait file, but even then they can muck about all day until they mess things up again, plus you have no control whatsoever even then as to whether they use fills, the stroke weights, etc. That is why I mentioned various things to manipulate the file once they deem it completed and ready to submit/upload. Basically a method to fix what they messed up or did incorrectly and instead set things as they should be for submission as I previously mentioned. I mentioned you may be able to create a complex Illustrator "action" action.aia that they run to process these requirements. I am not sure if such an action could be accomplished as all inclusive (perhaps though) otherwise you could as stated do it through scripting and a script they run: script.jsx to prepare the requirements, or an actual standalone helper app you create and provide like I mentioned above as well.
    I see for CorelDRAW & Inkscape you require SVG, why not change that for Illustrator also so all your 2D app submissions are SVG based? Then manipulate the SVG server side, point out the changes and why and have the customer approve the new modified SVG Preview of the needed changes and move along with the process from there? Make all the requirement changes on the server by manipulating the SVG. You should have access to all of the requirements: RGB color model, stroke weight, stroke colors, fill colors, create font outlines, image tracing? I am just tossing out ideas here, get your programmers busy, tell them to stop playing video games and "make it so". ;-)
    But even so, this then begs the question: What are you doing to circumvent the same issues for inept CorelDraw and Inkscape users?
    Since, they have the same freedom to do things incorrectly and misaligned with the requirements, just as Illustrator users do.
    Regardless though of the approach customers/designers may not like seeing certain things changed even minutely in trivial amounts and thusly be just as upset or up in arms with the changes to their pretty design files that they think were not needed in the first place, how dare you undermine them ;-). Same as seeing the file rejection from your system upon upload. Again I feel your pain. You have your Application/File requirements requirements stated nicely and plainly, it should be pretty easy for most, but sadly I guess not.

  • I gt problem in createImage method, Please Help Me!

    This part of code is from Ticker.Class:
    public void createParams()
         {//tickerTape.x = 900;
              //tickerTape.y = 40;
              int width = getSize().width;
              //System.out.println("getSize().width "+getSize().width);
              int height = getSize().height;
              lastS.width = width;
              lastS.height = height;
              System.out.println("width"+width);
              //System.out.println("width: " + width + " height: " + height);
              tickerTape.createParamsgr();
              Font font = tickerTape.getDefaultFont();
              this.setFont(font);
              FontMetrics metrics = getFontMetrics(font);
              metrics = getFontMetrics(font);
              int k = getFontMetrics(font).getHeight();
              //tickerTape.cParams();
              //tickerTape.createParams1(lastS);
              //setSize(tickerTape.cParamsHeight(),tickerTape.cParamsWidth());
         //     messageY = tickerTape.cParamsY();
              messageX = width;
              messageY = (height - k >> 1) + metrics.getAscent();
                   image = createImage(getSize().width,getSize().height);
                   tickerTape.initImage(image);
                   //gr=image.getGraphics();
         public  void paint(Graphics g)
          update(g);
         public synchronized void update(Graphics g)
              //gr.clearRect(0, 0, d.getSize().width, d.getSize().height);
              //gr.setColor(bgCo);
              //gr.drawRect(0, 0, d.getSize().width - 1, d.getSize().height - 1);
              //gr.fillRect(0, 0, d.getSize().width, d.getSize().height);
              //g.drawImage(image, 0, 0, this);
              if (Ticker.LOADING_DATA) {
                   System.out.println("Refreshing data. Please wait....");
                   return;
              try {
                   if(image==null)
                   image = createImage(getSize().width, getSize().height);
                   tickerTape.initImage(image);
                   //if (tickerTape.cParamsHeight() != lastS.height|| tickerTape.cParamsWidth() != lastS.width)
                   if (getSize().height != lastS.height|| getSize().width != lastS.width)
                   createParams();
                   if (tickerTape.getDisplayItems().size() > 0) {
                        //System.out.print("lastS.width: " + lastS.width + " lastS.height: " + lastS.height + "\n");
                        tickerTape.setBackground(lastS,bgCo,messageX,messageY);
                        if (display_URL) {
                             int k = mouseX;
                              //System.out.println("k=" + k + " messageX=" + messageX);
                             if (k > messageX) {
                                  //System.out.println("(k > messageX) is true!!");
                                  //System.out.println("messageCount----> " + messageCount);
                                  messageCount = tickerTape.displayItemsCnt;
                                  k -= messageX;
                                  switch (this.mouseEvent) {
                                  case TickerTape.SCROLL_LEFT:
                                       break;
                                  case TickerTape.SCROLL_RIGHT:
                                       // for (int i1 = 0; i1 <= messageCount - 1; i1++)
                                       // i += ((Integer) msgsW.elementAt(i1)).intValue();
                                       // if (k >= i)
                                       // continue;
                                       // messageIndex = i1;
                                       // break;
                                       // break;
                                  if (this.mouseEvent == MOUSE_CLICK) {
                                       // showStatus((String)
                                       // msgsURL.elementAt(messageIndex));
                        //Font itemFont = null;
                        //FontMetrics fontMetrics = null;
                        //Color textColor = null;
                        //Vector msgs = tickerTape.getDisplayItems();
                                  switch (tickerTape.getScrollDirection()) {
                                  case TickerTape.SCROLL_LEFT:
                                       tickerTape.moveLeft(messageX,messageY);
                                       g.drawImage(image, 0, 0, this);
                                       break;
                                  case TickerTape.SCROLL_RIGHT:
                                       tickerTape.moveRight(messageX,messageY,ItemToDisplay);
                                       g.drawImage(image, 0, 0, this);
                                       break;
                                  case TickerTape.SCROLL_UP:
                                  case TickerTape.SCROLL_DOWN:
                                       tickerTape.moveDown(messageX,messageY);
                                       g.drawImage(image, 0, 0, this);
                                       //g.drawImage(image, 0, 0, this);
                                       break;
                   }     else {
                             image = createImage(getSize().width, getSize().height);
                             tickerTape.initImage(image);
                             //gr=image.getGraphics();
                             tickerTape.setBackground(lastS,bgCo,messageX,messageY);
                             g.drawImage(image, 0, 0, this);
              } catch (Exception e) {
                   e.printStackTrace();
         }This part of code from TickerTape.Class:
    public void createParamsgr(){
              if (gr != null)
                   gr.finalize();
              if (image != null)
                   image = null;
         public void initImage(Image image){
              gr = image.getGraphics();
         }This code already runable. But my question is Why when I decide to move the createImage method into the method of initImage in TickerTape.class, then it come out the error with nullpointer, why like that? is it im make any wrong thing? Or any solution for me to make it correct. Thanks and appreciate!

    hi, thanks for your reply.
    let me briefly explain to you,
    now, you try to look at the createParams() method and update(Graphics g) method int Ticker.class, inside there also got
    image = createImage(getSize().width, getSize().height);
    tickerTape.initImage(image);
    So, now I want to move the code:
    image = createImage(getSize().width, getSize().height);
    into the TickerTape.class but dont Why come out the error with:
    java.lang.NullPointerException
         at TickerTape.initImage(TickerTape.java:90)
         at Ticker.update(Ticker.java:503)
         at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
         at sun.awt.RepaintArea.paint(RepaintArea.java:216)
         at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
         at java.awt.Component.dispatchEventImpl(Component.java:4031)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    but it doesnt work!
    Is it I put wrong thing or I forgot to put any important code?

  • Problem with traverse method

    Hi, I am having this problem:
    I made a CustomItem, a TextField, now I overloaded the traverse method, so if the keycode is Canvas.UP or Canvas.DOWN then return false else return true.
    The problem is that when I press the left or rigth button it also returns false and not true.
    and there is another problem with traverse, before returning false or true I set a boolean and call to repaint to draw it on some way if its selected or not, the paint method is being called but it just dont draw as desired.
    protected void paint(Graphics g, int ancho, int alto) {
              System.out.println ("Dentro del paint, seleccionado="+seleccionado);
              try {
                   g.drawString(label, 0, 0, Graphics.TOP|Graphics.LEFT);
                   if (!seleccionado) {
                        g.setColor(120, 120, 120);
                   g.drawRect(0, 4, tama�oTexto+8, 25);
                   if (seleccionado) {
                        g.setColor(255, 255, 255);
                        g.fillRect(1, 5, (tama�oTexto+8-1), 23);
                   g.setColor(0, 0, 0);
                   if (!seleccionado) {
                        g.setColor(80, 80, 80);
                   g.drawString(texto, 4, 7, Graphics.TOP|Graphics.LEFT);
                   if (seleccionado) {
                        int cursorX=Font.getDefaultFont().charsWidth((texto.substring(0, idLetraActual)).toCharArray(), 0, texto.substring(0, idLetraActual).length())+4;
                        g.drawChar('|', cursorX, 7, Graphics.TOP|Graphics.LEFT);
              } catch (Exception E){
                   E.printStackTrace();
         }the traverse method set the seleccionado variable and calls to repaint but instead of being false the paint method is drawing it as true (most of times).

    I have a problem with findByxxx() method.. in
    Container managed bean.
    i have
    Collection collection =
    home.findByOwnerName("fieldValue");
    specified in my Client Program, where ownerName is the
    cmp fieldname..
    and
    public Collection findByOwnerName(String ownerName)
    throws RemoteException, FinderException
    defined in my home interface.
    i have not mentioned the findBy() method anywhere else
    (Bean class). You have to describe the query in the deployment descriptor.
    >
    Even if i have a same "fieldValue" in the database
    (Oracle), which i specified in findBy() method, iam a
    result of owner Not found, which is not the case as i
    have that owner name.
    for the same application if i use findByPrimaryKey(),
    it is working..
    Can any one please post me the solution.

  • Pen tool Drawing & Bucket Filling Problem

    Hello, i am a newbie and novoice/new learner to flash CS4
    I come across a problem when i follow the book "classroom in a book series" the Flash CS4 one (Red cover book) Chapter 2
    Q.1
    I try to draw straight lines or curves but i found i still cannot manage how to use PEN TOOL
    How can i draw straight line? Also how can i draw absolute vertical or horizontal line with some special combination key like CTRL or SHIFT
    i tried guessing SHIFT or CTRL while using PEN TOOL but no help
    How can i draw curve?
    i know it depends somehow on whether i hold my click for a new anchor point???
    Any tutorial which is clear and easy for new comer for fully understanding for PEN TOOL.(Currently i try reading pdf reference from ADOBE Web site and google search but did not make myself understand.)
    Q.2
    I cannot use bucket filling a shape draw by PEN TOOL(i already search google sites but cannot find one with satisfied causes for this FILLING Problems)
    like the image shown below(Please click to enlarge this PRINTSCREEN)
    Tools i used are PEN TOOL drawing a shape first then a BUCKET for filling color.
    Many thanks to any of your help!!!!!

    Reply to 2nd floor post
    Thank You for your answer and your appreciation.
    but.....i am so sorry to have a further question NOW!
    i follow your link and learn some technique which is supposed to work well:
    http://www.recipester.org/Recipe:Fill_a_flash_shape_with_gap_33956508
    However,i go there and did a experiment MYSELF.
    first i draw an oval with black color stroke and no color for its fill.
    then i use an eraser tool to make that little gap!
    Q.3 (A NEW QUESTION)
    however i cannot fill the oval with even very SMALL GAP like this jpeg shown below:(PLEASE click below to ENLARGE it)
    I then find i cannot use bucket fill AGAIN...
    For the first question, i try to use the pen tool for 6 hours practicing....and reading the official manual i find there are multiple modes of pen tool
    so COMPLEX!! which is not mentioned in my red cover book from Adobe Press.(the book i mentioned in 1st post maybe have some more explaination later?)
    I generally can click or drag to make some straight or curve now like 3rd floor reply.(Subselection tool is helpful when adjusting the curve or line)
    AGAIN Thank You so much!!!!!

  • Compound path and live fill problem

    Hello experts
    I really hope you can help me out with this one. I'm all new to Illustrator and have tried to find the answer to my question but without luck, so you are my last way out
    I'm currently working on a logo of a football which I have drawn with the line segment tool. A football is made of pentagons and hexagons, and I want all the pentagons to have a color fill. For that I have used the live paint bucket. But if I apply an effect such as a gradient it is applied to each segment as many seperates. I then read that you could use compound path and that works with my lines but not with the live fill. Is there a work around for my problem or do you have any smart suggestions of what I could do ?
    Thanks for your help in advance
    Kind regards
    Christopher

    A few questions:
    What AI version?
    By "Live Fill" are you refering to "Live Paint"?
    CS 6 lets you fill a stroke with a gradient. That may be what you used here.
    Congratulations learning about "compound paths" on you own. That's a step in the right direction.
    You can control a gradient fill across multiple objects by using the "Gradient Annotator" (under "View" or "G"). This allows you to set a gradient start and end point by dragging across your selected artwork. You can also edit the gradient sliders directly on the annotator.
    If you ARE using "Live Paint", you can use the "Live Paint Selection Tool" (hidden under the Live Paint Bucket tool, or "Shift-L"), to select multiple Live Paint segments, then drag the annotator across all segments. The annotator is hidden when used with Live Paint (at least in AICS5).
    I hope these tips are helpful.
    Ray

  • Color fill won't stay within shape boundaries

    When anyone looks at my site in Internet Explorer, the color boxes (shapes with color fill) spill over the shape boundaries above and below and everywhere. I thought this would be solved when I switched to web safe fonts. It isn't. How do I keep the colors within the shapes?
    Thank you.

    Another way to make image files of the shapes or group of shapes is to:
    1 - create them on a blank page like AllAboutiWeb suggested.
    2 - select them all and do a Copy.
    3 - open Preview and select File->New From Clipboard menu option.
    4 - in the new window with the objects do a Command+A and then a Command+C (select all and then copy).
    5 - go back to iWeb and do a paste it the page you want the objects. This will create a image of the objects that IE can view. It's about the only way to get color gradients to be viewed outside of Safari.
    Wyodor posted this method in another post. Works very well.
    OT

Maybe you are looking for