How to refresh my GUI in connect 4 game

Hi all,
I write an application of a beginner level of connect 4. It has a problem: I cannot reset/refresh the screen after I find a winner or tie. I wonder if someone here can give me a hand.
Thanks.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class Connect4GUI extends JFrame
     private final int WIN_WIDTH=500;
     private final int WIN_HEIGHT=500;
     private JFrame frame;
    private JPanel panel_Center;
     private JButton[][] buttonsBoard;
     private int [][] chess;
     private JPanel panel;
    private JButton startButton;
     private JButton rePlayButton;
     private JButton exitButton;
    private static  String player1Name;
     private static  String player2Name;
     private static final int player1_ID=1;
     private static final int player2_ID=2;
    private String input;
     private boolean gameOver=false;
     private boolean playAgain=false;
     private static int steps=0;
/********************constructor**************************************************/
public Connect4GUI()
     playerInfo();
     showFrame();
     JOptionPane.showMessageDialog(null,"Press Start to start the game.");
public void playerInfo()
     player1Name=JOptionPane.showInputDialog("Player 1 please enter your name.");
     player2Name=JOptionPane.showInputDialog("Player 2 please enter your name.");
public void showFrame()
     setTitle("Connect 4");
     setSize( WIN_WIDTH,WIN_HEIGHT);
     setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     setLayout(new BorderLayout());
     JPanel panel_North=new JPanel();//show player info
     panel_North.setLayout(new FlowLayout());
     JLabel labelPlayer_1= new JLabel("player 1 is "+player1Name);
     JLabel labelPlayer_2= new JLabel("player 2 is "+player2Name);
     panel_North.add(labelPlayer_1);
     panel_North.add(labelPlayer_2);
     JPanel panel_South=new JPanel();//add several button
     panel_South.setLayout(new FlowLayout());
    //create buttons
     startButton=new JButton("Start");
     rePlayButton=new JButton("Replay");
     exitButton=new JButton("Exit");
    //button listern
     startButton.addActionListener(new myStartButton());
     rePlayButton.addActionListener(new myrePlayButton());
     exitButton.addActionListener(new myexitButton());
    //add buttons to the panel
     panel_South.add(startButton);
     panel_South.add(rePlayButton);
     panel_South.add(exitButton);
     panel_Center=new JPanel();//show the board
    panel_Center.setLayout(new GridLayout(6,7,10,10));//6x7 chess board
     buttonsBoard=new JButton[6][7];
     chess=new int[6][7];
         for (int r=0; r<6;r++)
               for (int c=0;c<7;c++)
                    buttonsBoard[r][c]=new JButton();
                    buttonsBoard[r][c].setBackground(Color.yellow);
                    panel_Center.add(buttonsBoard[r][c]);
                    buttonsBoard[r][c].addActionListener(new mybuttonsBoard());//add actionListener
                chess[r][c]=0;
     }//end for
     //construct the frame
    add(panel_North,BorderLayout.NORTH);
    add(panel_South,BorderLayout.SOUTH);
    add(panel_Center,BorderLayout.CENTER);
       setVisible(true);
}//end showFrame()
public boolean hasAWinner()
   boolean hasAWinner=false;
  //win at row
  for (int r=0;r<6;r++)
        for(int c=0;(c+3)<7;c++)
                if(chess[r][c]==chess[r][c+1]&&
                      chess[r][c]==chess[r][c+2]&&
                      chess[r][c]==chess[r][c+3]&&
                      chess[r][c]==1)
                         JOptionPane.showMessageDialog(null,player1Name+" is a winner.");
                         hasAWinner=true;
                         return hasAWinner;
                 else if(chess[r][c]==chess[r][c+1]&&
                            chess[r][c]==chess[r][c+2]&&
                            chess[r][c]==chess[r][c+3]&&
                            chess[r][c]==2)
                         JOptionPane.showMessageDialog(null,player2Name+ " is a winner.");
                         hasAWinner=true;
                         return hasAWinner;
//win at column
for (int r=0;(r+3)<6;r++)
        for(int c=0;c<7;c++)
                if(chess[r][c]==chess[r+1][c]&&
                       chess[r][c]==chess[r+2][c]&&
                       chess[r][c]==chess[r+3][c]&&
                       chess[r][c]==1)
                         JOptionPane.showMessageDialog(null, player1Name+" is a winner.");
                         hasAWinner=true;
                         return hasAWinner;
                  else if(chess[r][c]==chess[r+1][c]&&
                             chess[r][c]==chess[r+2][c]&&
                             chess[r][c]==chess[r+3][c]&&
                             chess[r][c]==2)
                         JOptionPane.showMessageDialog(null,player2Name+" is a winner.");
                        hasAWinner=true;
                         return hasAWinner;
//win at upleft-to-downright direction
for (int r=0;(r+3)<6;r++)
        for(int c=0;(c+3)<7;c++)
                if(chess[r][c]==chess[r+1][c+1]&&
                       chess[r][c]==chess[r+2][c+2]&&
                       chess[r][c]==chess[r+3][c+3]&&
                       chess[r][c]==1)
                         JOptionPane.showMessageDialog(null, player1Name+" is a winner.");
                         hasAWinner=true;
                         return hasAWinner;
                  else if(chess[r][c]==chess[r+1][c+1]&&
                             chess[r][c]==chess[r+2][c+2]&&
                             chess[r][c]==chess[r+3][c+3]&&
                             chess[r][c]==2)
                         JOptionPane.showMessageDialog(null,player2Name+" is a winner.");
                        hasAWinner=true;
                         return hasAWinner;
//win at downleft-to-upright direction
for (int r=5;(r-3)>=0;r--)
        for(int c=0;(c+3)<7;c++)
                if(chess[r][c]==chess[r-1][c+1]&&
                       chess[r][c]==chess[r-2][c+2]&&
                       chess[r][c]==chess[r-3][c+3]&&
                       chess[r][c]==1)
                         JOptionPane.showMessageDialog(null, player1Name+" is a winner.");
                         hasAWinner=true;
                         return hasAWinner;
                  else if(chess[r][c]==chess[r-1][c+1]&&
                             chess[r][c]==chess[r-2][c+2]&&
                             chess[r][c]==chess[r-3][c+3]&&
                             chess[r][c]==2)
                         JOptionPane.showMessageDialog(null,player2Name+" is a winner.");
                        hasAWinner=true;
                         return hasAWinner;
return hasAWinner;
}//end hasAwinner
public boolean hasATie()
     boolean hasATie=false;
     if(steps==42 && hasAWinner()==false)
                 JOptionPane.showMessageDialog(null,"The game has a a tie.");
                hasATie=true;
                 return hasATie;
        return hasATie;
}//end hasATie
/***********************listener class *******************************************/
private class myStartButton implements ActionListener
     public void actionPerformed(ActionEvent e)
          //JOptionPane.showMessageDialog(null,"Now the game starts.");
          input=JOptionPane.showInputDialog(player1Name+" enter your name and make a move.");//start the game
private class myrePlayButton implements ActionListener
     public void actionPerformed(ActionEvent e)
        if(steps>0)
                    ///how to clear the old frame???
                JOptionPane.showMessageDialog(null,"new game starts.");
                   input=JOptionPane.showInputDialog(player1Name+" enter your name and make a move.");//start the game
             else
                  JOptionPane.showMessageDialog(null,"You haven't started a new game yet.");
}//end myrePlayButton
private class myexitButton implements ActionListener
     public void actionPerformed(ActionEvent e)
                                                      ///how to cancel????????
                      JOptionPane.showMessageDialog(null,"Are you sure you want to stop the game?");
                      if(e.getActionCommand().equals("Exit"))
                          {System.exit(0);}
}//end myexitButton
private class mybuttonsBoard implements ActionListener
     public void actionPerformed(ActionEvent e)
       for (int r=0; r<6; r++)
                 for (int c=0; c<7;c++)
                    if(e.getSource()==buttonsBoard[r][c]
                        &&chess[r][c]==0
                        &&input.equals(player1Name))
                         buttonsBoard[r][c].setBackground(Color.red);
                                   chess[r][c]=player1_ID;
                                        steps++;
                            if(hasAWinner()==true||hasATie()==true)//has a winner or tie
                                         gameOver=true;
                                         repaint();
                                        break;
                           else
                                  input=JOptionPane.showInputDialog(player2Name+
                                      " enter your name and make a move.");
                  else if(e.getSource()==buttonsBoard[r][c]
                           &&chess[r][c]==0
                           &&input.equals(player2Name))
                                buttonsBoard[r][c].setBackground(Color.black);
                                     chess[r][c]=player2_ID;
                                          steps++;
                                     if(hasAWinner()==true||hasATie()==true)//has a winner or tie
                                             gameOver=true;
                                                  break;
                                   else
                                        input=JOptionPane.showInputDialog(player1Name+
                                                        " enter your name and make a move.");
          }//end for
    if(gameOver==true)
                  JOptionPane.showMessageDialog(null,"press Replay to"+
                                     " replay the game or press Exit to exit the game");//replay the game
}//end actionPerformed
}//end class
public static void main(String []args)
          Connect4GUI b=new Connect4GUI();
     }//end main
}//end Board

The problem is solved.

Similar Messages

  • How to develop a GUI in my game

    Hi,
    I'm working on a multiplayer game in Java 1.4. This is more like a prototype than a commercial quality game, and since the focus of my work is on the networking capabilities of the game, I want to spend the least possible time with mundane things like how to type information and select things on my game...in other words, having a GUI that can provide the game with a menu/submenus, buttons, textfields and the like.
    I've done several Swing applications before but this is different, since the event loop is provided by me (as any other game) and I'm using "active rendering" to display the graphics on screen.
    Does anyone knows how can I use the Swing (or AWT) components in my game?
    Thanks in advance.
    Gabriel

    Hi,
    Thanks for the ansewr. I've been doing an example and I could get my Swing dialog to appear in the screen.
    Below is thesource code of my example. It works but it seems to me that the animation of the square is flickering somehow (I think is double buffered) and the frame rate is somewhat low.
    I would like to know how to improve those things in the example so I could use it in my game.
    Regards,
    Gabriel
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.sun.j3d.utils.timer.*;
    public class ActiveSwingTest implements Runnable {
      static final int VEL = 1;
      // Number of frames with a delay of 0 ms before the animation thread yields
      // to other running threads.
      private static final int NO_DELAYS_PER_YIELD = 16;
      // no. of frames that can be skipped in any one animation loop
      // i.e the games state is updated but not rendered
      private static int MAX_FRAME_SKIPS = 5; // was 2;
      JFrame f;
      JPanel panel;
      Image backBuffer;
      JDialog dialog;
      private long gameStartTime;
      private long prevStatsTime;
      private boolean running;
      private Graphics2D graphics;
      private long period;
      private long framesSkipped = 0;
      int x = 0;
      int y = 0;
      int vx = VEL;
      int vy = VEL;
      public ActiveSwingTest() {
        initGraphics();
      public void initGraphics() {
        panel = new JPanel();
        panel.setPreferredSize(new Dimension(800, 600));
        panel.setFocusable(true);
        panel.requestFocus();
        panel.setIgnoreRepaint(true);
        readyForTermination();
        f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(panel);
        f.setIgnoreRepaint(true);
        f.setResizable(false);
        f.pack();
        backBuffer = createBackBuffer();
        if(backBuffer == null) {
          return;
        f.setVisible(true);
      public void run() {
        long timeDiff = 0;
        long overSleepTime = 0L;
        int noDelays = 0;
        long excess = 0L;
        gameStartTime = J3DTimer.getValue();
        prevStatsTime = gameStartTime;
        long beforeTime = gameStartTime;
        running = true;
        graphics = (Graphics2D) backBuffer.getGraphics();
        while(running) {
          update(timeDiff);
          render(graphics);
          paintScreen();
          long afterTime = J3DTimer.getValue();
          timeDiff = afterTime - beforeTime;
          long sleepTime = (period - timeDiff) - overSleepTime;
          if(sleepTime > 0) { // some time left in this cycle
            try {
              Thread.sleep(sleepTime / 1000000L); // nano -> ms
            catch(InterruptedException ex) {}
            overSleepTime = (J3DTimer.getValue() - afterTime) - sleepTime;
          else { // sleepTime <= 0; the frame took longer than the period
            excess -= sleepTime; // store excess time value
            overSleepTime = 0L;
            if(++noDelays >= NO_DELAYS_PER_YIELD) {
              Thread.yield(); // give another thread a chance to run
              noDelays = 0;
          beforeTime = J3DTimer.getValue();
          /* If frame animation is taking too long, update the game state
             without rendering it, to get the updates/sec nearer to
             the required FPS. */
          int skips = 0;
          while((excess > period) && (skips < MAX_FRAME_SKIPS)) {
            excess -= period;
            update(timeDiff); // update state but don't render
            skips++;
          framesSkipped += skips;
        System.exit(0); // so window disappears
      private void showDialogo() {
        if ( dialog == null ) {
          dialog = new JDialog(f, "Example dialog", true);
          final JTextField t = new JTextField("hello");
          JButton bok = new JButton("OK");
          bok.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  System.out.println("text="+t.getText());
                  dialog.setVisible(false);
                  dialog.dispose();
                  dialog = null;
          JButton bcancel = new JButton("Cancel");
          bcancel.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                      dialog.setVisible(false);
          final Container c = dialog.getContentPane();
          c.setLayout(new BorderLayout());
          c.add(t, BorderLayout.CENTER);
          final JPanel buttonPanel = new JPanel();
          buttonPanel.add(bok);
          buttonPanel.add(bcancel);
          c.add(buttonPanel, BorderLayout.PAGE_END);
          dialog.pack();
          dialog.setLocationRelativeTo(f);
          dialog.setVisible(true);
        else {
          dialog.setVisible(true);
      private void paintScreen() {
        // use active rendering to put the buffered image on-screen
        try {
          final Graphics g = panel.getGraphics();
          if(g != null) {
            g.drawImage(backBuffer, 0, 0, null);
          g.dispose();
        catch(Exception e) {
          System.out.println("Graphics context error: " + e);
      private Image createBackBuffer() {
        final Image dbImage = panel.createImage(800, 600);
        if(dbImage == null) {
          System.out.println("could not create the backbuffer image!");
        return dbImage;
      private void readyForTermination() {
        panel.addKeyListener(new KeyAdapter() {
          // listen for esc, q, end, ctrl-c on the canvas to
          // allow a convenient exit from the full screen configuration
          public void keyPressed(KeyEvent e) {
            int keyCode = e.getKeyCode();
            if((keyCode == KeyEvent.VK_ESCAPE) || (keyCode == KeyEvent.VK_Q) ||
               (keyCode == KeyEvent.VK_END) ||
               ((keyCode == KeyEvent.VK_C) && e.isControlDown())) {
              running = false;
            else if ( keyCode == KeyEvent.VK_D ) {
              showDialogo();
      private void update(long dt) {
        x += vx;
        y += vy;
        if ( x < 0 ) {
          x = 0;
          vx = VEL;
        else if ( x > 700 ) {
          x = 700;
          vx = -VEL;
        if ( y < 0 ) {
          y = 0;
          vy = VEL;
        else if ( y > 500 ) {
          y = 500;
          vy = -VEL;
      private void render(Graphics2D g) {
        g.setColor(Color.RED);
        g.fillRect(0, 0, 800, 600);
        g.setColor(Color.WHITE);
        g.fillRect(x, y, 100, 100);
      public static void main(String[] args) {
        ActiveSwingTest test = new ActiveSwingTest();
        new Thread(test).start();
    }

  • How to refresh the textedit object in module pool

    Hi All,
    I would appreciate if anybody can solve my problem.
    Problem is i have created one TEXTEDIT and now when user clicks on the cancel button and come back to the screen the data which was previously entered is still coming up.
    Please tell me how to refresh the data in TEXTEDIT.

    actualy it is enough to do the following, assuming you have a container to put the textedit into it:
      DATA:  l_parent_container TYPE REF TO cl_gui_custom_container,
             l_obj_editor TYPE REF TO cl_gui_textedit, "make this a global variable
             l_text_table TYPE re_t_textline,
             l_itftext TYPE STANDARD TABLE OF tline,
             l_thead TYPE thead.
    l_parent_container = ... "your container
    move .... to l_thead...    "your text header to read or reread
    read text from SO10
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          id                      = l_thead-tdid "Text-ID
          language                = l_thead-tdspras "im_request-language?
          name                    = l_thead-tdname "TDIC Text-Name
          object                  = l_thead-tdobject "Texte: Anwendungsobjekt
        TABLES
          lines                   = l_itftext
        EXCEPTIONS
          id                      = 1
          language                = 2
          name                    = 3
          not_found               = 4
          object                  = 5
          reference_check         = 6
          wrong_access_to_archive = 7
          OTHERS                  = 8.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    convert itf text to stream text (SAPSCRIPT_DEMO_NOTE_EDITOR)
      CALL FUNCTION 'CONVERT_ITF_TO_STREAM_TEXT'
        TABLES
          itf_text    = l_itftext
          text_stream = l_text_table.
      IF l_obj_editor IS INITIAL.
        CREATE OBJECT l_obj_editor
            EXPORTING parent = l_parent_container. " Abstract Container for GUI Controls
      ENDIF.
    discard any previous changes
      l_obj_editor->set_textmodified_status( cl_gui_textedit=>false ).
    übertragen text in editor
      CALL METHOD l_obj_editor->set_text_as_stream
        EXPORTING
          text            = l_text_table
        EXCEPTIONS
          error_dp        = 1
          error_dp_create = 2.

  • How to refresh the panel's display in listener?

    I have a Jcombobox and a panel(square,background color:white). I want user to choose the panel's size from the combobox and thus change the panel's display. However, when I choose a value from combobox, the panel's size DOES change, but the display cannot be rerfreshed realtimely. It still display the panel by previous size. If I minimize the whole window and restore, then the panel gets refreshed, displaying by new size.
    Can anybody tell me how to refresh the panel's display dynamically? thank you a lot.
    sraiper

    if we bounce the listener the connections to other might be lost.NO!
    The listener contacts the DB to establish the initial connection between client & DB.
    After the connection between DB & client has started, the listener has NO involvement between DB & client.
    Stopping the listener has NO impact on existing sessions.
    Edited by: sb92075 on Jul 28, 2009 4:37 PM

  • How to refresh ODI variables from file

    Hi,
    I followed the fillowing links to implement the dynamic file parameter passing in to the resource name of a datastore.
    part-1. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value
    part-2. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%e2%80%93-part-2-%e2%80%93-getting-all-lines-once-at-time
    For me first part is working fine where as in second part i made canvas looks like
    Vlinevariable(refreshing variable)------------------dyanamicfile(refereshing variable)--------------------- interface.
    Interface looks like Flatfile to db ,km's are lkm file------sql and ikm is sql incremental update
    Vlinevariable is working fine where i am getting numbers in sequence manner to assign in to code of dynamicfile variable and in dynamicfile is not taking that value in to that code and causing session failed.
    The code which i put in a refreshing code of dynamicfile is followed below
    select     samplefile1_csv     C1_SAMPLEFILE1_CSV
    from      TABLE
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=code_generationSNP$CRLOAD_FILE=C:\file/my_test_file.txtSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=samplefile1_csvSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
    For the firstrow the number has to get from vlinevariable where in my case not working .
    In session while loading the interface (load data) i am getting error like
    message-------------- ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection file_tgt.
    Caused By: java.sql.SQLException: File not found: C:\file/
         at com.sunopsis.jdbc.driver.file.FileResultSet.<init>(FileResultSet.java:160)
         at com.sunopsis.jdbc.driver.file.impl.commands.CommandSelect.execute(CommandSelect.java:57)
         at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
         at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeQuery(FilePreparedStatement.java:131)
         at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java:602)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeQuery(SnpSessTaskSql.java:3078)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java:571)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2815)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)
    source code is select     a     C1_A,
         b     C2_B
    from      TABLE
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=sample1SNP$CRLOAD_FILE=C:\file/#PROJECT1.FILENAMESNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x002cSNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=aSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=bSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=2SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
    target code insert into STAGING.C$_0SAMPLE1
         C1_A,
         C2_B
    values
         :C1_A,
         :C2_B
    KIndly help me and thanks in advance.

    ODI is complaning it cannot locate the file. Try replacing the '/' character with a '\' after file in the designated filepath.

  • How to refresh CR 2008 datasource

    Hello,
    We have upgraded CR 10 that came with the Visual Studio 2005 to CR 2008. However, just upgrading of the Visual Studio project was not enough, to make old CR 10 reports to work I have to open each report in the CR 2008 application (not the Visual Studio), refresh their data source and save, after this they work.
    I'm using datasets as a datasource, so I don't have problem with it. But some reports I inherited from the previous developer. He was using a C# class as a datasource for reports. It's just a C# class file - InvReport.cs. This file contains field definitions for several reports.
    I cannot figure out how to refresh this datasource. Class file is not in the list of the datasources for Crystal Reports, so whatever I'm trying to do in the Database Expert (or by setting datasource location) fails.
    Could you please advise me on how to deal with this situation? Or perhaps there is another way to to upgrade the old reports to 2008 version? According to Visual Studio - they all had been upgraded automatically, but in reality they don't work until I open each one in the report application and refresh datasource.
    Thank you,
    Peter Afonin

    Peter,
    Rather than updating the reports from VS2005 I would suggest you to use CR2008 designer. During updating of the application the reports might not have got updated properly as it depends on the complexity of the reports like stored procedures, formulas etc. So I would suggest you open the .rpt file in designer, Go to Field Explorer -> set data source location and then create a new connection in Replace with window and update the fields in Current datasource window.
    Preview to ensure the report displays proper data and then use this report in the application.
    Hope that helps!
    AG.

  • How to achieve synchronization after DCP connection string changed via sdk

    Hi guys,
    i have modified the DCP connection string using method: metaDataProperties.setProperty("SI_METADATA_BVCONN_ATTRIBUTES", new string here) via BOE SDK for java,  and then
    checked it  through Query Builder
    :select * from CI_APPOBJECTS where SI_GUID=' DC(DataConnection)  GUID' ,
    it appears ok, the DCP connection string has been changed.
    but the problem is :
    when i logon to the infoview or cmc , i find that the information of DCP parameter  is still the former one.
    (in most cases , it display the old, former con-info,  but it also display the correct new data several times  )
    And if i restart the machine , it will be work ok , infoview will get the latest DCP parameters information.
    (related  service  restarting is of no effect)
    how to refresh the latest boe managed information?
    Thanks.
    Regards,
    Jinling.
    Edited by: jinling xiang on Nov 18, 2010 10:00 AM
    Edited by: jinling xiang on Nov 18, 2010 10:03 AM

    Not quite what I meant - I was suggesting you load the entity immediately after reading it from PU_B, or anytime before associating it into PU_A, so before the merge. What you have not shown though is any code on how you are obtaining IntegrationDepartment and integrating it into PU_A, or what you mean by it is returning a refreshed version of Topic. This problem could also be the result of how your provider works internally - this is a TopLink/EclipseLink forum post so I cannot really tell you why you get the exception other than it would be expected to work as described with EclipseLink as the JPA provider.
    So the best suggestions I can come up with are prefetch your entity, try posting in a hibernate forum, or try using EclipseLink/TopLink so someone here might be better able to help you with any problems that arise.
    Best Regards,
    Chris

  • How do I get an itunes connect account

    how do I get an itunes connect account

    Since I don't haven't signed up for iTunes Connect, I don't know exactly. There is a link at the top of the discussions for iTunes Connect: https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/wa/bookSignup

  • How to refresh the data in a container and to update the new data

    Hi,
    I have created a Module Pool Program in which i have two containers to display the long text.
    Initially this container is filled and based on some condition i want to update the text in the same conatiner.
    I am using the below two classes to do all this.
    cl_gui_textedit,
    cl_gui_custom_container,
    Could someone help me how to remove the long text in the container and update the new long text.
    I am getting the new long text but not able display it in the same container. Please someone help me how to refresh and update the container.
    Thanks in advance.

    Hi
    Try this.
      IF cl_gui_textedit  IS INITIAL.
      create control container
        CREATE OBJECT cl_gui_custom_container
           EXPORTING
                container_name = 'Container Name''
           EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
    create text_edit control
        CREATE OBJECT cl_gui_textedit
           EXPORTING
                parent = cl_gui_custom_container
                wordwrap_mode = cl_gui_textedit=>wordwrap_at_windowborder
                wordwrap_to_linebreak_mode = cl_gui_textedit=>false
           EXCEPTIONS
                error_cntl_create      = 1
                error_cntl_init        = 2
                error_cntl_link        = 3
                error_dp_create        = 4
                gui_type_not_supported = 5.
      ENDIF.
    *--use method to set the text
      CALL METHOD cl_text_edit->set_text_as_stream
        EXPORTING
          text            =  t_lines ( Internal table with long text).
        EXCEPTIONS
          error_dp        = 1
          error_dp_create = 2
          OTHERS          = 3.
    regards,
    Raghu.

  • How to retrive ip address of connected device in shell script or applescript

    Hi all,
    From Mac PC, how to get ip address of connected device in shell script or applescript.
    there is any way to launch an app on ipad in shell script or applescript.
    thank you in advance for your help
    Mickael

    Hi all,
    From Mac PC, how to get ip address of connected device in shell script or applescript.
    there is any way to launch an app on ipad in shell script or applescript.
    thank you in advance for your help
    Mickael

  • How to refresh/initialize sy-tabix in a loop?????

    Dear all,
    Please do let me know how to refresh/initialize 'sy-tabix' for every new document in a loop statement.
    Thanx in advance.
    Alok.

    Never try to refresh or initialize system variable. It shall always lead to errors in the programs. For this I have an alternative way below.
    Please declare a variable for e.g
    data: <b>l_count</b> type sy-tabix.
    Inside loop you can write the code like this:
    say for eg. you need to refresh l_count for every new material.
    Loop at itab.
    on change of itab-material.
    clear : l_count.
    endon.
    l_count = l_count + 1.
    endloop.
    Hope this clarifies your issue.
    Lakshminarayanan

  • How do i let my iphone connect to my computer wifi with usb ?

    As the title stated,
    How do i let my iphone connect to my computer wifi with USB ?
    The reason is because my iPhone 3Gs wifi having some problem. So i have to use a USB cable to connect to my computer and let my iphone to connect to the internet .
    If i don't do this i would have to keep on running out & in to my room & my living room.
    My iPhone 3Gs allows to connect to the wifi when i am in my living room, but once i enter my room the wifi won't be able any more. So please help me out please people
    I'm not sure about why i can't connect to my Ad hoc even it's so near, but i can connect to my router if i am in living rooms.
    Regards,

    I believe the next time you sync your phone to itune via the cord, you will have to check the box that says sync via wifi and also enable that setting on your iphone.

  • How to restore my ipad?My ipad say on screen CONNECT TO ITUNE.How can i do when i connect with computer.It is need itune new version.Can you sent me.I will be waiting your answer.Please help me sir.

    How to restore my ipad?My ipad say on screen CONNECT TO ITUNE.How can i do when i connect with computer.It is need itune new version.Can you sent me.I will be waiting your answer.Please help me sir.

    Check for Updates.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%208/78d42b19fa42e8d83b5 5a65e1333373f_zpsf58bbe10.jpg

  • How to get my macbook to connect to the Apple TV?

    How to get my macbook to connect to the Apple TV in a strange apartment? I am housesitting for someone for a few months. They mentioned that i would be able to use their Apple TV to play stuff from my macbook. I am using their basic wifi in the apt, which works fine on my macbook and iphone, but see no Apple TV icon appearing on macbook screen, nor any connection happening. (nor is there anything connection w my iPhone). What gives? How can I establish a connection?

    See
    http://support.apple.com/kb/ts4215

  • I am trying to use Words with friends on my iphone 5.  How do I get rid of   "Connect to itunes to Use Push Notifications

    I am trying to use Words with friends on my iphone 5.  How do I get rid of   "Connect to itunes to Use Push Notifications

    Reading some older threads from 2012 and 2011 it appears the problem was present even then.  Part of the problem was due to people using multiple or different account id's on the various devices.  In my case, I only have one ID and it is the same on all devices yet the iPhone and iPad are still throwing the same error when I try turning on iTunes Match.  This is very frustrating . . . any help out there?  Thanks.

Maybe you are looking for

  • Problem with MSI P45 Platinum DDR2 mainboard and Corsair Dominator PC8500C5D Ram

    Hi, I have encountered with a problem. First I had MSI p45 platinum ddr2 bios ver. 1,4 Intel E8400 Corsair Dominator PC8500C5D 2x1Gb 2 Asus ATI EAH 3870 Crossfire and it was running with windows XP without any problems. Problems began when I decided

  • Help Needed in Creating Java Class and Java Stored Procedures

    Hi, Can anyone tell how can i create Java Class, Java Source and Java Resource in Oracle Database. I have seen the Documents. But i couldn't able to understand it correctly. I will be helpful when i get some Examples for creating a Java Class, Java S

  • How do i read complete line from a text file in j2me?????

    how do i read complete line from a text file in j2me????? I wanna read file line by line not char by char..Even i tried with readUTF of datainputstream to read word by word but i got UTFDataFormatException.. Please solve my problem.. Thanks in advanc

  • Test a file to fle scenario using NFS in 7.1

    Hi Experts, I have one small confusion... when testing a file to file scenario in PI 7.1 using NFS...im wondering what path should i specify for the source directory? cos earlier in 7.0, i would have given /usr/sap.... but now i dont think 7.1 has vi

  • Can I filter by value which is not displayed in grid columns?

    In excel it is possible to filter by value of measure which is not displayed in the report. How can I possibly do this in Performance Point Grid? (in filter by value there I only see the measures in columns). Please advise Namnami