Help: Problem With Seperate Arrays Overwriting Each Other!

Hi,
I have this function that randomly allocates free time to coursework blocks. This method works because I have tested numerous times and it always prints of different allocations of time every time its called.
The problem that I have is that I have this method that called this method twice to store each different call within a separate ArrayList.
When I make the first call the block are assigned to the array fine. But when I called it a second time to store the next result within a separate Array the first Array result are overwritten . Any body have any idea why this is happening, I have asked numerous friends and even my supervisor and he can't find anything wrong with it. Any help would be very helpful...
Code:
public ArrayList<CourseworkTimeBlock> courseworkAllocation(ArrayList timetable, ArrayList<CourseworkTimeBlock> cCourseworkBlocks){
          // Calculates and stores the free "time blocks" that can be used
          // to allocate coursework.
          ArrayList<Integer> freeTimeBlocks = new ArrayList<Integer>();
          freeTimeBlocks = freeBlocks(timetable);
          Random random = new Random();
          ArrayList<CourseworkTimeBlock> courseworkTimeBlocks = new ArrayList<CourseworkTimeBlock>();
          for(int i = 0; i < cCourseworkBlocks.size(); i++){
               int allocateTo = -100;
               int randomPoint = 0;
               CourseworkTimeBlock courseworkBlock;
               courseworkBlock = cCourseworkBlocks.get(i);
               while(allocateTo < 0){
                    randomPoint = random.nextInt(freeTimeBlocks.size());
                    allocateTo = freeTimeBlocks.get(randomPoint);
               courseworkBlock.setBlockAllocated(allocateTo);
               courseworkTimeBlocks.add(courseworkBlock);
               freeTimeBlocks.set(randomPoint, -1 );
          for( int i = 0; i < courseworkTimeBlocks.size(); i++){
               System.out.println("CW: " + courseworkTimeBlocks.get(i).getBlockAllocated());
          return courseworkTimeBlocks;
     }These are the calls I make in a separate method:
ArrayList<CourseworkTimeBlock> courseworkTimetableOne = new ArrayList<CourseworkTimeBlock>();
ArrayList<CourseworkTimeBlock> courseworkTimetableTwo = new ArrayList<CourseworkTimeBlock>();
         courseworkTimetableOne = courseworkAllocation(fixedTimetable, courseworkBlocks);
         courseworkTimetableTwo = courseworkAllocation(fixedTimetable, courseworkBlocks);Edited by: ChrisUK on Mar 1, 2008 9:11 AM

ChrisUK wrote:
Thanks for the reply.
In terms of the:
courseworkTimetableOne = courseworkAllocation(fixedTimetable, courseworkBlocks);
courseworkTimetableTwo = courseworkAllocation(fixedTimetable, courseworkBlocks);They are both supposed to pass in the fixedTimetable object, the reason being is that this is a timetable and is passed through in order to find it "free time" blocks.
The courseworkTimetableOne and courseworkTimetableTwo are just different representations of how the coursework time blocks could be allocated to that given fixedtimetable. You're calling the same method with the same parameters, so both references are going to point to the same object. It's the same as if you just replaced the second line with courseworkTimetableTwo = courseworkTimetableOne.
You've got two references pointing to the same object.
The fact that you do this first:
ArrayList<CourseworkTimeBlock> courseworkTimetableOne = new ArrayList<CourseworkTimeBlock>();
ArrayList<CourseworkTimeBlock> courseworkTimetableTwo = new ArrayList<CourseworkTimeBlock>();means nothing. You create the two new ArrayLists, but then this
courseworkTimetableOne = courseworkAllocation(fixedTimetable, courseworkBlocks);
courseworkTimetableTwo = courseworkAllocation(fixedTimetable, courseworkBlocks);gets rid of them. The new ArrayLists you just created are lost.
Remember when you assign to a reference variable such as courseworkTimetableOne =, all that does is copy a reference so now courseworkTimetableOne is pointing to the same object that whatever is on the RHS is pointing to.
If you want two different lists, then either courseworkAllocation should make a copy of its internal list and return that, or else the caller should do it.
>
By the way what does "SSCCE" mean?[http://mindprod.com/jgloss/sscce.html|http://mindprod.com/jgloss/sscce.html]
[http://homepage1.nifty.com/algafield/sscce.html|http://homepage1.nifty.com/algafield/sscce.html]

Similar Messages

  • The problem with the strings Convert each other

    Hello all,
      Could you help me to solve the following problem using LV7.1? Thank in advance.
      How can I convert a string of "hexadecimal value" with Normal display style to other string of " the same hexadecimal value" with Hex display style?
    Best regards,
    Evan_Lv  

    Hi Evan,
    look at the attachment
    At the moment there is no error checking (any characters other than (0-9|A-F|a-f) will give an error; only even number of chars is converted). You can do the error checking as an exercise on your own!
    Message Edited by GerdW on 08-21-2007 09:08 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    HexString.vi ‏22 KB

  • Having problems with text, lines overlap each other

    Good Afternoon, I am having problems in pages, address book, text Edit. In pages and text edit the lines overlap each other and in address book I cannot read clearly the information of my contact because line also overlap. Does anyone knows how can I arrange this?
    Thank you very much,
    Melissa

    THANK YOU SO MUCH stussaar!
    My Mother did what you said for the Spam and my number was in there about 100 times. She deleted all them. Deleted me as a contact and then rebooted, then she text me and I text her back and I went right into the Spam again. I told her to tell TMobile this so then can maybe help and remove my number from Spam on their end.\
    Thanks you so much! you got us 99.999 % the way there!!
    I appreciate your help!!!!  I hope this worked also for your problem!!
    Thanks again!!!
    Mike

  • HT201210 Hey,I've got a problem on my iPad mini for a few days now?My iPad is in recovery mode at the moment and I Cannot restore my Ipad with iTunes...Can anyone help me with the solution?Each of your helps will be appreciate

    Hey,I've got a problem on my iPad mini for a few days now?My iPad is in recovery mode at the moment and I Cannot restore my Ipad with iTunes...Can anyone help me with the solution?Each of your helps will be appreciate...Thanks for all the helps...

    Follow step 1 to 6 closely to recover your iPad.
    http://support.apple.com/kb/HT1808
    Note: You may have to repeat the above a few times

  • Problem with an array (Array index out of bounds)

    Hey guys, i have a problem with an array, i just want to print a few things but it won't let me because of this error, here's my code
         public static void MosDat()
              int i;
              for(i=0 ; i<n ; i++);
                   Client [ i ].print1();
                   Client [ i ].print2();
              return;
         }//MosDat
    where "n" is a global variable, and client is .
    I pretty much know how it woks, so i tried it like this and gave "n" the value of "1":
    public static void MosDat()
              int i;
              for(i=0 ; i<n ; i++);
                   Client [ 0 ].print1();
                   Client [ 0 ].print2();
              return;
         }//MosDat
    the printing methods i created worked prefectly when i tried it like that... so i really don't know where the problem could be... thanks anyone who can help me.

    for(i=0 ; i < n ; i++);I spy with my little eye,
    one semicolon too many.Well-spotted. ;-)Practicing on those weird question marks is my secret training.

  • Premiere Pro CS5: please help problem with importing a file error output "there was an error decompressing audio or video"

    please help problem with importing a file error output "there was an error decompressing audio or video"

    this is related to what adobe program/version?

  • HT3406 If I choose "restore from iTunes backup" to move everything from old phone.  Will I still be able to use the old phone for music and apps?  Can the old phone be docked up to the computer?  Or will the new and old phone overwrite each other in some

    If I choose "restore from iTunes backup" to move everything from old iphone to a new one, will I still be able to use the old phone for music and apps?  Can the old phone be docked up to that same computer every now and then?  Or will the new and old phone overwrite each other in some way?  In other words, are the two phones treated as different devices when the "restore" option is used to set up the new phone?   Thanks in advance.

    Yes, you can use the old iPhone as an iPod touch.
    Read this:
    http://support.apple.com/kb/HT3406

  • Hello , I have a shot with two lips kissing each other , how can I keep

    Hello , I have a shot with two lips kissing each other , how can I keep the lips red and turn the rest of the face into black ? I tried shaping but the result was negative because the shape was moving all teh time , I tried color correction but the face and lips`s color was similar so I couldn`t do it with that , is there any other way ? Thanks so much

    You're gonna have fun with this because the HSL qualifiers probably won't see much separation between the areas that you want to isolate. You could try combinations of turning off Hue, Saturation, or Luminance. See what you get.
    Otherwise you're into a roto. (Manually tracked and animated User Shape)
    jPo
    Message was edited by: JP Owens

  • Why I had no problems with the VZW employees and other people have?

    I think that most people who cannot resolve problems with the VZW have an attitude problem.
    Wise saying:  you can get more with honey than with vinegar.
    Since I “upgraded” my old Samsung Sway to a new Samsung Intensity III, in the past three weeks I spent many hours dealing with the VZW store employees, customer service reps, and tech support people. The phone was replaced two times, and I had no problem getting the replacements.
    The third phone did not working how I expected.
    Today I called VZW customer service and said I don’t need anymore trouble shooting and I wanted find a resolution, which will be satisfactory to both of us. After a short conversation with a customer service rep, I was connected with a tech support. I told him that I don’t need any more trouble shooting on the Samsung Intensity III because I already spent HOURS doing that on three devices.
    We spoke about what the VZW could offer me, about replacements with different phones, etc. Our conversation ended with me offering the resolution that could satisfy me, which was to keep this phone and my account will be credited for the $30.00 “upgrade” fee and I will buy Samsung Sway on eBay. NO PROBLEM. 
    My account was credited and I was advise about the ESN number and activation.
    Why I had no problems with the VZW employees and other people have? The answer is simple. I did not have attitude when I was spoke to them.
    So if you want the problem to be resolved, put your anger in you pocket before you start the conversation. You can say that you are angry, frustrated, etc like I did, but add that you understand that this is not their fault that the manufactures makes a crap phones.

    Yes, you are right. I lost my upgrade. Also, it’s true that I could buy the phone on eBay… if I knew then what I know now. In the past, I never had problem with any of my phones. Doing an upgrade with the VZW was a normal thing for me. I didn’t expect that Samsung Intensity III would be a junk phone.  My last upgrade was 4 years ago. I had $50.00 ‘new every two’ credit on my account, which was used for an upgrade.  I lost the $50.00 credit paying for Samsung Intensity III. Sometimes we learn from our mistakes or from a bad experience. Three weeks ago I did not know that I could buy a phone on eBay and activate with VZW without paying $30.00.
    Samsung Sway is coming from …eBay – keep your fingers crossed for me.

  • Problem with an array

    i have problem with my program i implement saveing method
    but when i open file( game.txt) it does not update my board it return same postion every time i same game
    chess class Jframe(Jfilechooser)(call an board array)---->
    Gui Japplet class( call and board array------------>
    Board(class Jpanel have board array)
    it does not update borad array
    it just call it once in start and return the same value every time
    classChess(){
    ChessPlayer  java = new ChessPlayer();
    public  void saveData()
        File file = null;
       JFileChooser fc = new JFileChooser();
       fc.setCurrentDirectory(new File("."));
        fc.setDialogTitle("Save Text As...");
       int returnVal = fc.showSaveDialog(this);
       if (returnVal == JFileChooser.APPROVE_OPTION)
       { file = fc.getSelectedFile();
         try
         { PrintWriter out =
          new PrintWriter(
         new BufferedWriter(
           new FileWriter(file)));
         //while for all the moves in the array>
    for (int i=0;i<120;i++)
         out.println( java.saveDAta(i));
         out.println("\n");
         out.close();
         catch (IOException e) {
              // Some error has occured while trying to read the file.
                // Show an error message.
             JOptionPane.showMessageDialog(this,
                   "Sorry, some error occurred:\n" + e.getMessage());}
    public static void main(String[] args) {
    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
         JFrame frame = new ChessMan();
         Container content = frame.getContentPane();
         ChessMan f = new ChessMan();
              //japplet
         ChessPlayer  javaAppletication = new ChessPlayer();
            javaAppletication.init();
            javaAppletication.start();
       }Gui
    [Gui]
    class Gui{
    int [] board = new int [120];
         int [] boardcolor = new int [120];     
    Board check = new Board(this,false);
    {public void init()
         {        // Create new Border
         contentPane = getContentPane();
         bboard = new Board(this,false);
    public String saveDAta(int i)
    String l=check. save(i);
    return (l);
    and finally board Jpanel
    class Board extends JPanel
    {public Board (JApplet useapplet,boolean bool) {
       setup();
    { public String  save(int i)
         {  String l;
                   if (color==1)
                 {System.out.println("notpossible");}
               l =  board[i]+"$"+boardColor;
    return l;
    thanks guys

    My Jframe
    public class ChessMan extends JFrame implements ActionListener, WindowListener  {
    JMenuItem saveItem, loadItem, copyItem, pasteItem; 
    JMenu fileMenu, editMenu; 
    JMenuBar bar;
    ChessPlayer  java = new ChessPlayer();
    public ChessMan()  { setTitle("CHESS PLAYER GAME" );
    setSize(200,300);
    System.out.println("\n");      }
    addWindowListener(new java.awt.event.WindowAdapter()
         {      public void windowClosing(java.awt.event.WindowEvent e)
         {        System.exit(0);      }    });
    JMenu fileMenu = new JMenu("File");
    saveItem = new JMenuItem("Save");
    saveItem.setActionCommand("save");
    saveItem.setAccelerator( KeyStroke.getKeyStroke("ctrl S"));
    saveItem.addActionListener(this);
    fileMenu.add(saveItem);
    loadItem = new JMenuItem("Load");
    loadItem.setActionCommand("load");
    loadItem.setAccelerator( KeyStroke.getKeyStroke("ctrl L"));
    loadItem.addActionListener(this);
    fileMenu.add(loadItem);
    JMenu editMenu = new JMenu("About");
    copyItem = new JMenuItem("Help");
    copyItem.setActionCommand("Help");
    copyItem.setAccelerator( KeyStroke.getKeyStroke("ctrl H"));
    copyItem.addActionListener(this);
    editMenu.add(copyItem);
    pasteItem = new JMenuItem("Exit");
    pasteItem.setActionCommand("Exit");
    pasteItem.setAccelerator( KeyStroke.getKeyStroke("ctrl E"));
    pasteItem.addActionListener(this);
    editMenu.add(pasteItem);
    JMenuBar bar = new JMenuBar();
    bar.add(fileMenu);
    bar.add(editMenu);
    setJMenuBar(bar);
    setVisible(true);
    setLocation(0,0);
    public void actionPerformed(ActionEvent e) {
    JMenuItem item = (JMenuItem)e.getSource();
    String    ac   = item.getActionCommand();
    System.out.println("ac = "+ ac);
    // you can use action commands to track menu item events   
    if(ac.equals("save"))
         {System.out.println("ac.equals(\"save\") = "+ ac.equals("save"));
            saveData();}
    if(ac.equals("load"))
    {System.out.println("ac.equals(\"load\") = "+ ac.equals("load"));
                         loadingData();}
       if(ac.equals("Help"))
    {System.out.println("ac.equals(\"load\") = "+ ac.equals("Help"));
    if(ac.equals("Exit"))
    {System.out.println("ac.equals(\"load\") = "+ ac.equals("Exit"));
                         Exit();}                   
    // the event origin  
    if(item == saveItem)
         System.out.println("item = "+ item.toString().substring
         (item.toString().indexOf("text=") + 5, item.toString().lastIndexOf("]")));
    if(item == loadItem)
         System.out.println("item = "+ item);
    //   System.out.print( java.saveDAta());
    public  void saveData()
        File file = null;
       JFileChooser fc = new JFileChooser();
       fc.setCurrentDirectory(new File("."));
        fc.setDialogTitle("Save Text As...");
       int returnVal = fc.showSaveDialog(this);
       if (returnVal == JFileChooser.APPROVE_OPTION)
       { file = fc.getSelectedFile();
         try
         { PrintWriter out =
          new PrintWriter(
         new BufferedWriter(
           new FileWriter(file)));
         //while for all the moves in the array>
    for (int i=0;i<120;i++)
         out.println( java.saveDAta(i));
         out.println("\n");
         out.close();
         catch (IOException e) {
              // Some error has occured while trying to read the file.
                // Show an error message.
             JOptionPane.showMessageDialog(this,
                   "Sorry, some error occurred:\n" + e.getMessage());}
       public  void loadingData()
       File loadfile = null;
       JFileChooser fc = new JFileChooser();
          fc.setDialogTitle("OpenFile...");
       fc.setCurrentDirectory(new File("."));
        int returnVal = fc.showOpenDialog(this);
       if (returnVal == JFileChooser.APPROVE_OPTION)
       { loadfile = fc.getSelectedFile();
          try
         { PrintWriter out =
         new PrintWriter(
         new BufferedWriter(
           new FileWriter(loadfile)));
         //while for all the moves in the array>
            out.println("�����������������");
         out.println("\n");
         out.close();
         catch (IOException e) {
              // Some error has occured while trying to read the file.
                // Show an error message.
             JOptionPane.showMessageDialog(this,
                   "Sorry, some error occurred:\n" + e.getMessage());}
    public void Exit()
    System.exit(0);
    public static void main(String[] args) {
    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
         JFrame frame = new ChessMan();
         Container content = frame.getContentPane();
         ChessMan f = new ChessMan();
         f.setLocation(300,300);
         f.show();
                 ImageIcon customImageIcon = new ImageIcon("ac516.gif");
              Image customImage = customImageIcon.getImage();
              frame.setIconImage(customImage);
                 //japplet
         ChessPlayer  javaAppletication = new ChessPlayer();
         // i could not put my constructor here <Static>     
    javaAppletication.init();
    javaAppletication.start();
    // for(int i=0; i < .length(); i++)
    content.add(javaAppletication, BorderLayout.CENTER);
         frame.getContentPane();
    javaAppletication.setBackground (Color.black);
         frame.setVisible(true);
    frame.show();
    frame.pack(); // invokes getPreferredSize()
    // invokes paint();
    public void windowOpened(WindowEvent e) {
    fileMenu.doClick();
    public void windowClosing(WindowEvent e) {}
    public void windowClosed(WindowEvent e) {}
    public void windowIconified(WindowEvent e) {}
    public void windowDeiconified(WindowEvent e) {}
    public void windowActivated(WindowEvent e) {}
    public void windowDeactivated(WindowEvent e) {}
    My Japplet Class
    class ChessPlayer extends JApplet
         implements ActionListener,MouseListener              
    int c;
         //Reference for new Board
               Board bboard;
         //Reference for Button
             JButton newgame,undo,onePlayer,TwoPlayer,NormalPieceSet,
             FuunyPieceSet,startButton,stopButton;
         //Reference for Label  
              JLabel message;
        //Reference for new Panel
             JPanel buttonpanel2,buttonpanel,messagepanel,buttonpane;
         //Initilize the  Applet
          DemoAnimation Demo;
          Container contentPane;
           Board check = new Board(this,false);
               int [] board = new int [120];
           int [] boardcolor = new int [120];
         public void init()
                   // Create new Border
            contentPane = getContentPane();
         check = new Board(this,false);          
         bboard = new Board(this,false);
         bboard.setPreferredSize(new Dimension(500,400));
        bboard.setBorder(BorderFactory.createLineBorder( Color.red ) ); 
         contentPane.add(bboard);   
         final ImageIcon image = new ImageIcon("ac516.gif");
         bboard.addMouseListener(this);
         bboard.setBackground (Color.black); 
         BorderLayout text=new BorderLayout();
        Demo = new DemoAnimation( this );
         Demo.setPreferredSize(new Dimension(160, 500));
         contentPane.add(Demo);
        // Set Background Black
         contentPane.setBackground (Color.black); 
         contentPane.setLayout (new BorderLayout (50,50));
         // set new Font "TimesRoman"
         Font Text= new Font("TimesRoman", Font.BOLD,15);
         //panel to keep buttons together
         buttonpanel=new JPanel();
         buttonpanel.setLayout(new GridLayout(1,2,6,0));
         buttonpanel.add(newgame=new JButton("new game",image));
         newgame.addActionListener(this);
         buttonpanel.add(undo=new JButton("undo"));
         undo.addActionListener(this);
         // Create new Choice Panel                      
         buttonpanel2 = new JPanel();
         buttonpanel2.setLayout(new GridLayout(6,1,0,10));
         buttonpanel2.add(onePlayer=new JButton("Change Colour"));
         onePlayer.addActionListener(this);
         buttonpanel2.add(TwoPlayer=new JButton("Statistic"));
         TwoPlayer.addActionListener(this);
         buttonpanel2.add(NormalPieceSet=new JButton("Quit"));
         NormalPieceSet.addActionListener(this);
         buttonpanel2.add(FuunyPieceSet=new JButton("Change Piece"));
        FuunyPieceSet.addActionListener(this);
        buttonpanel2.add(startButton = new JButton("Start Animation"));
         startButton.addActionListener(this);
         buttonpanel2.add(stopButton  = new JButton("Stop Animation"));
         stopButton.addActionListener(this);
            contentPane.add(BorderLayout.WEST, demopanel);
    // Set Font For Text Message
         setFont(Text);
         messagepanel=new JPanel();
         messagepanel.setBorder(BorderFactory.createLineBorder( Color.red ) );
         messagepanel.setBackground(Color.black);
    //     essagepanel.setLayout(new GridLayout(1,1));
         // Create new Label
         messagepanel.add(message = new JLabel());               
         setMessage("Welcome");
         // Postion panels in  Layout                
         contentPane.add("North",buttonpanel);
         contentPane.add("East",buttonpanel2);
         contentPane.add ("South",messagepanel);     
         contentPane.add ("Center",bboard);
         contentPane.add("West",Demo);
    public void mouseReleased(java.awt.event.MouseEvent e)
    {  statuseChange();}
    public void mouseClicked(java.awt.event.MouseEvent e)
    public void mouseEntered(java.awt.event.MouseEvent e) {     
    public void mouseExited(java.awt.event.MouseEvent e) {
    public void mouseMoved(java.awt.event.MouseEvent e) {
    statuseChange();
    public void mousePressed(java.awt.event.MouseEvent e)
    {statuseChange();
    public void actionPerformed(ActionEvent e)
         Object source=e.getSource();
         if (source == newgame)
              {  bboard.newgame();
                yellow();
              setMessage("try again");
              pause(100);
              c=add(c);
         else if (source==undo)
                  yellow();
              bboard.undo();
         setMessage("Undo");
         else if (source== TwoPlayer )
              //bboard.setup();
                 yellow(); 
              setMessage("Starting new Game");
         setMessage("Change Color");
         else if(source == FuunyPieceSet)
              {yellow();
              setMessage("game played::" +c);
              bboard.PieceChange();
         else if(source == NormalPieceSet)
              {yellow();
              setMessage("GOODBYE");
              destroy();
          else if(source == startButton)
              {yellow();
              setMessage("Start Animation");
              Demo.start();
         else if(source == stopButton)
              {yellow();
              setMessage("Stop Animation");
              Demo.stop();
              else if(source == onePlayer)
              {setMessage("");
              bboard.changePiece();
              setMessage("Change Color");
           public void statuseChange()
                switch (bboard.gameStatus())
            case 1:
                red();
               setMessage("White won");
           break;
      case 2:
            red();
            setMessage("Black won");
         break;
      case 3:
          red();
           setMessage("DRAW");
         Demo.changeAnimation(2);
           break;
      case 4:
           white();
           setMessage("White Turn");
           Demo.changeAnimation(1);
           break;
      case 5:
           green();
           setMessage("Black turn");
           Demo.changeAnimation(3);
         break;
      case 6:
           red();
            setMessage(" Check");
            Demo.changeAnimation(4);
              break;
      case 7:
           red();
           setMessage("Check");     
            Demo.changeAnimation(4);
            break;
      case 8:
           yellow();
           setMessage("I Hope you enjoyed it");     
    public String saveDAta(int i)
    String l=check.save(i);
    return (l);   
    public void LoadData(String load)
    public void setMessage(String s)
                /*The string s will be shown to the user.*/
         Font Text= new Font("Courier", Font.BOLD,30);
                       message.setText(s);
                       message.setFont(Text);
              public void white()
                   {  message.setForeground(Color.white);}
              public void green()
                     message.setForeground(Color.green);
                   public void red()
                          message.setForeground(Color.red);
                   public void yellow()
                        message.setForeground(Color.yellow);
             //  pause method       
              void pause(int time)
      try {Thread.sleep(time);
    }     catch (InterruptedException e)
         // Create new inset Object
         public Insets getInsets()
         return new Insets(50,220,150,200);
    public void destroy()
    contentPane.remove(buttonpanel2);
    contentPane.remove(buttonpanel);
    contentPane.remove(bboard);
    contentPane.repaint();
    Demo.start();
    public int add(int x)
         { int b=x+1;
          return b;
    }tanx man i dont the other two because they are to long
    my is when i open jframe
    i think Japplet and Jframe can not commuinicate to each other

  • Migrating 3 access2000 DB's with linked tables to each other

    I am trying to migrate 3 access2000 DB's to oracle. The main DB's has linked tables to the other 2 DB's. I have been trying to migrate these seperately. When I try and migrate the main DB, it brings along the other 2 with it. Is this sufficient??

    Thx for the post Hilary. I still have some issues with getting this accomplished. I am having trouble moving all 3 access DB's into a single one. I can actually do this, but the app's step all over each other. Two of the DB's have applications and the coding errors out b/c of stepping all over each other. This is a customers DB's and I don't have permissions to change the code at this time, even if its the best way to do this.
    So, is it sufficient to do it this way. I got this post earlier last week.
    For the description purposes i'm going to migrate tables access1.mdb, access2.mdb, access3.mdb to "access_user" schema in oracle
    1. export access1.mdb to c:\test1\access_user.xml [repeat the same for the other 2 mdb's keeping the same export name but in different directories]
    2. export access2.mdb to c:\test2\access_user.xml
    3. export access3.mdb to c:\test3\access_user.xml
    4. Capture the c:\test1\access_user.xml and complete the migration i.e., at the end of this step, you must be able to log into oracle as "access_user" and should be able to see all your tables in it.
    5. Now capture c:\test2\access_user.xml and repeat the same steps, this time workbench will fire up an alert saying that access_user tablespace already create --> ignore this error. similarly ignore the "access_user" and "omwb_emulation" creation errors. Note: if you select re-create, this may over ride your previous tables, so I think its safer to ignore this error.
    6.Repeat the step #5 for the c:\test3\access_user.xml
    7. Now log into the oracle model as "access_user" user and password as "oracle", you must be able to see all your access tables and data.
    After doing this, I should have all my tables in the "access_user". The process also created other oracle users at each migration b/c the DB's are linked to each other and as Hilary said before, workbench migrates the linked tables also. This is not a problem if after all 3 have been done, each app now points to the "access_user" and not to any of the other created oracle users. I would need to delete the bogus oracle users and still expect my access applications to correctly point to the "access_user".
    Is this the correct way to do this??
    Thx for the help
    Marty

  • Please HELP: Homesharing PCs don't see each other, but both are signed in

    I just enabled home sharing on both my PCs, one is a windows 7 the other is a windows xp machine. 
    Both machines now have home sharing turned on.
    You can verify it in iTunes by going to Advanced on the menu bar at the top of iTunes, and see that it says "Turn Off Home Sharing (my Account name)".  So that's how you know it's turned on with both computers.
    But, nothing appears on the left side of iTunes navigation on my new PC.  . 
    It's supposed to show the other PC itunes library once it finds it, and display it under a folder called Shared in the iTunes window, but it is not appearing.
    Anyone got any ideas how to solve this one?

    PROBLEM SOLVED!
    PROBLEM SOLVED!
    PROBLEM SOLVED! 
    SOLVED BY UPGRADING TO THE EXACT SAME AND LATEST iTUNES VERSION ON BOTH PCs, AND RESTARTING iTUNES.
    Actually I solved the problem on my own shortly after posting my question last night. 
    I wanted to make sure I had the latest versions of iTunes on both PCs, and they were both months older iTunes versions, and not the same version on each PC, so I thought maybe I should "align" both iTunes installations up better with the same version.
    One PC version of iTunes was 10.4 and the other was who knows what, older I'm sure. 
    I upgraded both iTunes to be the exact same version 10.6.3, which is the latest version as of today.  Then I re-ran both iTunes on both PCs and it is now working like a charm.
    What I don't know is if the reason it is now working simply because I restarted iTunes, or because I upgraded both of the PCs to the latest version, or a combo of both reasons.  I should have tried just exiting out of itunes then coming back in first before upgrading to see if that was the reason, but no matter, it is working flawlessly now.
    Using HomeSharing is THE single best way to copy your iTUNES library from one older PC to your new computer, simply by importing into iTunes on the new PC over the HomeSharing network feature of iTunes.  My Nano has 4000 songs so it takes it about 3 hours to do the transfer.  It copies the entire iTunes music library onto your new PC without you having to think or figure out where to put the files.
    Lots of times on forums I see people recommend things like the firewall or remove and reinstall iTunes, those hardly ever turn out to be the problem.  For once I'd like to see people admit that the iTunes program itself on occasion has bugs in it. 
    One current repeating iTunes bug that frustrates me is in iTunes will not upgrade itself when you tell it to. When you go to Help > Check For Updates , and it comes back and says iTunes updates are available do you want to download it?  And you select yes, and it does nothing. This happens on all 3 of my PCs, no error message, it just does nothing.
    Apple has had this bug for years and still has not fixed it.  All my computers with iTunes have this problem.  I always have to bring up a browser and go to Apple to download the iTunes exe and run it because they don't know how to make their own program update itself.
    Anyway, my problem with HomeSharing is solved!!

  • HELP/Problems with pull-down navigator bar

    Hi everyone,
    I was wondering if I could get some input. I have just
    re-designed our magazine's site, www.easternsurf.com
    I used Pop-Up menu function in Fireworks 8 to generate our
    Navigator bar. For the most part everything has been working well,
    BUT we've had a couple of complaints that the navigator bar's
    pull-down menus get stuck behind the photos/banner ads/etc. instead
    of in front of them when viewing in Internet Explorer. I'm on the
    Mac platform (OSX Tiger/Macromedia Studio 8) and have seen no
    problems viewing in Safari, Firefox and Netscape. The only
    complaints have come from Internet Explorer users. A couple of
    people updated their browser to the newest version and the problem
    disappeared, however we've still had a couple of people that have
    written in that the newest version of IE is still not displaying
    properly.
    Also we've got a strip of button ads running down the left
    hand side of each page and I've also seen another issue that's
    common on sites of this type...when the pulldown menu overlaps with
    a Flash element, there is a problem with the screen re-draw. I've
    seen this on several other sites and know it's a common problem,
    but does anyone know of a workaround where this won't happen? I
    just noticed that signing on to Adobe's site, there almost seems to
    be a command where the menu keeps re-drawing at a very rapid rate
    so this won't happen.
    Any input would be greatly appreciated, although I'm Mac all
    the way, we are a business and have to get this site visible for
    everyone!
    Thanks

    Hi Oldbudge,
    Welcome to the Community,
    Please Perform a Battery Pull Restart like this While Device is Powered On remove the Battery wait for a min. then re-insert it back wait till the device take a long Reboot.And see if that helps.
    Good Luck
    Prince
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • Problems with an array (attachMovie)

    I've created a 20 x 20 grid of objects (openCircles). They're set to 'alpha = 0', then 'alpha = 100' on rollover. This works for all of them except for the final one at the coordinate T,20 in the bottom right corner, as I'm not able to rollover over it. To test whether or not they all existed, I set them all to an initial value of 'alpha = 100' and they did all appear, but I'm still unable to rollover the one at T20.
    The other problem is that when an 'openCircle' is clicked, a 'filledCircle' (set up as another grid of invisible objects in the same place) is supposed to appear in its place. That doesn't happen. All of the objects are created and exist, using attachMovie, so it's maybe due to some logical error. See code:-
    I'd be grateful for any help. Many thanks.
    stop();
    //The purpose of this experiment is to locate a trap of oil. Only 30 exploration holes are allowed.
    //Use the grid coordinate to locate the borehole and then plot the depth
    //Drilled is set to false in the 1st(previous) frame
    //Rolling over a grid coordinate will reveal a borehole (open circle).
    //Click on the borehole (open circle) to start drilling
              //open circle will be removed
              //drilled is set to true for that coordinate
              //filled circle will appear in its place
    //set up variables for grid array of open circles (undrilled) and closed circles (drilled)
    var spacing:Number = 5.75;
    var cols:Number = 20; // number of columns in grid
    var rows:Number = 20; // number of rows in grid
    var leftMargin:Number = 154;
    var topMargin:Number = 169;
    var currentRow:Number = 0;
    var currentCol:Number = 0;
    for (i=1; i<=rows; i++) {                                                                                                         
    for (j=1; j<=cols; j++) {                                                                                                                              
              current = attachMovie("openCircle_mc", "openCircle_mc"+i+"_"+j,getNextHighestDepth());
              current._x = leftMargin + ((i-1) * (spacing + current._width));
              current._y = topMargin + ((j-1) * (spacing + current._height));
              current2 = attachMovie("filledCircle_mc", "filledCircle_mc"+i+"_"+j, getNextHighestDepth());
              current2._x = leftMargin + ((i-1) * (spacing + current2._width));
              current2._y = topMargin + ((j-1) * (spacing + current2._height));
              //open circle initially invisible, then visible on rollOver
              current._alpha = 0;
              //filled circles initially invisible
              currentCol2=(current2._x-leftMargin)/(spacing + current2._width);
              currentRow2=(current2._y-topMargin)/(spacing + current2._height);
                                     if (drilled[currentCol,currentRow]==true){
                                                      current2._alpha = 100;
                                                      }else{
                                                                current2._alpha=0;
              //open circle visible on rollover
              current.onRollOver = function() {
                                     this._alpha = 100;
                                     currentCol=(this._x-leftMargin)/(spacing + current._width);
                                     trace("current column ="+currentCol);
                                     currentRow=(this._y-topMargin)/(spacing + current._height);
                                     trace("current row ="+currentRow);
                                     if (drilled[currentCol,currentRow]==false){
                                              trace("Click on the grid point to drill at "+rowLabel[currentRow]+","+colLabel[currentCol]);
                                  }else{
                                              trace("Click on the grid point to review the core at "+rowLabel[currentRow]+","+colLabel[currentCol]);
                                  }     //end 'if-else'
              //open circle invisible on rollout
              current.onRollOut = function() {
                                     this._alpha = 0;
                                     trace("No grid point selected")
              //click on open circle - variable drilled becomes true
              current.onRelease=function(){
                        drilled[currentCol,currentRow]=true;
                        trace(drilled[currentCol,currentRow]);
                        this.removeMovieClip();
    This is an image of the grid showing an 'openCircle' visible when rolled over

    Thanks for the explanation. That was very helpful.
    However, I am having problems with the variables. I did as you suggested though and extended the (grid) layer, but had to create a separate keyframe for the code layer, as that code had to execute first before moving into the next frame. See below (I've also attached the fla, but if you need any more information, please let me know):
    In frame 2 of the animation, if an open circle mc is clicked, that mc is deactivated (removed), drilled becomes true for that coordinate, a filled circle becomes visible in its place and you enter another frame(3) (this is currently just a test frame), to later be used to implement the drilling animation for a clicked coordinate.
    It all seems to be working as it should, until the open circle is clicked and you enter frame 3. See below:
    All the instances of the openCircle mc's are still active in frame 3, so I guess I need to use removeMovieClip(). I know how to do that for a single instance, but howdo I execute that if they're in an array?
    I also don't want any instances of the filledCircles from frame 2 to be visible in frame 3. I'm not sure how to hide them temporarily in frame 3 and then have them visible again in frame 2?
    When I go back to frame 2 (using a back button), all of the filled circles in the array are visible, whereas only the ones that have been previously clicked (drilled = true) should be visible. However, when I return to frame 2 and do a trace to find out which coordinates are set to true/false, it seems that a whole row is now set to (drilled = true), whereas it should just be a single coordinate set to true. Oddly enough, the variable seems to working properly in frame 2 when the code is first executed, but then when I go to frame 3 and then re enter frame 2, it's not working as it should do. Below is the trace code that I've used:
    if (drilled[currentCol,currentRow] == false) {
                                            trace("Click on the grid point to drill at " + rowLabel[currentRow] + "," + colLabel[currentCol]);
                                  } else {
                                            trace("Click on the grid point to review the core at " + rowLabel[currentRow] + "," + colLabel[currentCol]);
    If you could help, I'd be very grateful! Very many thanks.
    http://synergese.co.uk/boreholes15.fla
    Message was edited by: Pippa01
    Sorry, Although the original question was correct, I've just unmarked it as correct. Maybe, I should have started it as a new thread?

  • Aperture performance problems with Lacie array

    I have an iMac with 32GB memory and, due to space requirements, an external LaCie 2Big2 disk array, with 2 x 6GB disks in a RAID-1 (mirroring) configuration and attached via USB3.
    This has in the past worked extremely quickly.  The iMac has a 1TB Fusion drive.
    In recent weeks something has changed.  It now takes about a minute for Aperture to start up and open a library of photographs.  It used to take 3-4 seconds.  In the meantime I get a spinning beachball, but can happily use other applications. The manager software for the array says it's working fine.  I am more than a little puzzled and frustrated.
    I'd appreciate suggestions on how to track down the root cause of the problem, and then how to fix it!
    I am on the latest version of Mavericks, with no outstanding software updates.

    Dear Leonie
    Thank you very much for your reply.  Here are the answers:
    What exactly has changed?
         I don't know exactly. Something changes every day on a working system!  However I have not installed any new software or hardware.
    Did this start after a software update?
         Not that I am aware of.  In the last 30 days my only software updates have been Epson driver software, a digital RAW compatibility update to Aperture and a Safari update.  The Aperture update does not apply to any of the equipment I have.
    Or after you moved the library to the Lacie Array?
         No.  I should have been clearer.  The Lacie array was installed several months ago and has been working well.
    Did you import new photos?
         I import new photos almost every day.  However I have several photo libraries and this problem occurs across all of them, even the ones unchanged for months or years.
      Did you enable Photo Stream?
         No
    Does Aperture launch more quickly, if you hold down the Shift key while Aperture is launching?  This will defer the generation of previews.
    If Aperture is launching more quickly this way, you may have imported a corrupted video or image file, that you need to find and to remove.
         No.  I have just tested this.
    Other possible reasons:
    Check the file system on your array. If the filesystem is not MacOS Extended (Journaled), you may have problems with ambigious filenames.
    The file system is MacOS Extended (Journaled)
    Do you have Photo Stream enabled? Aperture may be hanging while trying to load photos from My Photo Stream.
    No, Photo Stream is not enabled.
    Thank you again for your help.

Maybe you are looking for

  • LR3 can't find files after copying my previous hard drive to a new Lacie Thunderbolt drive

    I transferred my LR3 files from my WD hard drive to my new Lacie Thunderbolt drive and now I can only get the preview and it says the file is missing.  Is there a setting I need to change that I am not aware of?

  • IMovie 11 can't find my projects

    I've creaeted several, over 20, projects in iMovie saved to an external hard drive. I just installed iMovie 11, and they do not appear in the project window. I can see the external hard drive, but no projects are listed. How do I tell iMovie where th

  • Broadband not working

    been having problems all day,have been losing connection and then when i have got it only getting 0.13mpbs have run btw performance tes the results of which are :- download speed achieved during the test was 0.13mpbs for your connection,the acceptabl

  • DPS Desktop Tools Update CS6. Help.

    Any help will be appreciated on this... On my Mac running Snow Leopard, I was able to successfully install my Creative Cloud Subscription CS6 apps yesterday (so far, so good). Installed Photoshop, InDesign and Illustrator. When I launched InDesign, I

  • Font styles dont' work in Text Overlay/Timecode Generator

    Has anyone every been able to get drop shadow to work in the "Select Font" section of the Text Overlay or TimeCode Generator within Compressor? I don't know if I'm selecting things in the wrong order or not but I've never been able to get this to wor