Problem in paint() method

i have defined a new class which extends JPanel. In that I have defined a paintComponent() method. i dont know how to use the repaint() method.
can anyone help?

i have defined a new class which extends JPanel. In
that I have defined a paintComponent() method. i dont
know how to use the repaint() method.I do not fully understand your problem, sorry. Could you please clarify a bit?
The repaint()-method is there to draw an image to the screen once again, to make changes visible. As far as I know, it calls the update()- and paint()-methods whenever you call it.

Similar Messages

  • Serious problems with paint method, need major help

    I've got a mjor problem with displaying a BufferedImage Object. My program takes in an image, i call a method on it which creates an ImageObject, imgObj, which contains the following values:
    Image width, called width
    Image height, called height,
    array of 8 bit integers for the ARGB value of each pixel, called int [] imgCol
    I've managed to create a Buffered Image of the form:
    //make a buffered image ready to take the array of pixels
    bufferedImage = new BufferedImage( imgObj.width, imgObj.height, BufferedImage.TYPE_INT_ARGB);
    Then I set the ARGB values in the BufferedImage, by specifying the integer array of pixels, imgCol:
    //set the values in the buffered image using buffered image method
    bufferedImage.setRGB( 0, 0, imgObj.width, imgObj.height, imgObj.imgCol, 0, imgObj.width);
    Then I try to paint it, callling repaint() in the same method as the code above.
    Now when I try the following stuff I get a Null Pointer Exception:
    public void paint(Graphics g){
         paintImage(g);
    public void paintImage(Graphics g){
         Graphics2D ImageGraphic2 = (Graphics2D)g;
         // Draws the buffered image to the screen.
         ImageGraphic2.drawImage(bufferedImage, 0, 0, this);
    Can anyone help me in fixing this problem?

    Here's the full stack trace, can't make heads or tails of what it's about though
    Full thread dump Java HotSpot(TM) Client VM (1.4.1_01-b01 mixed mode):
    "AWT-EventQueue-0" prio=7 tid=0x0ADAB440 nid=0xb38 in Object.wait() [ef5f000..e
    5fd8c]
    at java.lang.Object.wait(Native Method)
    - waiting on <02F78010> (a java.awt.EventQueue)
    at java.lang.Object.wait(Object.java:426)
    at java.awt.EventQueue.getNextEvent(EventQueue.java:333)
    - locked <02F78010> (a java.awt.EventQueue)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchT
    read.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThr
    ad.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    "DestroyJavaVM" prio=5 tid=0x00034DB8 nid=0x5dc waiting on condition [0..7fadc]
    "Java2D Disposer" daemon prio=10 tid=0x0AD4D1F0 nid=0x218 in Object.wait() [ef9
    000..ef9fd8c]
    at java.lang.Object.wait(Native Method)
    - waiting on <02FE9938> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
    - locked <02FE9938> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
    at sun.java2d.Disposer.run(Disposer.java:97)
    at java.lang.Thread.run(Thread.java:536)
    "AWT-Windows" daemon prio=7 tid=0x0ACB1528 nid=0x63c runnable [aeff000..aeffd8c
    at sun.awt.windows.WToolkit.eventLoop(Native Method)
    at sun.awt.windows.WToolkit.run(WToolkit.java:253)
    at java.lang.Thread.run(Thread.java:536)
    "AWT-Shutdown" prio=5 tid=0x0ACB1158 nid=0x480 in Object.wait() [aebf000..aebfd
    c]
    at java.lang.Object.wait(Native Method)
    - waiting on <02FA4990> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:426)
    at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
    - locked <02FA4990> (a java.lang.Object)
    at java.lang.Thread.run(Thread.java:536)
    "Signal Dispatcher" daemon prio=10 tid=0x009E8350 nid=0x788 waiting on conditio
    [0..0]
    "Finalizer" daemon prio=9 tid=0x0003E978 nid=0x3f0 in Object.wait() [ab1f000..a
    1fd8c]
    at java.lang.Object.wait(Native Method)
    - waiting on <02F699B0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
    - locked <02F699B0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=10 tid=0x0003D548 nid=0x7a4 in Object.wait() [a
    df000..aadfd8c]
    at java.lang.Object.wait(Native Method)
    - waiting on <02F69A18> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:426)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113)
    - locked <02F69A18> (a java.lang.ref.Reference$Lock)
    "VM Thread" prio=5 tid=0x009E52C0 nid=0x974 runnable
    "VM Periodic Task Thread" prio=10 tid=0x009E7040 nid=0x4e4 waiting on condition

  • JEditorPane's paint method problem (urgent)

    Hi all, I have JEditorPane that displays HTML formatted text.
    My task requirement is to display a compay logo as static backgdound in this jeditorPane
    (The logo must be displayed always in the center nevermind the text scrolling)...
    So I overrided JEditorPane's paint method like that:
    public void paint(Graphics g) {
          super.paint(g);
          int scrolled_down = (int) ( (JViewport)this.getParent()).getViewPosition().
              getY();
          Rectangle visibleRectangle = new Rectangle();
          int width = visibleRectangle.getBounds().width;
          int height = visibleRectangle.getBounds().height;
          ImageIcon logo = IconFactory.getInstance().getIngLogoPaleIcon();
          g.drawImage(logo.getImage(), (width - logo.getIconWidth()) / 2,
                      scrolled_down + (height - logo.getIconHeight()) / 2, this);
        }But the problem is that I drow the logo over the some part of the text and the text is not visible.
    If I call super.paint(Graphics) mehtod after I drow the logo, the logo is overpainted and is not visible.
    (This logo is very pale transparent gif image).
    So my question is how can I achieve the effect this logo to be behind the text displayed in JEditorPane
    (I tried if it's possible to use CSS body attributes for static background image,but as I expected they are not supported)
    Thanks for every help in advance

    Hi!
    myEditorPane.setOpaque(false) This allows components under the EditorPane to show through.
    Thus, add a label with the desired image into a JLayeredPane, (if using in a JDeskTopPane you have acces to its FRAME_CONTENT_LAYER).
    Add your EditorPane on top of this after setting opaque to false and viola!
    Be aware that you should use caution when choosing a forground, (font ), color as the underlying image will affect how your text appears....
    :)

  • Problem about calling paint method

    I have created a class to ask user input 3 floating-point numbers, using JApplet. the code list below
    import java.awt.Graphics;
    import javax.swing.*;
    public class Numbers
    double average,sum,product;
    String result;
    public void init()
    String firstNumber,secondNumber,thirdNumber;
    double num1,num2,num3;
    firstNumber=JOptionPane.showInputDialog("enter first number");
    secondNumber=JOptionPane.showInputDialog("Enter second number");
    thirdNumber=JOptionPane.showInputDialog("Enter thrid number");
    num1=Double.parseDouble(firstNumber);
    num2=Double.parseDouble(secondNumber);
    num3=Double.parseDouble(thirdNumber);
    sum=num1+num2+num3;
    product=num1*num2*num3;
    average=(num1+num2+num3)/3;
    result="";
    if(num1<num2 && num2<num3)
    result=result+num3+" is the largest number";
    if(num2>num1 && num2>num3)
    result=result+num2 +" is the largest number";
    if(num1>num2 && num2>num3)
    result=result+ num1+" is the largest number";
    public void paint(Graphics g)
    super.paint(g);
    g.drawString("sum is"+sum,25,25);
    g.drawString("product is"+ product,25,40);
    g.drawString("average is"+ average,25,60);
    g.drawString(" the largest number is"+result,25,80);
    however, after I compiled, it gave me the error message as:
    java:40: cannot resolve symbol
    symbol : method paint (java.awt.Graphics)
    location: class java.lang.Object
    super.paint(g);
    ^(pointer should point to the dot)
    don't know why,
    Message was edited by:
    ritchie_lin

    your class doesn't extend japplet or any other object for that matter. It does extend Object as all classes do, and Object has no paint method.
    Consider changing:
      public class Numbersto
      public class Numbers extends JAppletAlso, please use code tags next time you're posting code.
    Addendum: If this is not the JApplet portion of your code, it still has to subclass a Swing component that can accept painting such as JPanel. Also, with Swing you use paintComponent rather than paint.
    Message was edited by:
    petes1234

  • Adding a JButton when there's a paint method

    I'm creating a game application, sort of like a maze, and I want to add buttons to the levelOne panel to be able to move around the maze. When I add the buttons to the panel they don't appear, I assume the paint method is the reason for this. here's my code, I have 3 files, ill post the user_interface, and the levels class, where the level is created and where i tried to add the button. I tried putting the buttons in a JOptionPane, but then my JMenu wouldn't work at the same time the OptionPane was opened. If anyone knows a way around this instead, please let me know. I also tried using a separate class with a paintComponent method in it, and then adding the button (saw on a forum, not sure if it was this one), but that didn't work either. Also, if there is a way just to simply have the user press the directional keys on the keyboard and have the program perform a certain function when certain keys are pressed, I'd like to know, as that would solve my whole problem. Thanks.
    //Libraries
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    public class User_Interface extends JFrame
    static Levels l = new Levels ();
    static Delay d = new Delay ();
    private Container contentPane = getContentPane ();
    private JPanel main, levelOne;
    private String level;
    private CardLayout cc = new CardLayout ();
    private GridBagConstraints gbc = new GridBagConstraints ();
    private JPanel c = new JPanel ();
    private String label = "MainMenu";
    public User_Interface ()
    //Generates the User-Interface
    super ("Trapped");
    main = new JPanel ();
    GridBagLayout gbl = new GridBagLayout ();
    main.setLayout (gbl);
    c.setLayout (cc);
    // set_gbc (gbc, 2, 2, 5, 5, GridBagConstraints.NONE);
    c.add (main, "Main Page");
    contentPane.add (c, BorderLayout.CENTER);
    cc.show (c, "Main Page");
    levelOne = new JPanel ();
    levelOne.setLayout (new GridBagLayout ());
    levelOne.setBackground (Color.black);
    c.add (levelOne, "LevelOne");
    JMenuBar menu = new JMenuBar ();
    JMenu file = new JMenu ("File");
    JMenu help = new JMenu ("Help");
    JMenuItem about = new JMenuItem ("About");
    JMenuItem mainmenu = new JMenuItem ("Main Menu");
    mainmenu.addActionListener (
    new ActionListener ()
    public void actionPerformed (ActionEvent event)
    cc.show (c, "Main Page");
    label = "MainMenu";
    JMenuItem newGame = new JMenuItem ("New Game");
    newGame.addActionListener (
    new ActionListener ()
    public void actionPerformed (ActionEvent event)
    l.xCord = 2;
    l.yCord = 2;
    l.xLoc = 140;
    l.yLoc = 140;
    JPanel entrance = new JPanel ();
    entrance.setLayout (new FlowLayout ());
    c.add (entrance, "Entrance");
    label = "Entrance";
    level = "ONE";
    cc.show (c, "Entrance");
    JMenuItem loadgame = new JMenuItem ("Load Game");
    JMenuItem savegame = new JMenuItem ("Save Game");
    JMenuItem exit = new JMenuItem ("Exit");
    exit.addActionListener (
    new ActionListener ()
    public void actionPerformed (ActionEvent event)
    JFrame frame = new JFrame ();
    frame.setLocation (10, 10);
    JOptionPane.showMessageDialog (frame, "Come Back Soon!", "TRAPPED", JOptionPane.INFORMATION_MESSAGE);
    System.exit (0);
    file.add (about);
    file.add (mainmenu);
    file.add (newGame);
    file.add (loadgame);
    file.add (savegame);
    file.add (exit);
    menu.add (file);
    menu.add (help);
    setJMenuBar (menu);
    //Sets the size of the container (columns by rows)
    setSize (750, 550);
    //Sets the location of the container
    setLocation (10, 10);
    //Sets the background colour to a dark blue colour
    main.setBackground (Color.black);
    //Makes the container visible
    setVisible (true);
    public void paint (Graphics g)
    super.paint (g);
    g.setColor (Color.white);
    if (label == "MainMenu")
    for (int x = 0 ; x <= 50 ; ++x)
    g.setColor (Color.white);
    g.setFont (new Font ("Arial", Font.BOLD, x));
    g.drawString ("T R A P P E D", 100, 125);
    d.delay (10);
    if (x != 50)
    g.setColor (Color.black);
    g.drawString ("T R A P P E D", 100, 125);
    if (label == "Entrance")
    l.Entrance ("ONE", g);
    label = "LevelOne";
    if (label == "LevelOne")
    l.LevelOne (g, levelOne, gbc);
    label = "";
    public static void main (String[] args)
    // calls the program
    User_Interface application = new User_Interface ();
    application.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    } //End of Main Method
    //Libraries
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Levels extends Objects
    private JFrame frame = new JFrame ();
    //Sets location, size, and visiblity to the frame where the JOptionPane
    //will be placed
    frame.setLocation (600, 600);
    frame.setSize (1, 1);
    frame.setVisible (false);
    public int xCord = 2;
    public int yCord = 2;
    public void LevelOne (Graphics g, JPanel one, GridBagConstraints gbc)
    ***Trying to add the button, doesn't appear. Tried adding to the container, and any JPanel i had created***
    JButton button1 = new JButton ("TEST");
    one.add (button1);
    g.setColor (Color.white);
    g.fillRect (500, 100, 200, 300);
    g.setColor (Color.black);
    g.drawRect (500, 100, 200, 300);
    g.setFont (new Font ("Verdana", Font.BOLD, 25));
    g.setColor (Color.black);
    g.drawString ("LEVEL ONE", 525, 80);
    //ROW ONE
    counter = -80;
    counter2 = 200;
    for (int a = 1 ; a <= 7 ; ++a)
    if (xCord < a && yCord == 0)
    g.setColor (darkGray);
    g.fillRect (xLoc + counter, yLoc - 80, 40, 40);
    g.setColor (Color.black);
    g.drawRect (xLoc + counter, yLoc - 80, 40, 40);
    if (xCord > a - 1 && yCord == 0)
    g.setColor (darkGray);
    g.fillRect (xLoc + counter2, yLoc - 80, 40, 40);
    g.setColor (Color.black);
    g.drawRect (xLoc + counter2, yLoc - 80, 40, 40);
    counter += 40;
    counter2 += 40;
    *****Theres 9 more rows, just edited out to save space****
    int y = 100;
    int x = 100;
    for (int a = 0 ; a < 20 ; ++a)
    g.setColor (Color.white);
    g.fillRoundRect (x, y, 40, 40, 5, 5);
    g.setColor (Color.black);
    g.drawRoundRect (x, y, 40, 40, 5, 5);
    y += 40;
    if (a == 9)
    x += 320;
    y = 100;
    x = 140;
    y = 100;
    for (int a = 0 ; a < 14 ; ++a)
    g.setColor (Color.white);
    g.fillRoundRect (x, y, 40, 40, 5, 5);
    g.setColor (Color.black);
    g.drawRoundRect (x, y, 40, 40, 5, 5);
    x += 40;
    if (a == 6)
    x = 140;
    y += 360;
    g.setColor (Color.black);
    g.drawRect (100, 100, 360, 400);
    ImageIcon[] images = new ImageIcon [4];
    images [0] = new ImageIcon ("arrow_left.gif");
    images [1] = new ImageIcon ("arrow_up.gif");
    images [2] = new ImageIcon ("arrow_down.gif");
    images [3] = new ImageIcon ("arrow_right.gif");
    int direction = -1;
    *****This is where I tried to have the OptionPane show the directional buttons******
    //frame.setVisible (true);
    // direction = JOptionPane.showOptionDialog (frame, "Choose Your Path:", "Trapped", JOptionPane.YES_NO_CANCEL_OPTION,
    // JOptionPane.QUESTION_MESSAGE,
    // null,
    // images,
    // images [3]);
    // if (direction == 0)
    // if (xCord - 1 > 0)
    // xCord -= 1;
    // xLoc += 40;
    // if (direction == 1)
    // if (yCord - 1 > 0)
    // yCord -= 1;
    // yLoc += 40;
    // if (direction == 2)
    // if (yCord + 1 < 9)
    // yCord += 1;
    // yLoc -= 40;
    // if (direction == 3)
    // if (xCord + 1 < 13)
    // xCord += 1;
    // xLoc -= 40;
    //LevelOne (g, one, gbc);
    }

    i tried adding a keylistener, that didn't work too well, i had tried to add it to a button and a textarea which i added to the 'one' frame, it didn't show up, and it didn't work. How would i go about changing the paint method so that it doesn't contain any logic? That's the only way I could think of getting the program to move forward in the game. Thanks.
    //Libraries
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    public class User_Interface extends JFrame
        static Levels l = new Levels ();
        static Delay d = new Delay ();
        private Container contentPane = getContentPane ();
        private JPanel main, levelOne;
        private String level;
        private CardLayout cc = new CardLayout ();
        private GridBagConstraints gbc = new GridBagConstraints ();
        private JPanel c = new JPanel ();
        private String label = "MainMenu";
        public User_Interface ()
            //Generates the User-Interface
            super ("Trapped");
            main = new JPanel ();
            GridBagLayout gbl = new GridBagLayout ();
            main.setLayout (gbl);
            c.setLayout (cc);
            // set_gbc (gbc, 2, 2, 5, 5, GridBagConstraints.NONE);
            c.add (main, "Main Page");
            contentPane.add (c, BorderLayout.CENTER);
            cc.show (c, "Main Page");
            levelOne = new JPanel ();
            levelOne.setLayout (new GridBagLayout ());
            levelOne.setBackground (Color.black);
            c.add (levelOne, "LevelOne");
            JMenuBar menu = new JMenuBar ();
            JMenu file = new JMenu ("File");
            JMenu help = new JMenu ("Help");
            JMenuItem about = new JMenuItem ("About");
            JMenuItem mainmenu = new JMenuItem ("Main Menu");
            mainmenu.addActionListener (
                    new ActionListener ()
                public void actionPerformed (ActionEvent event)
                    cc.show (c, "Main Page");
                    label = "MainMenu";
            JMenuItem newGame = new JMenuItem ("New Game");
            newGame.addActionListener (
                    new ActionListener ()
                public void actionPerformed (ActionEvent event)
                    l.xCord = 2;
                    l.yCord = 2;
                    l.xLoc = 140;
                    l.yLoc = 140;
                    JPanel entrance = new JPanel ();
                    entrance.setLayout (new FlowLayout ());
                    c.add (entrance, "Entrance");
                    label = "Entrance";
                    level = "ONE";
                    cc.show (c, "Entrance");
            JMenuItem loadgame = new JMenuItem ("Load Game");
            JMenuItem savegame = new JMenuItem ("Save Game");
            JMenuItem exit = new JMenuItem ("Exit");
            exit.addActionListener (
                    new ActionListener ()
                public void actionPerformed (ActionEvent event)
                    JFrame frame = new JFrame ();
                    frame.setLocation (10, 10);
                    JOptionPane.showMessageDialog (frame, "Come Back Soon!", "TRAPPED", JOptionPane.INFORMATION_MESSAGE);
                    System.exit (0);
            file.add (about);
            file.add (mainmenu);
            file.add (newGame);
            file.add (loadgame);
            file.add (savegame);
            file.add (exit);
            menu.add (file);
            menu.add (help);
            setJMenuBar (menu);
            //Sets the size of the container (columns by rows)
            setSize (750, 550);
            //Sets the location of the container
            setLocation (10, 10);
            //Sets the background colour to a dark blue colour
            main.setBackground (Color.black);
            //Makes the container visible
            setVisible (true);
        public void paint (Graphics g)
            super.paint (g);
            g.setColor (Color.white);
            if (label == "MainMenu")
                for (int x = 0 ; x <= 50 ; ++x)
                    g.setColor (Color.white);
                    g.setFont (new Font ("Arial", Font.BOLD, x));
                    g.drawString ("T    R    A    P    P    E    D", 100, 125);
                    d.delay (10);
                    if (x != 50)
                        g.setColor (Color.black);
                        g.drawString ("T    R    A    P    P    E    D", 100, 125);
            if (label == "Entrance")
                l.Entrance ("ONE", g);
                label = "LevelOne";
            if (label == "LevelOne")
                l.LevelOne (g, levelOne, gbc);
                label = "";
            //g.setColor (new Color
        public static void main (String[] args)
            // calls the program
            User_Interface application = new User_Interface ();
            application.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        } //End of Main Method
    //Libraries
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.ActionMap;
    import javax.swing.plaf.*;
    public class Levels extends Objects
        implements KeyListener
        //static final String newline = System.getProperty ("line.separator");
        JButton button;
        private JFrame frame = new JFrame ();
            //Sets location, size, and visiblity to the frame where the JOptionPane
            //will be placed
            frame.setLocation (600, 600);
            frame.setSize (1, 1);
            frame.setVisible (false);
        JButton button1;
        public int xCord = 2;
        public int yCord = 2;
        public void LevelOne (Graphics g, JPanel one, GridBagConstraints gbc)
        //    button = new JButton ("TEST");
        //    ButtonHandler handler = new ButtonHandler ();
         //   button.addActionListener (handler);
          //  one.add (button);
            g.setColor (Color.white);
            g.fillRect (500, 100, 200, 300);
            g.setColor (Color.black);
            g.drawRect (500, 100, 200, 300);
            g.setFont (new Font ("Verdana", Font.BOLD, 25));
            g.setColor (Color.black);
            g.drawString ("LEVEL ONE", 525, 80);
            //ROW ONE
            counter = -80;
            counter2 = 200;
            for (int a = 1 ; a <= 7 ; ++a)
                if (xCord < a && yCord == 0)
                    g.setColor (darkGray);
                    g.fillRect (xLoc + counter, yLoc - 80, 40, 40);
                    g.setColor (Color.black);
                    g.drawRect (xLoc + counter, yLoc - 80, 40, 40);
                if (xCord > a - 1 && yCord == 0)
                    g.setColor (darkGray);
                    g.fillRect (xLoc + counter2, yLoc - 80, 40, 40);
                    g.setColor (Color.black);
                    g.drawRect (xLoc + counter2, yLoc - 80, 40, 40);
                counter += 40;
                counter2 += 40;
            int y = 100;
            int x = 100;
            for (int a = 0 ; a < 20 ; ++a)
                g.setColor (Color.white);
                g.fillRoundRect (x, y, 40, 40, 5, 5);
                g.setColor (Color.black);
                g.drawRoundRect (x, y, 40, 40, 5, 5);
                y += 40;
                if (a == 9)
                    x += 320;
                    y = 100;
            x = 140;
            y = 100;
            for (int a = 0 ; a < 14 ; ++a)
                g.setColor (Color.white);
                g.fillRoundRect (x, y, 40, 40, 5, 5);
                g.setColor (Color.black);
                g.drawRoundRect (x, y, 40, 40, 5, 5);
                x += 40;
                if (a == 6)
                    x = 140;
                    y += 360;
            g.setColor (Color.black);
            g.drawRect (100, 100, 360, 400);
            ImageIcon[] images = new ImageIcon [4];
            images [0] = new ImageIcon ("arrow_left.gif");
            images [1] = new ImageIcon ("arrow_up.gif");
            images [2] = new ImageIcon ("arrow_down.gif");
            images [3] = new ImageIcon ("arrow_right.gif");
            int direction = -1;
            //frame.setVisible (true);
            // direction = JOptionPane.showOptionDialog (frame, "Choose Your //\Path:", "Trapped", JOptionPane.YES_NO_CANCEL_OPTION,
            //         JOptionPane.QUESTION_MESSAGE,
            //         null,
            //         images,
            //         images [3]);
            // if (direction == 0)
            //     if (xCord - 1 > 0)
            //         xCord -= 1;
            //         xLoc += 40;
            // if (direction == 1)
            //     if (yCord - 1 > 0)
            //         yCord -= 1;
            //         yLoc += 40;
            // if (direction == 2)
            //     if (yCord + 1 < 9)
            //         yCord += 1;
            //         yLoc -= 40;
            // if (direction == 3)
            //     if (xCord + 1 < 13)
            //         xCord += 1;
            //         xLoc -= 40;
            one.addKeyListener (this);
            // one.add (button1);
            if (xCord == 1)
                LevelOne (g, one, gbc);
        /** Handle the key typed event from the text field. */
        public void keyTyped (KeyEvent e)
        /** Handle the key pressed event from the text field. */
        public void keyPressed (KeyEvent e)
            if (e.getSource () == "Up")
                JOptionPane.showMessageDialog (null, "Hi", "Hi", 0, null);
        /** Handle the key released event from the text field. */
        public void keyReleased (KeyEvent e)
            // displayInfo (e, "KEY RELEASED: ");
    }

  • Paint() method is in infinite loop when focus is set to JTextPane

    Hi All,
    I am creating one JScrollPane, JPanel and JTextPane. JPanel is added to JScrollPane and JTextPane is added to JPanel. If I override paint() method in JPanel, its in infinite loop. I don't know why it is behaving like this. Can anyone solve my problem. Since, I am doing so much drawings in paint() method, its getting to slow.
    Here is the code what I wrote.
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestTextPane1 extends JFrame {
         JPanel panel;
         JScrollPane pane;
         public TestTextPane1() {
              panel = new JPanel(new BorderLayout()) {
                   public void paint(Graphics g) {
                        super.paint(g);
                        System.out.println("inside paint");
              JTextPane textPane = new JTextPane();
              panel.add(textPane);
              pane = new JScrollPane(panel);
              getContentPane().add(pane);
              setSize(300, 200);
              setVisible(true);
         public static void main(String [] args) {
              new TestTextPane1();
    Any help will be useful for me.
    Regards
    Kishore.

    What are you trying to do? You are adding the textPane to the panel and then overriding the paint() method. The textPane will never be painted if you do this.
    In Swing, you should override the paintComponent() method, not the paint() method. See the Swing tutorial on Painting:
    http://java.sun.com/docs/books/tutorial/uiswing/overview/draw.html
    Don't forget to read the "Working With Graphics" link at the bottom.

  • 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.

  • Problem with a method

    I have a problem with the getRGB(int x, int y) method of the BufferedImage class :
    I've load an image in it :
    1:// b is my bufferedimage clas and myimage is an image
    2:b.getGraphics().drawImage(myimage, 0, 0, this);
    3:// g is the graphics object of my paint method
    4:g.drawImage(b, 634, 225, null);
    5:// This write -16777216 and 10, 10 is a black point
    6:System.out.println(b.getRGB(10, 10));
    I think the problem is at the second line. But i'm not sure. Can somebody help ?

    That's probably not what you meant. You can do a binary and:int r = (hex & 0x00FF0000) >> 16;
    int g = (hex & 0x0000FF00) >> 8;
    int b = (hex & 0x000000FF);

  • SwingUtilities.paintComponent - problems with painting childs of components

    Maybe this question was mention already but i cant find any answer...
    Thats what could be found in API about method paintComponent in SwingUtilities:
    Paints a component c on an arbitrary graphics g in the specified rectangle, specifying the rectangle's upper left corner and size. The component is reparented to a private container (whose parent becomes p) which prevents c.validate() and c.repaint() calls from propagating up the tree. The intermediate container has no other effect.
    The component should either descend from JComponent or be another kind of lightweight component. A lightweight component is one whose "lightweight" property (returned by the Component isLightweight method) is true. If the Component is not lightweight, bad things map happen: crashes, exceptions, painting problems...
    So this method perfectly works for simple Java components like JButton / JCheckbox e.t.c.
    But there are problems with painting JScrollBar / JScrollPane (only background of this component appears).
    I tried to understand why this happens and i think the answer is that it has child components that does not draw at all using SwingUtilities.paintComponent()
    (JScrollBar got at least 2 childs - 2 buttons on its both sides for scroll)
    Only parent component appears on graphics - and thats why i see only gray background of scrollbar
    So is there any way to draw something like panel with a few components on it if i have some Graphics2D to paint on and component itself?
    Simple example with JScrollPane:
    JScrollPane pane = new JScrollPane(new JLabel("TEST"));
    pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    SwingUtilities.paintComponent(g2d, pane, new JPanel(), 0, 0, 200, 200);Edited by: mgarin on Aug 11, 2008 7:48 AM

    Well the thing you advised could work... but this wont be effective, because i call repaint of the area, where Components painted, very often..
    So it will lag like hell when i make 10-20 repaints in a second... (for e.g. when i drag anything i need mass repainting of the area)
    Isnt there any more optimal way to do painting of the sub-components?
    As i understand when any component (even complicated with childs) paints in swing - its paint method calls its child components paint() to show them... can this thing be reproduced to paint such components as JScrollPane?

  • How to use an object's paint method

    I have created a class imagePanel which extends a jPanel to display an image. When I create a new imagePanel object I pass it an image argument which is used to paint my image on the jPanel, so far so good. I don't wish to have to continuously create new ImamePanels to display new images so I thought I could make a set_Image method that would set a new image in an exising imagePanel object. This is where I run into problems how to use the existing object paint method to replace the image. I tried this without success:
    public Image setMyImage (Image myImage)
    imageX = myImage; // imageX is the image that is painted by the imagePanel object's paint method
    paint(g);
    Something must be wrong on how I access the paint method. Thanks for any help.
    Jack

    Yahoooo, got it. This was the code I needed and thanks for your help:
    public void setImage (Image myImage)
    imageX = myImage;
    repaint(300);
    }

  • How to call paint() method during creating object

    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    class SomeShape extends JPanel {
         protected static float width;
         protected BasicStroke line = new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.CAP_ROUND);
    class Oval extends SomeShape {
         Oval(float width) {
              this.width = width;
              line = new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.CAP_ROUND);
              repaint();
         public void paint(Graphics g) {
              Graphics2D pen = (Graphics2D)g;
              int i = 10;
              super.paint(g);
                   g.setColor(Color.blue);
                   g.drawOval(90, 0+i, 90, 90);
                   System.out.println("paint()");
    public class FinalVersionFactory {
        JFrame f = new JFrame();
        Container cp = f.getContentPane();
        float width = 0;
        SomeShape getShape() {
             return new Oval(width++); //I want to paint this oval when I call getShape() method
         public FinalVersionFactory() {
              f.setSize(400, 400);
    //          cp.add(new Oval()); without adding
              cp.addMouseListener(new MouseAdapter() {
                   public void mouseReleased(MouseEvent e) {
                        getShape();
              f.setVisible(true);
         public static void main(String[] args) { new FinalVersionFactory(); }
    }I need help. When I cliked on the JFrame nothing happened. I want to call paint() method and paint Oval when I create new Oval() object in getShape(). Can you correct my mistakes? I tried everything...Thank you.

    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    class SomeShape extends JPanel {
         protected static float width;
         protected static BasicStroke line = new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.CAP_ROUND);
    class Oval extends SomeShape {
         static int x, y;
         Oval(float width, int x, int y) {
              this.width = width;
              this.x = x;
              this.y = y;
              line = new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.CAP_ROUND);
         public void paint(Graphics g) {
              Graphics2D pen = (Graphics2D)g;
                   g.setColor(Color.blue);
                   pen.setStroke(line);
                   g.drawOval(x, y, 90, 90);
                   System.out.println("Oval.paint()"+"x="+x+"y="+y);
    class Rect extends SomeShape {
         static int x, y;
         Rect(float width, int x, int y) {
              this.width = width;
              this.x = x;
              this.y = y;
              line = new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.CAP_ROUND);
         public void paint(Graphics g) {
              Graphics2D pen = (Graphics2D)g;
                   g.setColor(new Color(250, 20, 200, 255));      
                   pen.setStroke(line);
                   g.drawRect(x, y, 80, 80);
                   System.out.println("Rect.paint()"+"x="+x+"y="+y);
    public class FinalVersionFactory extends JFrame {
        Container cp = getContentPane();
        float width = 0;
        int x = 0;
        int y = 0;
            boolean rect = false;
        SomeShape getShape() {
             SomeShape s;
              if(rect) {
                   s = new Rect(width, x, y);
                   System.out.println("boolean="+rect);
              } else {
                   s = new Oval(width++, x, y);
                   System.out.println("boolean="+rect);
              System.out.println("!!!"+s); //print Oval or Rect OK
              return s; //return Oval or Rect OK
         public FinalVersionFactory() {
              setSize(400, 400);
              SomeShape shape = getShape();
              cp.add(shape); //First object which is add to Container(Oval or Rect), returned by getShape() method
              //will be paint all the time. Why? Whats wrong?
              cp.addMouseListener(new MouseAdapter() {
                   public void mouseReleased(MouseEvent e) {
                        x = e.getX();
                        y = e.getY();
                        rect = !rect;
                        getShape();
                        cp.repaint(); //getShape() return Oval or Rect object
                                      //but repaint() woks only for object which was added(line 67) as first
              setVisible(true);
         public static void main(String[] args) { new FinalVersionFactory(); }
    }I almost finish my program but I have last problem. I explained it in comment. Please look at it and correct my mistakes. I will be very greatful!!!
    PS: Do you thing that this program is good example of adoption Factory Pattern?

  • Determining if printing is going on in paint method

    By looking at the source of the existing visual components, I have found out that JComponent.paintChildren uses getFlag(IS_PRINTING) to determine wether or not the current call to paint will paint to screen or to a printer.
    The problem is that both getFlag and the constants it uses are declared as private in JComponent. This is why I am wondering why Sun chose to keep this information private to the JComponent class, while this information could be very useful in some situations.
    Also, would there be any alternatives to determine wether or not printing is occuring from a paint method besides managing flags the same way JComponent does?
    Thanks in advance.

    I gave a try to your approach but it doesn't seem that the graphics object passed to the paint method during the printing process implements PrintGraphics. I'll keep trying stuff with that idea until some new input is given, but thanks for the idea, it sure could have worked out ;)

  • More than one paint method?

    Hi
    Im wondering if it is possible to have more than one paint method. It should look something like this.
    public class MyApplet extends JApplet {
    public void paint(Graphics g) { // the normal paint method
    public void SecondPaint(Graphics gr) { // should i name the Graphics
    // to the same as in the normal paint method ( Graphics g) ?
    }And if its possible how would i repaint the other method?
    This is for the normal
    repaint(); and how would i do for the second paint method?
    please write an example program with two paint methods and just write below how to repaint.
    Thanks you som much if you reply

    (sorry to hijack this thread...) Yes, it'swindows,
    but right now my problem isn't even that. It'sjust
    catching and correcting basic c-coding errors.
    Witness my embarrassment in the JNI forum:
    http://forum.java.sun.com/thread.jspa?threadID=5213196
    &tstart=15
    Now if only I lived in "middle-of-no-where"Virginia!
    Nice! ;-)I saw your note about "middle-of-nowhere" Virginia a little too late. And you don't need to live here; my Solaris machine is up and running 24/7 and is open for SSH and XClient. (Also open for telnet, which comes built into windows, I believe.) If you'd like to brush up on Solaris C, C++ and Java development, just let me know. You're more than welcome to use the machine. I have tons of space on the drive and a dedicated connection just to that machine. There is an application for windows called CygwinX which is an XClient for Solaris. You can use that to remotely log into the Solaris desktop. There are about fifteen other people that I let use the machine for various reasons. I host myriad open source projects for development that you're more than welcome to mess around with. Tools available to you would be NetBeans 5.5, Sun Studio (with the Sun C/C++/Fortran compiler - which is beautiful by the way); and the whole suite of GNU compilers. I have the CDE and the JavaDesktop built in. I also have tons of Motif tutorials and demonstrations if you're interested in those. Heads up, though ... XServer tends to run pretty slowly when I have more than about four users logged onto a desktop at once. But like I said, if you (or just about anyone else for that matter) are interested, let me know and I'd be more than glad to set you up.

  • Passing Data to a Paint Method

    Total newbie here just learning the basics of Java on my own. Working a little application that will display a filled polygon which shows the correct heading of ship based on previously input Ship Heading, length and width. I have the application working fine to generate the 5 points, and then it will display correctly when I enter the points in the paint method by hand. Thing is I want to have the coords passed to the paint method. and am having some trouble doing this. All the examples I have seen show the points to be displayed already being declared in the paint method. Here is the Paint Method I have come up with based on examples I have seen. Still pretty new and trying to read through the APIs and other books, but haven't broken the code on understanding them.
    import java.awt.*;
    import javax.swing.*;
    public class DrawShip5
       public static void main(String[] a)
        JFrame f = new JFrame();
        f.setTitle("Ship Heading");
        f.setSize(700,700);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setContentPane(new DrawShip2());
        f.setVisible(true);
       static class DrawShip2 extends JComponent
           static public void paintData(int [] finalCoordsArray )
        int finalBowACoordX = finalCoordsArray[0];
        int finalBowACoordY = finalCoordsArray[1];
        int finalPortMidACoordX = finalCoordsArray[2];
        int finalPortMidACoordY = finalCoordsArray[3];
        int finalPortSternACoordX = finalCoordsArray[4];
        int finalPortSternACoordY = finalCoordsArray[5];
        int finalStarSternACoordX = finalCoordsArray[6]; 
        int finalStarSternACoordY = finalCoordsArray[7]; 
        int finalStarMidACoordX = finalCoordsArray[8];
        int finalStarMidACoordY = finalCoordsArray[9];       
        public void paint(Graphics g )
             // Am sure my problem lies in here
            int finalBowACoordX = paintData.finalBowACoordX;
            int finalBowACoordY = paintData.finalBowACoordY;
            int finalPortMidACoordX = paintData.finalPortMidACoordX;
            int finalPortMidACoordY = paintData.finalPortMidACoordY;
            int finalPortSternACoordX = paintData.finalPortSternACoordX;
            int finalPortSternACoordY = paintData.finalPortSternACoordY;
            int finalStarSternACoordX = paintData.finalStarSternACoordX; 
            int finalStarSternACoordY = paintData.finalStarSternACoordY; 
            int finalStarMidACoordX = paintData.finalStarMidACoordX;
            int finalStarMidACoordY = paintData.finalStarMidACoordY;    
             g.setColor(Color.black);
             g.drawLine(350, 0, 350, 700);
             g.drawLine(0, 350, 700, 350);
             g.setColor(Color.blue);
             Polygon shipPic = new Polygon();
             shipPic.addPoint( finalBowACoordX, finalBowACoordY ); // Bow Coords
             shipPic.addPoint( finalPortMidACoordX, finalPortMidACoordY ); // Port Midship Coords
             shipPic.addPoint( finalPortSternACoordX, finalPortSternACoordY ); // Port Aft Coords
             shipPic.addPoint( finalStarSternACoordX, finalStarSternACoordY ); // Starboard Aft Coords
             shipPic.addPoint( finalStarMidACoordX, finalStarMidACoordY ); // Starboard Midship Coords
             g.fillPolygon( shipPic );
    } Thanks for any help

    Looks like I was typing as Malcom was responding....where would I add that bit of code?
    import java.awt.*;
    import javax.swing.*;
    public class DrawShip5
       public static void main(String[] a)
        JFrame f = new JFrame();
        f.setTitle("Ship Heading");
        f.setSize(700,700);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setContentPane(new DrawShip2());
        f.setVisible(true);    
        // Place the code here? Get an error for the finalCoordsArray not recognized
       static class DrawShip2 extends JComponent
                private int finalBowACoordX;
             private int finalBowACoordY;
             private int finalPortMidACoordX;
             private int finalPortMidACoordY;
             private int finalPortSternACoordX;
             private int finalPortSternACoordY;
             private int finalStarSternACoordX; 
             private int finalStarSternACoordY; 
             private int finalStarMidACoordX;
             private int finalStarMidACoordY; 
              static public void setCoords(int [] finalCoordsArray)
                 int finalBowACoordX = finalCoordsArray[0];
                 int finalBowACoordY = finalCoordsArray[1];
                 int finalPortMidACoordX = finalCoordsArray[2];
                 int finalPortMidACoordY = finalCoordsArray[3];
                 int finalPortSternACoordX = finalCoordsArray[4];
                 int finalPortSternACoordY = finalCoordsArray[5];
                 int finalStarSternACoordX = finalCoordsArray[6]; 
                 int finalStarSternACoordY = finalCoordsArray[7]; 
                 int finalStarMidACoordX = finalCoordsArray[8];
                 int finalStarMidACoordY = finalCoordsArray[9];
              // Print final coords after array passed and parsed
                 System.out.println("Paint Final Bow Coords: (" + finalBowACoordX + ", " + finalBowACoordY + ")");
                 System.out.println("Paint Final Port Midship Coords: (" + finalPortMidACoordX + ", " + finalPortMidACoordY + ")");
                 System.out.println("Paint Final Port Stern Coords: (" + finalPortSternACoordX + ", " + finalPortSternACoordY + ")");
                 System.out.println("Paint Final Starboard Stern Coords: (" + finalStarSternACoordX + ", " + finalStarSternACoordY + ")");
                 System.out.println("Paint Final Starboard Midship Coords: (" + finalStarMidACoordX + ", " + finalStarMidACoordY + ")");
          public void paintComponent(Graphics g )
            g.setColor(Color.black);
             g.drawLine(350, 0, 350, 700);
             g.drawLine(0, 350, 700, 350);
             g.setColor(Color.blue);
             Polygon shipPic = new Polygon();
             shipPic.addPoint( finalBowACoordX, finalBowACoordY ); // Bow Coords
             shipPic.addPoint( finalPortMidACoordX, finalPortMidACoordY ); // Port Midship Coords
             shipPic.addPoint( finalPortSternACoordX, finalPortSternACoordY ); // Port Aft Coords
             shipPic.addPoint( finalStarSternACoordX, finalStarSternACoordY ); // Starboard Aft Coords
             shipPic.addPoint( finalStarMidACoordX, finalStarMidACoordY ); // Starboard Midship Coords
             g.fillPolygon( shipPic );
    }Tried placing that code in a few spots and got errors.
    Appreciate the help, These are my first attempts at actually getting away from a single method program. Am getting it ...slowly, but I am getting it.

  • Problem with Update method in Applet..............

    Hi,
    i have a textfield and Button in my Applet. Applet is running locally. if i typed my directory in the textfield and press the reterive button means Applet has to display all the images in that paticular directory. Actually in the button's action performed method i am storing all the file names in the string array. Then i am going through the loop and trying to display the images side by side by increasing X co-ordinate value in the drawImage. But what is happening is, it is displaying last image only not all the images. ie repaint is not calling my update method for each time. it is calling at the end of loop only.
    In the paint method i am calling super.paint(Graphics g). the simillar way do i need to call the update method
    can you give me some idea
    the code is
    public void init() {
    try {
    image = getImage(new URL("file:///c:/Nainar/logo.jpg"));
    catch (Exception e) {
    e.printStackTrace();
    public void paint(Graphics g) {
    update(g);
    public void update(Graphics g) {
    g.drawImage(image,startX,startY,this);
    super.paint(g);
    void jButton1_actionPerformed(ActionEvent e) {
    String location = textFieldControl2.getText();
    if( location != null) {
    File filePath = new File(location);
    if( filePath.isDirectory()) {
    String fileList[] = filePath.list();
    imageFileName = new String[fileList.length];
    for( int i = 0; i < fileList.length; i++) {
    if( fileList.endsWith(".jpg")) {
    try {
    imageFileName[i] = location+"/"+fileList[i];
    image = getImage(new URL("file:///"+location+"/"+fileList[i])).getScaledInstance(100,100,Image.SCALE_DEFAULT);
    startX += 50;
    System.out.println("File Name : "+imageFileName[i]);
    // i guess problem i here repaint is not calling my update method evry time
    repaint();
    }catch(MalformedURLException murle) {
    System.out.println(murle.toString());
    Thanks in advance
    null

    Learn about the distinction between a data model and its visualisation, and maybe MVC. Then realize that the painted stuff on the canvas is no usable data model and can't be modified after it was painted but needs to be redrawn completely. Then start again.

Maybe you are looking for

  • Extended Notifications with Desicion Comments

    Hi all, We have a requirement to have a prompt for user comments when ever user takes a decision in the Extended notifications. The user will receive a mail to his outlook with the approve and reject links and we want to have some setup to ask the us

  • MPEG-2 file has out of sync audio - PLEASE HELP

    We captured four mini-DV tapes into Final Cut Pro HD using my Canon mini DV camera and a firewire. After capture we put each tape on its own timeline, added chapter markers, and then compressed each one into MPEG-2 files using the QT codec. Once we h

  • Why won't my iPod Touch sync before iTunes crashes?

    Last night, I tried to sync my new iPod Touch for the first time. I plugged it in and iTunes recognized it, and the 6 step process began. However, every time it reaches the 2nd step iTunes will shut down all by itself. It is very frustrating since it

  • Enable 802.11n - Need your inputs

    Okay Guys need your input I've heard that if you want to enable High Speed WLAN connection such as 802.11n you need to have you security settings as WPA2 and AES Is this true?

  • Email notification of blog comments

    Does anyone know if .mac offers instant email notification when someone leaves a comment on your blog? If so, how do I turn that on? Before switching to iWeb 08, I used RapidWeaver to create my blog, hosted it on a server other than .mac, and used Ha