Repaint() doesn't seem to work

I'm just starting to play with 2D graphics, and the repaint method on one of my graphics objects doesn't seem to be working until I resize the outer container.
I have a class called Grid (subclassed from Component) which paints a rectangular grid, and has an inner class called Square (also subclassed from Component). Grid has a 2-D array of Squares. Square has a method setBackColour which changes the background colour and repaints itself. Grid has a method SelectSquare which displays a square a selected by calling setBackColour on the relevant Square.
But when I call SelectSquare nothing happens until I do something which causes the whole of the Grid to be repainted (like resizing it), when the new colour suddenly appears. Why is this?
The code is appended - TestGraphics and GraphPanel were generated by NetBeans so are a bit longer than it need be, and Int2 is just a class with 2 integers for x,y coordinates.
To see what happens, click on any square, and then resize.
Thanks in advance,
Peter
* Grid.java
* Created on 02 August 2006, 15:40
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package com.ptoye.TestGraphics;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
* @author PToye
public class Grid extends Component {
  private static final int THICK_WIDTH=4;
  private static final int THIN_WIDTH=2;
  private static final int DOTTED_WIDTH=2;
  static  final int SQUARE_SIZE=60;
  private final int START_X=0;
  private final int START_Y=0;
  private static final int SQUARES=3;  //standard sudoku
  private static final int BIGSQUARES=SQUARES*SQUARES;
  private static final int TotalSize=(SQUARES+1)*THICK_WIDTH+SQUARES*(SQUARES-1)*THIN_WIDTH+
      BIGSQUARES*SQUARE_SIZE;
  Square[][] squareArray=new Square[BIGSQUARES][BIGSQUARES] ;
  static Font squareFont=new Font("SansSerif",Font.BOLD,20);
  static final Color NORMAL_BACK_COLOUR=Color.LIGHT_GRAY;
  static final Color SELECTED_BACK_COLOUR=Color.PINK;
   * Creates a new instance of Grid
  public Grid() {
    int currentXCoord=START_X;
    int currentYCoord=START_Y;
    currentXCoord=START_X+THICK_WIDTH;
    int currentXIndex=0;
    for (int BigX = 0; BigX < SQUARES; BigX++) {
      for (int LittleX = 0; LittleX < SQUARES; LittleX++) {
        currentYCoord=START_Y+THICK_WIDTH;
        int currentYIndex=0;
        for (int BigY = 0; BigY < SQUARES; BigY++) {
          for (int LittleY = 0; LittleY < SQUARES; LittleY++) {
            squareArray[currentXIndex][currentYIndex]=
                new Square(currentXCoord,currentYCoord,'4',Color.RED, NORMAL_BACK_COLOUR);
            currentYIndex+=1;
            currentYCoord+=THIN_WIDTH+SQUARE_SIZE;
          currentYCoord+=THICK_WIDTH-THIN_WIDTH;
        currentXIndex+=1;
        currentXCoord+=THIN_WIDTH+SQUARE_SIZE;
      currentXCoord+=THICK_WIDTH-THIN_WIDTH;
  public Dimension getPreferredSize() {
    return new Dimension(TotalSize,TotalSize);
  public void paint(Graphics g) {
    int currentXCoord=START_X;
    int currentYCoord=START_Y;
    int endXCoord=START_X+TotalSize;
    int endYCoord=START_Y+TotalSize;
    Graphics2D g2=(Graphics2D) g;
    g2.setColor(Color.BLACK);
    System.out.println("Painting picture");
    // paint the grid
    for (int BigX = 0; BigX < SQUARES; BigX++) {
      g2.fillRect(currentXCoord,START_Y,THICK_WIDTH,TotalSize);
      g2.fillRect(START_X,currentXCoord,TotalSize,THICK_WIDTH);
      currentXCoord+=THICK_WIDTH+SQUARE_SIZE;
      for (int SmallX = 1; SmallX < SQUARES; SmallX++) {
        g2.fillRect(currentXCoord,START_Y,THIN_WIDTH,TotalSize);
        g2.fillRect(START_X,currentXCoord,TotalSize,THIN_WIDTH);
        currentXCoord+=THIN_WIDTH+SQUARE_SIZE;
    //not forgetting the right & bottom edges
    g2.fillRect(currentXCoord,START_Y,THICK_WIDTH,TotalSize);
    g2.fillRect(START_X,currentXCoord,TotalSize,THICK_WIDTH);
    // paint the squares
    for (int BigX = 0; BigX < BIGSQUARES; BigX++) {
      for (int BigY = 0; BigY < BIGSQUARES; BigY++) {
        squareArray[BigX][BigY].paint(g);
  public Int2 pointToSquare(Point p) {
    double pointX=p.getX();
    double pointY=p.getY();
    int squareX=-1;
    int squareY=-1;
    int currentIndex=0;
    int currentOffset=START_X+THICK_WIDTH;
    searchX:
      for (int i = 0; i < SQUARES; i++) {
        for (int j = 0; j < SQUARES; j++) {
          if (pointX<currentOffset) {
            return null;   // on a black line
          if (pointX<currentOffset+SQUARE_SIZE) {
            squareX=currentIndex;
            break searchX;
          currentOffset+=THIN_WIDTH+SQUARE_SIZE;
          currentIndex++;
        currentOffset+=THICK_WIDTH-THIN_WIDTH;
      if (squareX==-1) {
        return null;
      currentIndex=0;
      currentOffset=START_Y+THICK_WIDTH;
      searchY:
        for (int i = 0; i < SQUARES; i++) {
          for (int j = 0; j < SQUARES; j++) {
            if (pointY<currentOffset) {
              return null;   // on a black line
            if (pointY<currentOffset+SQUARE_SIZE) {
              squareY=currentIndex;
              break searchY;
            currentOffset+=THIN_WIDTH+SQUARE_SIZE;
            currentIndex++;
          currentOffset+=THICK_WIDTH-THIN_WIDTH;
        if (squareY==-1) {
          return null;
        } else {
          return new Int2(squareX,squareY);
  void selectSquare(Int2 squareNos) {
    int x=squareNos.getX();
    int y=squareNos.getY();
    if (x>=0 && x<BIGSQUARES && y>=0 && y<BIGSQUARES) {
      Square s=squareArray[x][y];
      s.setBackColour(SELECTED_BACK_COLOUR);
//      s.repaint();
  void deselectSquare(Int2 squareNos) {
    int x=squareNos.getX();
    int y=squareNos.getY();
    if (x>=0 && x<BIGSQUARES && y>=0 && y<BIGSQUARES) {
      Square s=squareArray[x][y];
      s.setBackColour(NORMAL_BACK_COLOUR);
//      s.repaint();
  class Square extends Component {
    // coordinates of upper left pixel
    private int xCoord;
    private int yCoord;
    private char[] value={' '};
    private Color textColour;
    private Color backColour;
    public Square(int x, int y, char valChar, Color tcol, Color bcol) {
      xCoord=x;
      yCoord=y;
      value[0]=valChar;
      textColour=tcol;
      backColour=bcol;
    public void paint(Graphics g) {
      Graphics2D g2=(Graphics2D) g;
      g2.setFont(squareFont);
      FontMetrics fm=g2.getFontMetrics();
      g2.setColor(backColour);
      g2.fillRect(xCoord,yCoord,Grid.SQUARE_SIZE,Grid.SQUARE_SIZE);
      g2.setColor(textColour);
      int charHeight=fm.getAscent();
      int charWidth=fm.charWidth('0');
      g2.drawString(new String(value),xCoord+Grid.SQUARE_SIZE/2-charWidth/2,
          yCoord+Grid.SQUARE_SIZE/2+charHeight/2);
    public Dimension getPreferredSize() {
      return new Dimension(Grid.SQUARE_SIZE,Grid.SQUARE_SIZE);
    public void setBackColour(Color backColour) {
      this.backColour = backColour;
      repaint();
    public void setTextColour(Color textColour) {
      this.textColour = textColour;
      repaint();
    public void setValue(char value) {
      this.value[0] = value;
      repaint();
* GraphPanel.java
* Created on 02 August 2006, 16:11
package com.ptoye.TestGraphics;
import java.awt.BorderLayout;
import java.awt.Point;
* @author  PToye
public class GraphPanel extends javax.swing.JPanel {
  private Grid p;
  private Int2 selectedSquare;
  /** Creates new form GraphPanel */
  public GraphPanel() {
    initComponents();
    p=new Grid();
    add(p,BorderLayout.CENTER);
    setPreferredSize(p.getPreferredSize());
    selectedSquare=null;
  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
  private void initComponents() {                         
    FormListener formListener = new FormListener();
    setLayout(new java.awt.BorderLayout());
    setPreferredSize(new java.awt.Dimension(500, 500));
    addMouseListener(formListener);
  // Code for dispatching events from components to event handlers.
  private class FormListener implements java.awt.event.MouseListener {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
      if (evt.getSource() == GraphPanel.this) {
        GraphPanel.this.formMouseClicked(evt);
    public void mouseEntered(java.awt.event.MouseEvent evt) {
    public void mouseExited(java.awt.event.MouseEvent evt) {
    public void mousePressed(java.awt.event.MouseEvent evt) {
    public void mouseReleased(java.awt.event.MouseEvent evt) {
  private void formMouseClicked(java.awt.event.MouseEvent evt) {                                 
    int mouseBtn=evt.getButton();
    Point mousePoint=evt.getPoint();
    if (mouseBtn==evt.BUTTON1) {
      Int2 s=p.pointToSquare(mousePoint);
      if (s!=null) {
        if (selectedSquare!=null) {
          System.out.println("Deselect "+selectedSquare.getX()+selectedSquare.getY());
          p.deselectSquare(selectedSquare);
        selectedSquare=s;
        System.out.println("Select "+selectedSquare.getX()+selectedSquare.getY());
        p.selectSquare(s);
//      p.repaint();
  // Variables declaration - do not modify                    
  // End of variables declaration                  
* Int2.java
* Created on 21 October 2006, 12:01
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package com.ptoye.TestGraphics;
* @author PToye
public class Int2 {
    private int x;
    private int y;
    Int2(int x, int y ) {
      this.x=x;
      this.y=y;
    public int getX() {
      return x;
    public int getY() {
      return y;
* TestGraphics.java
* Created on 01 August 2006, 22:13
package com.ptoye.TestGraphics;
import java.awt.BorderLayout;
import javax.swing.JPanel;
* @author  PToye
public class TestGraphics extends javax.swing.JFrame {
  private GraphPanel p;
  /** Creates new form TestGraphics */
  public TestGraphics() {
    initComponents();
    p=new GraphPanel();
    setContentPane(p);
    setSize(p.getPreferredSize());
    pack();
  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
  private void initComponents() {
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Testing graphics");
    jMenu1.setText("Menu");
    jMenuBar1.add(jMenu1);
    setJMenuBar(jMenuBar1);
    pack();
   * @param args the command line arguments
  public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
      public void run() {
        new TestGraphics().setVisible(true);
  // Variables declaration - do not modify
  private javax.swing.JMenu jMenu1;
  private javax.swing.JMenuBar jMenuBar1;
  // End of variables declaration
}

Here's a way to implement your gui in the two ways mentioned above:
GridG � graphics approach with limited redrawing for de/selections
GridC � component approach where the AWT does a lot of the work.
This second approach resizes okay.
Everything has been changed to Swing � lightweight components. One difficulty with
mixing lightweight and heavyweight components is that the heavyweight components are
rendered above/over/on top of the lightweight components. So, for example, the Grid class
extending Component is a heavyweight component and will be rendered over any JMenus and
JMenuItems that extend below the JMenuBar in the JMenu popupMenu during menu selections,
when you add them, of course. The Grid component will hide/obscure the JMenu lightweight
components.
The Int2 class remains unchanged. I did not use the GraphPanel class.
import java.awt.*;
import javax.swing.*;
public class TG extends JFrame {
    private GridG gridG;
    private GridC gridC;
    public TG() {
        setTitle("Testing graphics");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setJMenuBar(getMenus());
        gridG = new GridG();
        gridC = new GridC();
        JTabbedPane tabbedPane = new JTabbedPane();
        tabbedPane.addTab("graphics", gridG);
        tabbedPane.addTab("component", gridC);
        setContentPane(tabbedPane);
        pack();
        setLocation(200,50);
    private JMenuBar getMenus() {
        JMenu jMenu1 = new JMenu("Menu");
        JMenuBar menuBar = new JMenuBar();
        menuBar.add(jMenu1);
        return menuBar;
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TG().setVisible(true);
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GridG extends JPanel {
    private static final int THICK_WIDTH  =  4;
    private static final int THIN_WIDTH   =  2;
    private static final int DOTTED_WIDTH =  2;
    static         final int SQUARE_SIZE  = 60;
    private        final int START_X      =  0;
    private        final int START_Y      =  0;
    private static final int SQUARES      =  3;  //standard sudoku
    private static final int BIGSQUARES = SQUARES*SQUARES;
    private static final int TotalSize=
                 (SQUARES+1)*THICK_WIDTH+SQUARES*(SQUARES-1)*THIN_WIDTH+
                                    BIGSQUARES*SQUARE_SIZE;
    Square[][] squareArray = new Square[BIGSQUARES][BIGSQUARES];
    static Font squareFont = new Font("SansSerif",Font.BOLD,20);
    static final Color NORMAL_BACK_COLOUR   = Color.LIGHT_GRAY;
    static final Color SELECTED_BACK_COLOUR = Color.PINK;
    public GridG() {
        int currentXCoord=START_X;
        int currentYCoord=START_Y;
        currentXCoord=START_X+THICK_WIDTH;
        int currentXIndex=0;
        for (int BigX = 0; BigX < SQUARES; BigX++) {
            for (int LittleX = 0; LittleX < SQUARES; LittleX++) {
                currentYCoord=START_Y+THICK_WIDTH;
                int currentYIndex=0;
                for (int BigY = 0; BigY < SQUARES; BigY++) {
                    for (int LittleY = 0; LittleY < SQUARES; LittleY++) {
                        squareArray[currentXIndex][currentYIndex]=
                            new Square(currentXCoord,currentYCoord,'4',
                                       Color.RED, NORMAL_BACK_COLOUR);
                        currentYIndex+=1;
                        currentYCoord+=THIN_WIDTH+SQUARE_SIZE;
                    currentYCoord+=THICK_WIDTH-THIN_WIDTH;
                currentXIndex+=1;
                currentXCoord+=THIN_WIDTH+SQUARE_SIZE;
            currentXCoord+=THICK_WIDTH-THIN_WIDTH;
        addMouseListener(ml);
        setBackground(Color.BLACK);
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2=(Graphics2D) g;
        // paint the squares
        for (int BigX = 0; BigX < BIGSQUARES; BigX++) {
            for (int BigY = 0; BigY < BIGSQUARES; BigY++) {
                squareArray[BigX][BigY].draw(g);
    public Dimension getPreferredSize() {
        return new Dimension(TotalSize,TotalSize);
    /** This could easily become an outer class. */
    private class Square {
        // coordinates of upper left pixel
        private int xCoord;
        private int yCoord;
        private char[] value={' '};
        private Color textColour;
        private Color backColour;
        public Square(int x, int y, char valChar, Color tcol, Color bcol) {
            xCoord=x;
            yCoord=y;
            value[0]=valChar;
            textColour=tcol;
            backColour=bcol;
        public void draw(Graphics g) {
            Graphics2D g2=(Graphics2D) g;
            g2.setFont(squareFont);
            FontMetrics fm=g2.getFontMetrics();
            g2.setColor(backColour);
            g2.fillRect(xCoord,yCoord,Grid.SQUARE_SIZE,Grid.SQUARE_SIZE);
            g2.setColor(textColour);
            int charHeight=fm.getAscent();
            int charWidth=fm.charWidth('0');
            g2.drawString(new String(value),xCoord+Grid.SQUARE_SIZE/2-charWidth/2,
                                            yCoord+Grid.SQUARE_SIZE/2+charHeight/2);
        public void setBackColour(Color backColour) {
            this.backColour = backColour;
        public void setTextColour(Color textColour) {
            this.textColour = textColour;
        public void setValue(char value) {
            this.value[0] = value;
    /** Ths could become an outer class */
    private MouseListener ml = new MouseAdapter() {
        private Int2 selectedSquare;
        public void mousePressed(MouseEvent e) {
            Point mousePoint = e.getPoint();
            Int2 s = pointToSquare(mousePoint);
            if (s != null) {
                if (selectedSquare != null) {
                    System.out.println("Deselect " + selectedSquare.getX()
                                                   + selectedSquare.getY());
                    int x = selectedSquare.getX();
                    int y = selectedSquare.getY();
                    squareArray[x][y].setBackColour(NORMAL_BACK_COLOUR);
                    squareArray[x][y].draw(getGraphics());
                selectedSquare = s;
                System.out.println("Select " + selectedSquare.getX()
                                             + selectedSquare.getY());
                int x = s.getX();
                int y = s.getY();
                squareArray[x][y].setBackColour(SELECTED_BACK_COLOUR);
                squareArray[x][y].draw(getGraphics());
        private Int2 pointToSquare(Point p) {
            double pointX=p.getX();
            double pointY=p.getY();
            int squareX=-1;
            int squareY=-1;
            int currentIndex=0;
            int currentOffset=START_X+THICK_WIDTH;
            searchX:
                for (int i = 0; i < SQUARES; i++) {
                    for (int j = 0; j < SQUARES; j++) {
                        if (pointX<currentOffset) {
                            return null;   // on a black line
                        if (pointX < currentOffset+SQUARE_SIZE) {
                            squareX=currentIndex;
                            break searchX;
                        currentOffset+=THIN_WIDTH+SQUARE_SIZE;
                        currentIndex++;
                    currentOffset+=THICK_WIDTH-THIN_WIDTH;
            if (squareX==-1) {
                return null;
            currentIndex=0;
            currentOffset=START_Y+THICK_WIDTH;
            searchY:
                for (int i = 0; i < SQUARES; i++) {
                    for (int j = 0; j < SQUARES; j++) {
                        if (pointY<currentOffset) {
                            return null;   // on a black line
                        if (pointY < currentOffset+SQUARE_SIZE) {
                            squareY=currentIndex;
                            break searchY;
                        currentOffset += THIN_WIDTH+SQUARE_SIZE;
                        currentIndex++;
                    currentOffset += THICK_WIDTH-THIN_WIDTH;
            if (squareY==-1) {
                return null;
            } else {
                return new Int2(squareX,squareY);
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GridC extends JPanel {
    private static final int THICK_WIDTH  =  4;
    private static final int THIN_WIDTH   =  2;
    static         final int SQUARE_SIZE  = 60;
    private static final int SQUARES      =  3;  //standard sudoku
    private static final int BIGSQUARES = SQUARES*SQUARES;
    private static final int TotalSize  =
                 (SQUARES+1)*THICK_WIDTH+SQUARES*(SQUARES-1)*THIN_WIDTH+
                         BIGSQUARES*SQUARE_SIZE;
    Square[][] squareArray = new Square[BIGSQUARES][BIGSQUARES] ;
    static Font squareFont = new Font("SansSerif",Font.BOLD,20);
    static final Color NORMAL_BACK_COLOUR   = Color.LIGHT_GRAY;
    static final Color SELECTED_BACK_COLOUR = Color.PINK;
    public GridC() {
        setBackground(Color.black);
        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints gbc = new GridBagConstraints();
        int[] gws = { 1, GridBagConstraints.RELATIVE, GridBagConstraints.REMAINDER };
        setLayout(gridbag);
        for (int j = 0; j < BIGSQUARES; j++) {
            JPanel cell = new JPanel(gridbag);
            cell.setBackground(Color.black);
            gbc.insets = new Insets(1,1,1,1);
            for (int k = 0; k < BIGSQUARES; k++) {
                int val = j*BIGSQUARES + k + 1;
                squareArray[j][k]= new Square(val, Color.RED, NORMAL_BACK_COLOUR);
                squareArray[j][k].addMouseListener(ml);
                gbc.gridwidth = gws[k % gws.length];
                cell.add(squareArray[j][k], gbc);
            gbc.insets = new Insets(0,0,0,0);
            if(j/3 < 2)       gbc.insets.bottom = 2;
            if((j+1) % 3 > 0) gbc.insets.right = 2;
            gbc.gridwidth = gws[j % gws.length];
            add(cell, gbc);
    public Dimension getPreferredSize() {
        return new Dimension(TotalSize, TotalSize);
    private class Square extends JPanel {
        String value;
        private Color textColour;
        private Color backColour;
        public Square(int val, Color tcol, Color bcol) {
            value = String.valueOf(val);
            textColour=tcol;
            backColour=bcol;
        protected void paintComponent(Graphics g) {
            Graphics2D g2=(Graphics2D) g;
            g2.setFont(squareFont);
            FontMetrics fm=g2.getFontMetrics();
            g2.setColor(backColour);
            g2.fillRect(0,0,Grid.SQUARE_SIZE,Grid.SQUARE_SIZE);
            g2.setColor(textColour);
            int charHeight=fm.getAscent();
            int charWidth=fm.stringWidth(value);
            g2.drawString(value, Grid.SQUARE_SIZE/2-charWidth/2,
                                 Grid.SQUARE_SIZE/2+charHeight/2);
        public Dimension getPreferredSize() {
            return new Dimension(Grid.SQUARE_SIZE,Grid.SQUARE_SIZE);
        public void setBackColour(Color backColour) {
            this.backColour = backColour;
            repaint();
        public void setTextColour(Color textColour) {
            this.textColour = textColour;
            repaint();
        public void setValue(int value) {
            this.value = String.valueOf(value);
            repaint();
    private MouseListener ml = new MouseAdapter() {
        private Square selectedSquare;
        public void mousePressed(MouseEvent e) {
            Square square = (Square)e.getSource();
            if (selectedSquare != null)
                selectedSquare.setBackColour(NORMAL_BACK_COLOUR);
            square.setBackColour(SELECTED_BACK_COLOUR);
            selectedSquare = square;
}

Similar Messages

  • Wacom Tablet doesn't seem to work all of the time?

    I have a Wacom Intuos 3 tablet, not more than a year old. I recently installed it onto my Macbook Pro and it worked fine, but when I unplugged it and came back to work with it later, it doesn't seem to work. The mouse doesn't respond to where I click on the pad.
    So, I've reinstalled this a couple of times and was able to make it work perfectly, but today when I went back to work in photoshop, it doesn't seem to be responding again.
    Does anyone have any tips? I know that Leopard likes you to eject USB devices instead of just pulling them out of the slot, but I don't see anywhere to eject it.
    Does anyone know what's up?

    Downloaded a driver from website, tablet works now.

  • Safari on my iPhone 6 running 8.02 doesn't seem to work right. Some Java scripts don't show correctly and they do on other browsers I have downloaded. I tried almost everything and nothing seems to work to fix it. Please help.

    Some websites like the one of my college uses JavaScripts and they seem to load correctly to a certain point but then not really. For example in one it would say select an option from the left menu. And I do it hut nothing happens. But when I go to the same website in another browser on my phone. The JavaScript works completely and allows me to see whatever I was clickig on that menu. I have seen that there are other websites being affected too. I tried clearing my cookies and data. even restarted my phone. And doesn't seem to work. I don't know how change the configuration any more to make it work like normal. At first I thought it was my school's website but it never got fixed. And now I realized is my safari browser! I wanna keep using it since I am really familiar with It. If someone knows how to fix this please let me know!
    Thanks

    You can reset the SMC and see if that helps. If it's a unibody or Retina, follow the method for "a battery you should not remove yourself."
    http://support.apple.com/kb/ht3964

  • I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?

    I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?    

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • I'm travelling and trying to back up my new iPhone to iCloud. I have sufficient storage, am connected to wifi and it's plugged into a power source and yet it doesn't seem to work. Can anyone suggest what I'm doing wrong?

    I'm travelling and trying to back up my new iPhone to iCloud. I have sufficient storage, am connected to wifi and it's plugged into a power source and yet it doesn't seem to work at all. I'm currently in India. Could that be the cause or can anyone suggest any reason why this wouldn't work?

    "gets stuck" - are there any error messages?
    If you get the error "Backup not successful" and you've tried deleting the last backup and trying to back up manually without luck, try the following test:   Go to...
    Settings>iCloud>Storage & Backup>manage Storage, tap your device name in the Backups section, then look under Backup options.  Turn off all apps from backup and then do a manual backup.  If that doesn't work, then this post will not help.  If the backup works, then go back to the app list and turn some on and try another backup.  If successful, keep repeating these steps.  If it fails at some point, then try to zero in on the one app that seems to make the backup fail.  (I had this problem and found one app failing, probably due to a corrupt data file.)
    This process will take time, but if a backup works with no app data being used but clearly fails with the original settings, then somewhere in the mix of apps is a "bad" one.

  • Pdfmark code in MS Word 2008 doc doesn't seem to work properly to create Named Destination

    Hi all,
    I've been having trouble with creating Preview-compatible Named Destinations in Acrobat 9.x (see http://forums.adobe.com/thread/770470?tstart=0).  Distiller, on the other hand, appears to create compatible Destinations, so as a last-ditch effort, I tried to go back to my original source file (Microsoft Word 2008 document) to use Distiller's pdfmark functionality, to see if maybe I could finally get a PDF with Preview-compatible Destinations.
    Following instructions found elsewhere on this forum, I went into Word and inserted the following field into a test location in my document:
    PRINT "[ /Dest /testdest /View [ /XYZ null null null ] /DEST pdfmark"
    This field code is supposed to then cause a pdfmark to be inserted into the resulting PostScript and/or PDF files.  Distiller is supposed to understand this and turn it into a Named Destination called "testdest."  However, it doesn't seem to work - I don't see the pdfmark code in the PS file, and the PDF file doesn't have any Named Destinations in it.
    I'm using Acrobat 9.x on Mac OS X 10.6.5, so I tried this two different ways:
    1) Using the "Print to Adobe PDF" workflow (which replaced the "Adobe PDF Printer" from previous OS/Acrobat versions) - this automatically generates a PDF via (presumably) an API call to Distiller... and
    2) Using the "Print to Postscript" workflow to generate a PS file, which I then ran through Adobe Distiller.
    In neither case did I end up with a named destination in the PDF file, as I was supposed to.  In case #2, even the Postscript file didn't have a pdfmark embedded in it.  Thus, I'm assuming that perhaps this is particular issue may be a problem with MS Word 2008 rather than with Acrobat... but I'm hoping someone might have a clue as to how to fix it.
    I welcome ideas on how to get Word 2008 to properly output pdfmark code, so that Distiller will pick it up and properly embed a Named Destination into the PDF...
    Thanks in advance.
    (If anyone has ideas about the Preview-compatible problem, linked above, that would also be great!)

    You're suggesting that it was never fixed from Word 2004 to 2008?  Possibly.  I wonder if it's fixed in Word 2011?  Anyone know?  But is it really a Word problem, rather than a Distiller issue?
    I appreciate your offer, though I do have access to Word on Windows (2003, I think), so I could try Distilling there... I only worry about formatting, since there are minor differences (e.g. font kerning, etc.) between Mac and Windows that are subtle, but sufficient to create formatting issues for very long documents (e.g. pushing figures onto the wrong pages, etc.).  That would be a rather big problem.
    The question remains whether this is an issue with Word or Distiller, though... and whether it's fixed in Distiller X and/or Word 2011.
    Adobe, care to comment?
    I'd really love to find a proper Mac solution, if one exists... it would be rather a slap to Mac users if a solution doesn't exist.

  • Hi I'm running Addressbook and cannot clear previous entry easily when searching my data base of around 5,000 contacts.    I prefer to view in All contacts on a double page spread with details on the right page.  Searching doesn't seem to work correctly i

    Hi I'm running Addressbook and cannot clear previous entry easily when searching my data base of around 5,000 contacts. 
    I prefer to view in All contacts on a double page spread with details on the right page.  Searching doesn't seem to work correctly in this view.
    It's always the second search that is problematic.
    I've tried typing over and all it seems to do is confine the search to the the entries that have come up for the previous search.
    I've tried to use the x to clear the previous entry and then type the next search, same problem.  The only way seems to be to move from "All Contacts" to "Groups".  Then the searched name appears and I can return to All Contacts to see full details.
    Surely three key press' are not the way it's supposed to work?
    FYI
    Processor  2.7 GHz Intel Core i7
    Memory  8 GB 1333 MHz DDR3
    Graphics  Intel HD Graphics 3000 512 MB
    Software  Mac OS X Lion 10.7.3 (11D50d)
    Address book Version 6.1 (1083)
    MacBook Pro, Mac OS X (10.7.1), 8Mb RAM 2.7Ghz i7

    AddressBook experts are here:
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.7_lion#/?tagSet=1386

  • I have Adobe Design Standard CS6 purchased 2013 with serial number but cannot find to download it onto a new mac laptop. When I try and add the 24-digit serial number to my account it doesn't seem to work?

    I have Adobe Design Standard CS6 purchased 2013 with serial number but cannot find to download it onto a new mac laptop. When I try and add the 24-digit serial number to my account it doesn't seem to work?

    CS6 - http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html
    You can also download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS6: http://prodesigntools.com/adobe-cs6-direct-download-links.html

  • TS5183 My Iphone has a problem with the microphone it doesn't seem to work! so there for i can't use Siri anymore..:-( this has been playing up for some time now.

    My Iphone has a problem with the microphone it doesn't seem to work! so there for i can't use Siri anymore.. this has been playing up for some time now. But as my wife & I had a baby 7 Months ago I have not found the time to pop in to the apple store until today (8/12/13) and they told me that they couldn't help as it's out of it's warranty by 57 days
    Can antone help me? is there something i can do, apart from buying a new iphone!

    Have you got Siri turned on in settings/general/restrictions?

  • My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    Thank you both for your responses but my daughter was reassured by the salesman in the iStyle store (official Apple store in the UAE) that iMessages would work but conceded that FaceTime wouldn't. My iTunes account is registered in the uk and my daughter's iPhone has iMessages even though she bought it (and uses it) in Dubai. Can anyone else throw any light on this?

  • Can a use a partitioned external hard drive to create a disk image? I tried, doesn't seem to work using disk manager.

    Can a use a partitioned external hard drive to create a disk image? I tried, doesn't seem to work using disk manager.

    OK, it's very bad computing to use a backup disk for anything but a backup. The reason being is if/when the HD crashes you will have lost not only all your backup but the data files. While I commend you for wanting redundant backup, you really need separate EHDs for doing so. Format each EHD using Disk Utility to Mac OS Extended (Journaled) using the GUID parttition. When you connect, OS X will ask if you want to use that drive as a Time Machine backup drive, select yes and then let it backup. On the second EHD format the same way however do not use TM as a backup, this time I'd suggest an app such as SuperDuper or Carbon Copy Cloner to make a clone of the internal HD. Leave both EHDs connected and TM will backup new or changed files automatically on a hourly basis. The clone you will need to set to backup on the schedule you want. For example I have my SuperDuper EHD set to backup only changed or updated files at 2AM every day.
    The advantage of a clone is that if the computers internal HD crashes you can boot from a clone and continue working, TM will not do that but it's great for keeping an archive of all files. So if you want a version of a file from many months ago, TM will help you locate and restore it.

  • I used to be able to download files from the Harddrive of my Sony Handycam, but now it won't let me import them while going through "log and transfer."  I have tried to update my settings, but this doesn't seem to work.  Any help would be much appreciated

    I used to be able to download files from the Harddrive of my Sony Handycam, but now it won't let me import them while going through "log and transfer."  I have tried to update my settings, but this doesn't seem to work.  Any help would be much appreciated

    Hard Drive:  The Hard Drive is on my camera (Sony Handycam)
    Just needed some info on what is going on with your particular system.
    Knowing the exact camera model will also assist us.
    If this camera is standard AVCHD you should be able to connect with USB to Mac with FCE open and use Log and Transfer without all the fiddling around converting etc.
    What FCE does during ingest is convert files to AIC. (Apple Intermediate Codec)
    FCE cannot read the individual files in the BDMV folder, that's why all the converting is required when you use that method.
    BTW: regards formatting drives/cards/memory on cameras; it is wise to use the actual device to format rather than a computer. This is a prime cause of read/write goof ups with solid state media. This applies to still or video cameras.
    Keeping the COMPLETE card/memory structure in tact is vital for successful transfers.
    Try here for some trouble shooting tips:
    https://discussions.apple.com/message/12682263#12682263
    Al

  • I want pictures from each device in the cloud, but not on every other device. Possible? "iCloud Backup" alone doesn't seem to work....

    My goal is to acheive 3 of the following things.:
    Have all my apple devices sync pictures to the icloud *without* syncing the pictures on all the devices...so just one direction from device to cloud and not have all the devices insync from the cloud...... I don't want all the devices in sync, I just want the pictures protected in the cloud. To do this, I've tried to just turn on "icloud bacn-up" and not turn on "photo stream" to acheive this, but doesn't seem to work.
    If #1 is possible, then I would like to sync the icloud with a folder on my PC using the icloud app for the PC. Not sure if I can have only the icloud PC sync and not have all the devices in sync?
    If #1 and #2 could work, then I would sync the PC folder with my local storge.
    end result would be all my photos save in the cloud and a safe copy my home in my local storage. I would have thought that most people would want to do this, but doens't seem so obvious to me as to how I can get it to work?
    Any help would be appreicated.
    thanks

    You can't use iCloud as a safe place to store your photos when they are deleted from your devices.  iCloud designed to stream photos to your devices, and to back up photos currently on your your devices as part of your iCloud backups.  However, photo stream photos only remain in iCloud for 30 days, giving your devices enough time to download them.  And if you delete a photo stream photo from any of your devices, it is also deleted from iCloud and from all of your devices.  Furthermore, while camera roll photos are included in your backup, if you then delete the photos from your device and continue backing up, the backup containing the deleted photos will be overwritten by one that doesn't, and they will be lost.
    If you want to save your photos, import them from the camera roll to your computer as explained here: http://support.apple.com/kb/HT4083.  Then you can delete them from your device.
    If you would rather have a cloud-based place to store your photos, look into a service such as Dropbox.

  • How to reflect db changes - Verify Database doesn't seem to work

    I have changed a database (MS SQL Server) column from varchar 255 to varchar 1000, but the designer doesn't pick up the change.
    I read that db changes can be picked up by using 'Verify Database' feature. It doesn't seem to work for us though. Is there any configuration to turn on for the feature to work properly or any work-around to refresh the database changes?
    We are making the database connection using JDBC (JNDI) option since the report is being used in a Java web application.
    Any comments or insights will be very much appreciated!

    Hi Wallie,
    Thank you very much for your reply! Here are the answers to your questions.
    Are you able to create a new report off the modified database?
    ==> Yes.
    Do new reports see the changes made to the database?
    ==> No.
    Are the reports connecting directly to the database table, or is it a stored procedure, business view, universe being used?
    ==> Through a business view.
    By the way, after trying so many things, I was able to figure out the reason. Since the report is using a view, not directly the table, the view itself had to be recompiled to reflect the table changes so that the view could pass the changes to the report. It was a very good thing to know. Your last question could have been a very helpful insight for this issue! Thank you so much again!

  • Oraenv doesn't seem to work

    Version : 11.2.0.3
    Platform : Oracle Linux 6.3
    oraenv doesn't seem to work as shown below. I haven't set ORACLE_SID in the .bash_profile as this server is going to have multiple DBs in future. So, I need to use oraenv script to set env variables.
    Trying to source oraenv file.
    $ . oraenv
    ORACLE_SID = [oracle] ?
    Ideally, it should prompt the SID listed in /etc/oratab file. So, in this case it should be something like
    $ . oraenv
    ORACLE_SID = [oracle] ? GRCFMS
    Here are the contents of my /etc/oratab file and .bash_profile
    # su - oracle
    $
    $
    $
    $
    $
    $
    $ whoami
    oracle
    $ pwd
    /home/oracle
    $ cat .bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi
    # User specific environment and startup programs
    #PATH=$PATH:$HOME/bin
    #export PATH
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1
    #export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/bin
    $
    My oratab file
    $ cat /etc/oratab
    # This file is used by ORACLE utilities.  It is created by root.sh
    # and updated by either Database Configuration Assistant while creating
    # a database or ASM Configuration Assistant while creating ASM instance.
    # A colon, ':', is used as the field terminator.  A new line terminates
    # the entry.  Lines beginning with a pound sign, '#', are comments.
    # Entries are of the form:
    #   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
    # The first and second fields are the system identifier and home
    # directory of the database respectively.  The third filed indicates
    # to the dbstart utility that the database should , "Y", or should not,
    # "N", be brought up at system boot time.
    # Multiple entries with the same $ORACLE_SID are not allowed.
    GRCFMS:/u01/app/oracle/product/11.2.0.3/dbhome_1:N
    $
    $
    $

    Max wrote:
    Version : 11.2.0.3
    Platform : Oracle Linux 6.3
    oraenv doesn't seem to work as shown below. I haven't set ORACLE_SID in the .bash_profile as this server is going to have multiple DBs in future. So, I need to use oraenv script to set env variables.
    Trying to source oraenv file.
    $ . oraenv
    ORACLE_SID = [oracle] ?
    Ideally, it should prompt the SID listed in /etc/oratab file. So, in this case it should be something like
    $ . oraenv
    ORACLE_SID = [oracle] ? GRCFMS
    Here are the contents of my /etc/oratab file and .bash_profile
    # su - oracle
    $
    $
    $
    $
    $
    $
    $ whoami
    oracle
    $ pwd
    /home/oracle
    $ cat .bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi
    # User specific environment and startup programs
    #PATH=$PATH:$HOME/bin
    #export PATH
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1
    #export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/bin
    $
    My oratab file
    $ cat /etc/oratab
    # This file is used by ORACLE utilities.  It is created by root.sh
    # and updated by either Database Configuration Assistant while creating
    # a database or ASM Configuration Assistant while creating ASM instance.
    # A colon, ':', is used as the field terminator.  A new line terminates
    # the entry.  Lines beginning with a pound sign, '#', are comments.
    # Entries are of the form:
    #   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
    # The first and second fields are the system identifier and home
    # directory of the database respectively.  The third filed indicates
    # to the dbstart utility that the database should , "Y", or should not,
    # "N", be brought up at system boot time.
    # Multiple entries with the same $ORACLE_SID are not allowed.
    GRCFMS:/u01/app/oracle/product/11.2.0.3/dbhome_1:N
    $
    $
    $
    if in fact you did exactly as posted above, the su - oracle established a new process which knows nothing about the previous invocation of oraenv
    BTW - never use OS "root" when dealing with Oracle DB

Maybe you are looking for

  • How to convert a scalar variable into a 1-D length N array?

    Hi guys, I am new in Labview. I use Labview to accquire the output data from a measurement circuit with RS232 bus. The result needs some mathematical operation to have a meaningful number. After this operation the result is a scalar variable that is

  • Creating a script to purge particular cursor in shared pool

    hi Guys, not good in scripting need help SQL> select * from v$version; BANNER Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production PL/SQL Release 11.1.0.7.0 - Production CORE 11.1.0.7.0 Production TNS for Solaris: Version 11.1

  • InfoProviders versus Queries Data Source for BO SAP Integration

    Hi All, I would like to know if there is any discussion or suggestion on commonly used choice of data source for BO with SAP Integration. I do know there is a best practices suggestion from Ingo on Webi and the choice is to use queries so that we cou

  • Frm-40039

    frm-40039: canot attach library webutil while opening form WEBUTIL_DOC

  • Java Heap Space with aRFC Call

    Hi, I got an issue here. My scenario is : RFC --> PI --> SOAP PI Version : 7.0 I want to send my material catalog to PI. I have broadly 66 000 Materials. When I send it via RFC call here is my error (SM58 into the SAP HR system): Java heap space When