Problem with repainting, should be Threaded...

Hello,
I want to smoothly animate a square to some coördinates of the screen, smoothly means with some time between new coörds.
I'm using the following code:
                    for(int i = 0; i<5; i++)
                         bx-=2;
                         repaint();
                         try
                              Thread.sleep(tijdTussenFrame);
                              System.out.println("Wacht nummer: "+i);
                         catch(Exception er)
                              System.out.println("error bij wachten voor pijl links!");
                    }However, I don't seem to repaint when the (small sleep times) are in use...
My paint Thread should be a different Thread than the one that is sleeping small times...
My full code:
* To change this template, choose Tools | Templates
* and open the template in the editor.
* @author Man Ik Weet
import java.applet.*;
import java.awt.event.*;
import java.awt.*;
//import java.net.URL; //alleen als er plaatjes worden geladen!
public class RPG extends Applet implements KeyListener, Runnable,MouseListener, MouseMotionListener
     //nodig voor extra Thread
     Thread painter = null;
     boolean threadSuspended;
     //Offscreen tekeken
     Graphics bg;
     Image offscreen;
     //dimensie scherm
     int width,height;
     //x en y muis
     int xm,ym = 0;
     //alles voor audio/plaatjes
     //URL base;
     //AudioClip geluidjeNaam;
     //Image plaatjeNaam;
     //MediaTracker mt; //alleen nodig als er plaatjes worden geladen van het internet
     //voor de FPS
     int fps = 25; //de frames per seconde, game sloom? zet dit hoger/lager;
     int tijdTussenFrame;
     //Voor het blokje dat reageert op de pijlen...
     int bx,by = 0;
     boolean keyInGedrukt = false; //als er een toets is gedruk wacht de thread, maar hij vangt wel andere toetsen dan op
     public void init()
          //zorg voor het laden van plaatjes en/of geluid
          /*try
               base = getDocumentBase();
          catch (Exception e)
          plaatjeNaam = getImage(base,"plaatjeNaam.png");
          mt.addImage(plaatjeNaam,1); 1 = hoeveelste plaatje
          naam = getAudioClip(base, "naam.au");
          try
              mt.waitForAll();
         catch (InterruptedException  e)
              System.out.println("Fout bij wachten voor alle plaatjes...");
          //zwarte achtergrond FTW
          setBackground(Color.black);
          //zet alles op voor muis/toetsenboord
          addKeyListener(this);
          addMouseListener(this);
          addMouseMotionListener(this);
          //pixels voor scherm, we willen niet te groot of te klein ;)
          width = getSize().width;
          height = getSize().height;
          offscreen = createImage(width, height);
          bg = offscreen.getGraphics();
          tijdTussenFrame = (1000/fps);
   public void start()
          if (painter == null )
               painter  = new Thread( this );
               painter.setPriority( Thread.MAX_PRIORITY );
               threadSuspended = false;
               painter.start();
          else
               if ( threadSuspended )
                    threadSuspended = false;
                    synchronized( this )
                         notify();
     public void stop()
          threadSuspended = true;
     public void run() {
          try
               while (true)
                    //hier doet het IETS? LMAO! muwahahahaha!
                    if (threadSuspended)
                         synchronized( this )
                              while (threadSuspended)
                                   wait();
                    repaint();
                    painter.sleep(tijdTussenFrame);  // interval given in milliseconds
          catch (InterruptedException e) { }
     public void paint(Graphics g)
          bg.clearRect(0,0,width,height);
          bg.setColor(Color.red);
          bg.drawString("Key ingedrukt: "+keyInGedrukt,width/2,height/2);
          bg.drawString(xm+";"+ym, xm, ym);
          bg.setColor(Color.cyan);
          bg.fillRect(bx, by, 10, 10);
          g.drawImage(offscreen,0,0,this);
     public void update(Graphics g)
          paint(g);
     public void mouseClicked(MouseEvent me)
          xm = me.getX();
          ym = me.getY();
     public void mousePressed(MouseEvent me)
     public void mouseReleased(MouseEvent me)
     public void mouseEntered(MouseEvent me)
     public void mouseExited(MouseEvent me)
     public void mouseDragged(MouseEvent me)
          xm = me.getX();
          ym = me.getY();
     public void mouseMoved(MouseEvent me)
          xm = me.getX();
          ym = me.getY();
    public void keyTyped(KeyEvent e)
        System.out.println("Key getypt.");
    public void keyPressed(KeyEvent e)
          if(keyInGedrukt==false)
               keyInGedrukt=true;
               System.out.println("Key ingedrukt.");
               if(e.getKeyCode()==KeyEvent.VK_LEFT)
                    System.out.println("Key pijl links.");
                    for(int i = 0; i<5; i++)
                         bx-=2;
                         repaint();
                         try
                              Thread.sleep(tijdTussenFrame);
                              System.out.println("Wacht nummer: "+i);
                         catch(Exception er)
                              System.out.println("error bij wachten voor pijl links!");
               if(e.getKeyCode()==KeyEvent.VK_RIGHT)
                    System.out.println("Key pijl rechts.");
                    bx+=10;
               if(e.getKeyCode()==KeyEvent.VK_UP)
                    System.out.println("Key pijl omhoog.");
                    by-=10;
               if(e.getKeyCode()==KeyEvent.VK_DOWN)
                    System.out.println("Key pijl naar beneden.");
                    by+=10;
          else
               System.out.println("Key is ingedrukt?");
    public void keyReleased(KeyEvent e)
          keyInGedrukt = false;
        System.out.println("Key losgelaten.");
        if(e.getKeyCode()==KeyEvent.VK_LEFT)
               System.out.println("Key pijl links losgelaten.");
               bx-=10;
          if(e.getKeyCode()==KeyEvent.VK_RIGHT)
               System.out.println("Key pijl rechts losgelaten.");
               bx+=10;
        if(e.getKeyCode()==KeyEvent.VK_UP)
               System.out.println("Key pijl omhoog losgelaten.");
               by-=10;
          if(e.getKeyCode()==KeyEvent.VK_DOWN)
               System.out.println("Key pijl naar beneden losgelaten.");
               by+=10;
}

Doesn't work that way. You have to remove the old Button and insert the new one:import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class ButtonExample extends JFrame implements ActionListener {
     JButton b1, b2;
     JLabel l1 = new JLabel("left");
     JLabel l2 = new JLabel("right");
     JPanel jp = new JPanel(new BorderLayout());
     ButtonExample() {
          setSize(800, 600);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container conPane = getContentPane();
          b1 = new JButton("First Click");
          b2 = new JButton("Second Click");
          b1.addActionListener(this);
          jp.add(l1,BorderLayout.EAST);
          jp.add(b1,BorderLayout.CENTER);
          jp.add(l2,BorderLayout.WEST);
          conPane.add(jp);
          pack();
          setVisible(true);
     public void actionPerformed(ActionEvent e) {
          if (e.getActionCommand() == "First Click") {
               System.out.println("fldf");
               jp.remove(b1);
               jp.add(b2,BorderLayout.CENTER);
               pack();
               validate();
     static public void main(String args[]) {
          ButtonExample fr = new ButtonExample();
}

Similar Messages

  • Problem with repaint of display after a click event

    Hi,
    I have a problem with repaint of display. In particular in method keyPressed() i inserted a statement that, after i clicked bottom 2 of phone, must draw a string. But this string doesn't drawing.
    Instead if i reduce to icon the window, which emulate my application, and then i enlarge it, i see display repainted with the string.
    I don't know why.
    Any suggestions?
    Please help me.

    modified your code little
    don't draw in keyPressed
    import java.io.IOException;
    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    public class PlayerCanvas extends Canvas implements CommandListener{
         Display display;
         Displayable dsp11;
    private Image play, pause, stop, next, previous = null;
    private int gamcode;
    private Command quitCmd = new Command("Back", Command.ITEM, 1);
    public PlayerCanvas(Display display,Displayable dsp11){
         this.display =display;
         this.dsp11 =dsp11;
         addCommand(quitCmd);
         createController();
         setCommandListener(this);
         display.setCurrent(this);
              protected void paint(Graphics g)
              g.setColor(255,200,150);
              g.fillRect(0, 0, getWidth(), getHeight());
              if (play != null){
              g.drawImage(play, getWidth()/5, getHeight()-50, Graphics.BOTTOM | Graphics.HCENTER);
              if (stop != null){
              g.drawImage(stop, getWidth()/5, getHeight()-10, Graphics.BOTTOM | Graphics.HCENTER);
              if (next != null){
              g.drawImage(next, (getWidth()/5)+10, getHeight()-30, Graphics.BOTTOM | Graphics.LEFT);
              if (previous != null){
              g.drawImage(previous, (getWidth()/5)-30, getHeight()-30, Graphics.BOTTOM | Graphics.LEFT);
                   /////this will draw on key UP
                   g.setColor(0,0,0);
                   System.out.print(gamcode);
                   if(gamcode==Canvas.UP){
                        g.drawString("PROVA",10, 0, 0);
                   }else if(gamcode==Canvas.DOWN){
                        g.drawString("DIFFERENT",10, 30, 0);     
    private void createController()
    try {
    play = Image.createImage("/icon3.png");//replace your original images plz
    pause = Image.createImage("/icon3.png");
    stop = Image.createImage("/icon3.png");
    next = Image.createImage("/icon3.png");
    previous = Image.createImage("/icon3.png");
    } catch (IOException e) {
    play = null;
    pause = null;
    stop = null;
    next = null;
    previous = null;
    if (play == null){
    System.out.println("cannot load play.png");
    if (pause == null){
    System.out.println("cannot load pause.png");
    if (stop == null){
    System.out.println("cannot load stop.png");
    if (next == null){
    System.out.println("cannot load next.png");
    if (previous == null){
    System.out.println("cannot load previous.png");
              protected void keyPressed(int keyCode)
                   repaint();
                   if ( (keyCode == 2) || (UP == getGameAction(keyCode)) ){
                        gamcode = UP;
                        repaint();
                        else if ( (keyCode == 8) || (DOWN == getGameAction(keyCode)) ){
                             gamcode =DOWN;
                             repaint();
              else if ( (keyCode == 4) || (LEFT == getGameAction(keyCode)) ){
              else if ( (keyCode == 6) || (RIGHT == getGameAction(keyCode)) ){
              public void commandAction(Command arg0, Displayable arg1) {
                   // TODO Auto-generated method stub
                   if(arg0==quitCmd){
                        display.setCurrent(dsp11);
    }

  • Problem with getState() method in Thread class

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

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

  • Problems with notify/wait on threads

    I have a few Player threads connected to some game server.
    The first player to connect ("Player1") starts a timer to 10 seconds. During this time all other connected players can't do anything. When the 10 seconds are up the game starts.
    My idea is that if the current thread is Player1 then it sleeps for 10 seconds and then calls notifyAll() to wake up all other player threads. Other player threads will wait() until they are notified by Player1. Problem is I can get Player1 to sleep and wake up but my notifyAll() calls don't wake the other players up.
    My basic server connection code:
    // a for loop to create players and add them to a vector ("players"). Run player threads as soon as they connect
    players.add( new Player( server.accept(), maze, this, i + 1);
    players.get(i).start();The run() for Players:
    public void run()
      synchronized( this)
        if( Thread.currentThread().getName.compareTo( "Player1") == 0)
          sleep( 10 * 1000);
          // game_started is a condition var, init to false
          game_started = true;
          notifyAll();
        else
          while( !game_started)
            try
              wait();
            catch( Exception e) {}
    }Somehow my others threads keep waiting even thought the notify signal has been sent. They just keep waiting.
    Any suggestions on what I'm doing wrong?

    Well the problem is that you seem a bit confused over the way wait and notify/notifyAll work.
    Wait (and notify) work with thread against an object monitor. What this means is that you need a common object shared among the threads that they are calling wait/notify on.
    Note that the Javadoc says this about wait
    wait() - Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.And about notifyAll
    notifyAll() - Wakes up all threads that are waiting on this object's monitor.So the problem is you have these threads waiting and notifying themselves. Which isn't what you want. See this section of [_the concurrency (threading) tutorial_|http://java.sun.com/docs/books/tutorial/essential/concurrency/guardmeth.html] for more on how to use wait/notify/notifyAll.

  • Problems with repainting in new JD 9.0.4.0

    I just installed new JD 9.0.4.0 . I think that from this moment I have problems with painting java graphics objects (for example Application Module tests or simple login dialogs). When I move that window, its remains are left on the screen until I overlap them with other non-java window. Has anybody the same experience ?

    I haven't seen this. One thought (call it grasping at straws) would be to set the environment variable: J2D_D3D=false
    That disables Java2D and sometimes fixes some quirks.
    Rob
    Team JDev

  • Problem with behavior of the Thread Context ClassLoader on OC4J 10.1.3.2.0

    Hi,
    We run into different behavior of the Thread Context ClassLoader on OC4J 10.1.3.1.0 (which is OK) and OC4J 10.1.3.2.0 (here we have problems). It appeared in the Threads directly and indirectly (e.g. through Timer) created by our application. Threads, created by OC4j (e.g. the Thread, where our start-up servlet are running) are OK.
    Thread Context ClassLoader (could be received from Thread.currentThread().getContextClassLoader()) on OC4J 10.1.3.1.0 in all threads is the same ClassLoader instance as the current ClassLoader (could be received from getClass().getClassLoader()). Actually the same is true for JBoss, WebLogic and WebSphere.
    Thread Context ClassLoader on OC4J 10.1.3.2.0 is NOT the same ClassLoader instance as the current ClassLoader, it is even the instance of the different Class. This ClassLoader does not see classes, available at application level, which causes multiple problems.
    Is it possible to configure OC4J 10.1.3.2.0 to behave similar to OC4J 10.1.3.1.0?
    We tried to use “–userThreads”, but it did not help.
    To investigate this problem we created a simple Web Application, which has Start-up Servlet, creates one thread and one Timer Task. From each point it is checking if Thread Context ClassLoader is the same ClassLoader instance as the current ClassLoader and printing Class Loaders if they are different. In addition it checks if correct parser accessed (should be xerces, which is in the Web App classpath and for which we added a shared library). Below you could see what we received on OC4J 10.1.3.1.0 (which is OK) and OC4J 10.1.3.2.0:
    E:\OracleAS_1\j2ee\home>java -Xms128m -Xmx1024m -jar oc4j.jar -userThreads
    07/04/30 10:33:00 Oracle Containers for J2EE 10g (10.1.3.1.0) initialized
    07/04/30 10:39:31 ------In StartupServlet Init-----
    07/04/30 10:39:31 +++++++ ++++++++++++++++++++++++++++++++++++ ++++++++
    07/04/30 10:39:31 +++++++ Executing Code in the StrtServlet... ++++++++
    07/04/30 10:39:31 +++++++ (this Thread created by App Server) +++++++++
    07/04/30 10:39:31 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/04/30 10:39:31 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <TestLoaders.web.TestLoaders:0.0.0>*******<class oracle.classloader
    .PolicyClassLoader
    07/04/30 10:39:31 ******* THE SAME CLASSLOADER USED IN BOTH PLACES!!! *******
    07/04/30 10:39:31 DocumentBuilderFactory = <org.apache.xerces.jaxp.DocumentBuild
    erFactoryImpl@1908ba7>*******
    07/04/30 10:39:31 C O R R E C T !!!
    07/04/30 10:39:31 -CWD- =E:\OracleAS_1\j2ee\home; uer directory = E:\OracleAS_1\
    j2ee\home
    07/04/30 10:39:31 Constructing the Timer Task...
    07/04/30 10:39:31 Starting some Timer...
    07/04/30 10:39:31 Some Timer is started ...
    07/04/30 10:39:31 ------All actions done Successfully--------
    07/04/30 10:39:41 +++++++ +++++++++++++++++++++++++++++++++++ ++++++++
    07/04/30 10:39:41 +++++++ Executing Code in the new Thread... ++++++++
    07/04/30 10:39:41 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/04/30 10:39:41 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <TestLoaders.web.TestLoaders:0.0.0>*******<class oracle.classloader
    .PolicyClassLoader
    07/04/30 10:39:41 ******* THE SAME CLASSLOADER USED IN BOTH PLACES!!! *******
    07/04/30 10:39:41 DocumentBuilderFactory = <org.apache.xerces.jaxp.DocumentBuild
    erFactoryImpl@17e5e56>*******
    07/04/30 10:39:41 C O R R E C T !!!
    07/04/30 10:40:31 +++++++ +++++++++++++++++++++++++++++++++++ ++++++++
    07/04/30 10:40:31 +++++++ Executing the Session Timer Task... ++++++++
    07/04/30 10:40:31 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/04/30 10:40:31 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <TestLoaders.web.TestLoaders:0.0.0>*******<class oracle.classloader
    .PolicyClassLoader
    07/04/30 10:40:31 ******* THE SAME CLASSLOADER USED IN BOTH PLACES!!! *******
    07/04/30 10:40:31 DocumentBuilderFactory = <org.apache.xerces.jaxp.DocumentBuild
    erFactoryImpl@1c6988d>*******
    07/04/30 10:40:31 C O R R E C T !!!
    07/04/30 10:44:01 Shutting down OC4J...
    07/04/30 10:44:01
    E:\OracleAS_1\j2ee\home>
    C:\oc4j\j2ee\home>java -Xms128m -Xmx1024m -classpath .;oc4j.jar;C:\oc4j\j2ee\hom
    e\properties -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socke
    t,address=3999,server=y,suspend=n -jar oc4j.jar -userThreads
    07/05/01 21:14:33 ------In StartupServlet Init-----
    07/05/01 21:14:33 +++++++ ++++++++++++++++++++++++++++++++++++ ++++++++
    07/05/01 21:14:33 +++++++ Executing Code in the StrtServlet... ++++++++
    07/05/01 21:14:33 +++++++ (this Thread created by App Server) +++++++++
    07/05/01 21:14:33 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/05/01 21:14:33 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <TestLoaders.web.TestLoaders:0.0.0>*******<class oracle.classloader
    .PolicyClassLoader
    07/05/01 21:14:33 ******* THE SAME CLASSLOADER USED IN BOTH PLACES!!! *******
    07/05/01 21:14:33 DocumentBuilderFactory = <org.apache.xerces.jaxp.DocumentBuild
    erFactoryImpl@723c42>*******
    07/05/01 21:14:33 C O R R E C T !!!
    07/05/01 21:14:33 -CWD- =C:\oc4j\j2ee\home; uer directory = C:\oc4j\j2ee\home
    07/05/01 21:14:33 Constructing the Timer Task...
    07/05/01 21:14:33 Starting some Timer...
    07/05/01 21:14:33 Some Timer is started ...
    07/05/01 21:14:33 ------All actions done Successfully--------
    07/05/01 21:14:33 Oracle Containers for J2EE 10g (10.1.3.2.0) initialized
    07/05/01 21:14:43 +++++++ +++++++++++++++++++++++++++++++++++ ++++++++
    07/05/01 21:14:43 +++++++ Executing Code in the new Thread... ++++++++
    07/05/01 21:14:43 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/05/01 21:14:43 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <[ThreadContextLoader, current context: TestLoaders.web.TestLoaders
    :0.0.0]>*******<class com.evermind.server.ApplicationContextClassLoader
    07/05/01 21:14:43 ******************************************************
    07/05/01 21:14:43 Chain of ClassLoaders from Class
    07/05/01 21:14:43 --- TestLoaders.root:0.0.0 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:14:43 --- default.root:0.0.0 --- class oracle.classloader.PolicyCla
    ssLoader
    07/05/01 21:14:43 --- system.root:0.0.0 --- class oracle.classloader.PolicyClas
    sLoader
    07/05/01 21:14:43 --- oc4j:10.1.3 --- class oracle.classloader.PolicyClassLoade
    r
    07/05/01 21:14:43 --- api:1.4.0 --- class oracle.classloader.PolicyClassLoader
    07/05/01 21:14:43 --- jre.extension:0.0.0 --- class oracle.classloader.PolicyCl
    assLoader
    07/05/01 21:14:43 --- jre.bootstrap:1.4.2_08 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:14:43 --- null ---
    07/05/01 21:14:43 ********** End of Chain of ClassLoaders **************
    07/05/01 21:14:43 ******************************************************
    07/05/01 21:14:43 Chain of ClassLoaders from Thread
    07/05/01 21:14:43 --- oc4j:10.1.3 --- class oracle.classloader.PolicyClassLoade
    r
    07/05/01 21:14:43 --- api:1.4.0 --- class oracle.classloader.PolicyClassLoader
    07/05/01 21:14:43 --- jre.extension:0.0.0 --- class oracle.classloader.PolicyCl
    assLoader
    07/05/01 21:14:43 --- jre.bootstrap:1.4.2_08 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:14:43 --- null ---
    07/05/01 21:14:43 ********** End of Chain of ClassLoaders **************
    07/05/01 21:14:43 DocumentBuilderFactory = <oracle.xml.jaxp.JXDocumentBuilderFac
    tory@74a138>*******
    07/05/01 21:14:43 WRONG !!! Should be org.apache.xerces.jaxp.DocumentBuilderFact
    oryImpl
    07/05/01 21:15:33 +++++++ +++++++++++++++++++++++++++++++++++ ++++++++
    07/05/01 21:15:33 +++++++ Executing the Session Timer Task... ++++++++
    07/05/01 21:15:33 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/05/01 21:15:33 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <[ThreadContextLoader, current context: TestLoaders.web.TestLoaders
    :0.0.0]>*******<class com.evermind.server.ApplicationContextClassLoader
    07/05/01 21:15:33 **************************************************
    07/05/01 21:15:33 Chain of ClassLoaders from Class
    07/05/01 21:15:33 --- TestLoaders.root:0.0.0 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:15:33 --- default.root:0.0.0 --- class oracle.classloader.PolicyCla
    ssLoader
    07/05/01 21:15:33 --- system.root:0.0.0 --- class oracle.classloader.PolicyClas
    sLoader
    07/05/01 21:15:33 --- oc4j:10.1.3 --- class oracle.classloader.PolicyClassLoade
    r
    07/05/01 21:15:33 --- api:1.4.0 --- class oracle.classloader.PolicyClassLoader
    07/05/01 21:15:33 --- jre.extension:0.0.0 --- class oracle.classloader.PolicyCl
    assLoader
    07/05/01 21:15:33 --- jre.bootstrap:1.4.2_08 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:15:33 --- null ---
    07/05/01 21:15:33 ********** End of Chain of ClassLoaders **********
    07/05/01 21:15:33 **************************************************
    07/05/01 21:15:33 Chain of ClassLoaders from Thread
    07/05/01 21:15:33 --- oc4j:10.1.3 --- class oracle.classloader.PolicyClassLoade
    r
    07/05/01 21:15:33 --- api:1.4.0 --- class oracle.classloader.PolicyClassLoader
    07/05/01 21:15:33 --- jre.extension:0.0.0 --- class oracle.classloader.PolicyCl
    assLoader
    07/05/01 21:15:33 --- jre.bootstrap:1.4.2_08 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:15:33 --- null ---
    07/05/01 21:15:33 ********** End of Chain of ClassLoaders **********
    07/05/01 21:15:33 DocumentBuilderFactory = <oracle.xml.jaxp.JXDocumentBuilderFac
    tory@1d12d43>*******
    07/05/01 21:15:33 WRONG !!! Should be org.apache.xerces.jaxp.DocumentBuilderFact
    oryImpl
    Any help will be greatly appreciated.
    Thanks

    Sorry for confusion, version of OC4J does not really meter, but jdk does. It happened that in the case where everything OK (OC4J 10.1.3.1.0) I accidentally used jdk 1.5. Now I tried both (OC4J 10.1.3.1.0 and OC4J 10.1.3.2.0) with j2sdk1.4.2_14 (besides I tried j2sdk1.4.2_09 and _08) and j2sdk1.5.0_06.
    With JDK 1.5 everything is OK and with JDK 1.4 we have a problem, described in the previous posting. I believe now I should reformulate my initial question:
    Is it possible to configure OC4J 10.1.3 running under j2sdk1.4.2_14 to force Thread Context ClassLoader to behave similar to OC4J 10.1.3 under j2sdk1.5.0_06? If yes, how we could do it?
    Thanks

  • Problem with JPanel and/or Thread

    Hello all,
    I have the following problem.
    I have a JFrame containing to JPanels. The JPanels are placed
    via BorderLayout.
    JPanel #1 is for moving a little rectangle (setDoubleBufferd), it is
    a self defined object extending JPanel.
    The paint methon in JPanel #1 has been overwritten to do the drawings.
    JPanel #2 contains 4 JButtons, but they have no effect at the
    moment. It is an "original" JPanel.
    The class extending JFrame implemented the interface Runnable and
    is started in its own thread.
    After starting the programm everthing looks fine.
    But if I press a Button in the second JPanel this button is painted in
    the top left corner of my frame. It changes if I press another button.
    Any help would be appreciated.
    Thanks.
    Ralf

    I have a JFrame containing to JPanels. The JPanels are
    placed
    via BorderLayout.The type of Layout does not seem to be relevant
    >
    JPanel #1 is for moving a little rectangle
    (setDoubleBufferd), it is
    a self defined object extending JPanel.
    The paint methon in JPanel #1 has been overwritten to
    do the drawings.
    JPanel #2 contains 4 JButtons, but they have no effect
    at the
    moment. It is an "original" JPanel.
    The class extending JFrame implemented the interface
    Runnable and
    is started in its own thread.
    After starting the programm everthing looks fine.
    But if I press a Button in the second JPanel this
    button is painted in
    the top left corner of my frame. It changes if I press
    another button.
    I noticed you solved this by painting the whole JFrame.
    Yeh Form time to time I get this problem too......
    Especially if the screen has gone blank - by going and having a cup of tea etc -
    Text from one Panel would be drawn in another.. annoying
    At first it was because I changed the state of some Swing Components
    not from the Event Thread.
    So make sure that your new Thread doesn't just blithely call repaint() or such like cos that leads to problems
    but rather something like
    SwingUtilities.invokeLater( new Runnable()
       public void run()
          MyComponent.repaint();
    });However I still get this problem using JScrollPanes, and was able to fix it by using the slower backing store method for the JScrollPane
    I could not see from my code how something on one JPanel can get drawn on another JPanel but it was happening.
    Anyone who could totally enlighten me on this?

  • Problem with Pushlet (and/or Thread Competition?)

    Hi all,
    Once again, I'm in over my head and have approximately four hours to dig myself out.
    I have a client-server application. One the client side is an Applet that runs Java 3D and has a JavaPushletClient / JavaPushletClientListener pair (from Pushlet Framework). All of the code is executed on either the AWT Event DIspatching Thread, the Java 3D InputDeviceScheduler thread, and the JavaPushletClient thread (none of the code on the latter is mine, it's part of the Pushlet Framework).
    On the ServerSide, I have subclasses Pushet and Postlet of the Pushlet Framework.
    I have one client sending information to the Server (via HTTP Get Request). This is occuring on the Java 3D InputDeviceScheduling thread. It sends information to the server roughly every 35 ms (This was not predetermined - it cannot be. This was measured). The Server is recieving these messages and sending them to the Publisher at the same rate (every 35 ms, again by measuring). When the information is published to other clients, it appears that the pushlet client waits 200 ms, reacts to all of the messages (roughly 6 in 200 ms) that have accumulated at once, and waits another 200 ms.
    This system is intended to display real time information at a rate of no worse than 50 ms (this is for animation purposes, roughly 20 fps).
    I can't figure out where this problem is coming from, or why. I have read through the Pushlet source code, and it indicates that everything should really be continuous.
    Here's what I think MIGHT be happening:
    the PushletClientLoop is sort of like this:
    while (true) {
              message = objectInputStream.readObject();
              theListener.event(message);
    }I wondered if it was possible that when it attempts to read an object, it blocks because one is not available, and transfers processing to another thread, and does not recieve processing time for another 200 ms.
    If that is the case, (given that all the other code is scheduled by Java 3D and the AWT Event Dispatching thread), how can I make sure that this JavaPushletClient thread gets processing time at least every 50 ms.
    OR, I could be way off. This problem could be caused by something else altogether. Any ideas?
    At any rate, I really need help here. This is my final day on this project, and the presedent of our company wants to see the results next Tuesday. AND, (because my company is part of the Canadian Gov't), it's possible that the Prime Minister of Canada will be present for the Demo Tuesday. So I really need this to work. Lots of Dukes up for grabs on this one!
    - Adam

    Here's what I think MIGHT be happening: ......
    I wondered if it was possible that when it attempts to read an object, it
    blocks because one is not available, and transfers processing to another
    thread, and does not recieve processing time for another 200 ms.yes, objectInputStream.readObject(); will block the thread until there is:
    a) an object to read or
    b) the stream is closed and an exception is thrown.
    The JavaPushletClient doesn't run in the event dispatch thread. It runs in it's own thread. I'm sure of that, I've used it before. Unless you are doing something wrong, but I'm not sure how, cuz you just use the JavaPushletClient class and have your own listener class. That doesn't mean it's no the event dispatch thread, though.
    Pushlets send probe messages frequently, although every 35 ms, I dont' know if it's that frequent (if that's what you mean).
    You could update the priority of the thread in the JavaPushletClient. But exact scheduling of threads in Java is tricky. I'm not sure there's a way to guaranty what you want. Up the priority, and see what happens.
    It's very well possible that other threads are doing stuff for 200 ms and not giving up control. Likely I'd say. Although if it's consistently 200 ms, that sounds weird.
    It maybe doesn't matter, though, that it runs every 50 ms, cuz you're UI display isn't likely to be that responsive anyway.

  • Problem with repaint() in JPanel

    Hi,
    This is the problem: I cyclically call the repaint()-method but there is no effect of it.
    When does it appear: The problem occurs by calling the repaint()-method of a JPanel -class.
    This is what i am doing: The repaint() is called from a different class which is my GUI. I do this call in an endless loop which is done within a Thread.
    I tried to add a KeyListener to the JPanel-class and there I called the repaint()-method when i press a Key. Then the Panel is repainted.
    so I implemented a "callRepaint"-method in the JPanel-class that does nothing else than call repaint() (just like the keyPressed()-method does). But when i cyclically call this "callRepaint"-method from my GUI nothing happens.
    Now a few codedetails:
    // JPanel-class contains:
    int i = 0;
    public void callRepaint(){
                    repaint();
    public void paintComponent(Graphics g){
            super.paintComponent(g);
            g.drawLine(i++,0,200,200);
    public void keyPressed(KeyEvent e) {
            repaint();                       // This is working
    //GUI-class contains:
    // This method is called cyclically
    public void draw() {
                  lnkJPanelclass.repaint();             // This calling didn't work
                  // lnkJPanelclass.callRepaint();  // This calling didn't work     
    Thanks for your advices in advance!
    Cheers spike

    @ARafique:
    This works fine:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Date;
    import javax.swing.*;
    public class Test extends JFrame implements ActionListener{
        private JTextField label;
        private Timer timer;
        private Container cont;
        public Test() {
            label = new JTextField("",0);
            timer = new Timer(1000,this);
            cont = getContentPane();
            cont.add(label);
            setSize(250,70);
            setDefaultCloseOperation(3);
            setVisible(true);
            timer.start();
        public void actionPerformed(ActionEvent e){
            label.setText(new Date(System.currentTimeMillis()).toString());
        public static void main(String[] args){
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new Test();
    }no repaint()/revalidate() needed

  • Problem with while loop in thread: starting an audiostream

    Hello guys,
    I'm doing this project for school and I'm trying to make a simple app that plays a number of samples and forms a beat, baed on which buttons on the screen are pressed, think like fruity loops. But perhaps a screenshot of my unfnished GUI makes things a bit more clear:
    [http://www.speedyshare.com/794260193.html]
    Anyway, on pressing the play button, I start building an arraylist with all the selected samples and start playing them. Once the end of the "screen" is reached it should start playing again, this is the while loop:
    public void run(){
            //System.out.println("Wavfiles.size =" + getWavfiles().size());
            System.out.println(repeatperiod);
            if (getWavfiles() == null) {
                System.out.println("Error: list of Wavfiles is empty, cannot start playing.");
            else{
                if(!active) return;
                while(active){
                    System.out.println("Wavfiles.size =" + getWavfiles().size());
                    for (int i=0; i<getWavfiles().size(); i++){
                        Wavplayer filePlayer = new Wavplayer(getWavfiles().get(i).getStream());
                        Timer timer = new Timer();
                        //timer.scheduleAtFixedRate(filePlayer, getWavfiles().get(i).getStartTime(),repeatperiod);
                        timer.schedule(filePlayer, getWavfiles().get(i).getStartTime());
                    try {
                        Thread.sleep(repeatperiod);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(LineBuilder.class.getName()).log(Level.SEVERE, null, ex);
        }But once the second iteration should begin, I'm getting nullpointerexceptions. These nullpointerexceptions come exactly when the second period starts so I suppose the sleep works :-) The nullpointerexception comes from the wavfile I try to play. Wavfile class:
    package BeatMixer.audio;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import java.util.TimerTask;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioInputStream;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.DataLine;
    import javax.sound.sampled.LineUnavailableException;
    import javax.sound.sampled.SourceDataLine;
    import javax.sound.sampled.UnsupportedAudioFileException;
    public class Wavplayer extends TimerTask {
            private SourceDataLine auline;
            private AudioInputStream audioInputStream;
         private final int EXTERNAL_BUFFER_SIZE = 524288; // 128Kb
         public Wavplayer(ByteArrayInputStream wavstream) {
              try {
                   audioInputStream = AudioSystem.getAudioInputStream(wavstream);
              } catch (UnsupportedAudioFileException e1) {
                   e1.printStackTrace();
                   return;
              } catch (IOException e1) {
                   e1.printStackTrace();
                   return;
                    AudioFormat format = audioInputStream.getFormat();
              DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
                    try {
                   auline = (SourceDataLine) AudioSystem.getLine(info);
                   auline.open(format);
              } catch (LineUnavailableException e) {
                   e.printStackTrace();
                   return;
              } catch (Exception e) {
                   e.printStackTrace();
                   return;
        @Override
         public void run() {
                    System.out.println(auline);
              auline.start();
              int nBytesRead = 0;
              byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];
              try {
                   while (nBytesRead != -1) {
                        nBytesRead = audioInputStream.read(abData, 0, abData.length);
                        if (nBytesRead >= 0)
                             auline.write(abData, 0, nBytesRead);
              } catch (IOException e) {
                   e.printStackTrace();
                   return;
              } finally {
                   auline.drain();
                   auline.close();
    }auline is null on second iteration, in fact, getAudioInputStream doesn't really work anymore, and I don't know why because I don't change anything about my list of wavfiles as far as I know... Any thoughts or extra info needed?
    Edited by: Lorre on May 26, 2008 12:22 PM

    Is my question not clear enough? Do you need more info? Or is nobody here familiar with javax.sound.sampled?
    Edited by: Lorre on May 26, 2008 2:07 PM

  • Problems with repainting

    Hi,
    I have a JFrame, which contains a JPanel (named activePanel). I also added a method to change the active JPanel. It goes like this:
    public class MyFrame extends JFrame {
    private JPanel activePanel;
    public void setActivePanel(JPanel otherPanel) {
    activePanel.setVisible(false);
    activePanel = otherPanel;
    activePanel.revalidate();
    activePanel.setVisible(true);
    this.getContentPane().validate();
    this.getContentPane().repaint();
    System.out.println("finished!"); // for debugging only
    The problem is that when this method is called, the current activePanel becomes invisible, the 'finished'-string is printed, but the otherPanel is still not showing...
    What is going wrong? What can I do?
    TIA

    Hello!
    I think you would like to replace the active panel
    with another panel.
    There are two methods to do this:
    1.
    Remove the panel from the frame and then add the new
    panel to the frame
    2.
    Use CardLayout manager instead. It is very fine!
    This layout manager lays out components like cards in deck.
    Only one 'card' can be shown at a time (int this situation the activePanel).
    You can use the show(Container c, String name) method
    to switch between panels.
    I have used this layout manager in my project and it works
    fine.
    Hope it helps you
    regards
    Feri

  • Problem with very simple 2 threads java application

    Hi,
    As fa as i'm concerned this is a thread licecycle:
    1. thread created: it is dead.
    2. thread started: it is now alive.
    3. thread executes its run method: it is alive during this method.
    4. after thread finishes its run method: it is dead.
    No I have simple JUnit code:
    public void testThreads() throws Exception {
    WorkTest work = new WorkTest() {
    public void release() {
    // TODO Auto-generated method stub
    public void run() {
    for (int i=0;i<1000;i++){
    log.debug(i+":11111111111");
    //System.out.println(i+":11111111111");
    WorkTest work2 = new WorkTest() {
    public void release() {
    // TODO Auto-generated method stub
    public void run() {
    for (int i=0;i<1000;i++){
    log.debug(i+":22222222222");
    Thread workerThread = new Thread(work);
    Thread workerThread2 = new Thread(work2);
    workerThread.start();
    //workerThread.join();
    workerThread2.start();
    //workerThread2.join();
    And
    public interface WorkTest extends Runnable {
    public abstract void release();
    And that's it..
    On the console I see 999 iterations of both threads only if i uncomment
    //workerThread.join();
    //workerThread2.join();
    In other case I see random number of iterations - JUNIT finishes and Thread1 made 54 and Thread2 233 iterations - the numbers are different every time i start the JUnit..
    What I want? Not to wait until the first one finishes - I want them to start at the same time and they must FINISH their tasks...
    Please help me asap :(

    This is very simple... Look at your code:
    workerThread.start();
    workerThread.join();
    workerThread2.start();
    workerThread2.join();What are you doing here? You start the first thread, then you call join(), which waits until it finishes. Then after it's finished, you start the second thread and wait until it finishes. You should simply do this:
    workerThread.start();
    workerThread2.start();
    workerThread.join();
    workerThread2.join();I.e., you start the 2 threads and then you wait (first for the first one, then for the second one).

  • To buy or not to buy in USA for use in UK , will I have problems with voltage ,should I buy  UK cable or just use adapter?l I

    I 'm off to the USA shortly and am wondering if I should buy my MacBook pro 15 over there. I will be saving about £300 but will I have to use a UK adapter to charge from power or can I buy a UK voltage cable to fit straight to the MacBook .
    I 'm new to Mac but love my iPhone &amp; iPad so would be glad of any advice please.

    tjk wrote:
    Csound1 wrote:
    VAT does not apply but import duty does (and probably state/city sales taxes in the US), after import duties you'll find your savings to be closer to 100 pounds sterling, I send my son MBP's from the USA constantly but there is no significant saving anymore.
    Message was edited by: Csound1
    100 pounds is not a significant savings??? You and I may have different value systems.
    I guess that came out a little wrong last time I sent one it was a 13" i5MBP, with shipping, taxes and import it was 78 pounds cheaper than in the UK, 3 pounds for an adaptor for the power supply made it a round 75 pounds, it took 8 days and was in perfect condition so .. you pays yer money and you makes yer choice.

  • Having problems with repaint (I think).

    Hi,
    Im trying to ceate a form which display's all images in the current directory as thumbnails. The problem is that when the form is shown, the images don't remain visible. Any idea how to fix this?
    (Simplified version):
    import javax.swing.JFrame;
    import javax.swing.BoxLayout;
    public class FrmMain extends JFrame
       public FrmMain()
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.X_AXIS));
          setBounds(0,0,600,400);
       public static void main(String[] args)
          FrmMain formMain = new FrmMain();
          ImagePanel imagePanel1 = new ImagePanel(".\\test01.jpg");
          ImagePanel imagePanel2 = new ImagePanel(".\\test02.jpg");
          formMain.getContentPane().add(imagePanel1);
          formMain.getContentPane().add(imagePanel2);
          formMain.setVisible(true);
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import javax.imageio.ImageIO;
    import javax.swing.BorderFactory;
    import javax.swing.JPanel;
    public class ImagePanel extends JPanel
       public ImagePanel(String fileName)
          this.fileName = fileName;
          setBorder(BorderFactory.createEtchedBorder());
          setBounds(0,0,WIDTH,HEIGHT);
       public void paint(Graphics g)
          super.paint(g);
          File file = new File(fileName);
          if(file.exists())
             try
                BufferedImage buffImage = ImageIO.read(file);
                Image image = getThumbnail(buffImage);
                Graphics2D g2d = (Graphics2D)getGraphics();
                g2d.setColor(Color.BLACK);
                g2d.fillRect(0,0,WIDTH,HEIGHT);
                g2d.drawImage(image, (WIDTH - image.getWidth(null)) / 2, (WIDTH - image.getHeight(null)) / 2, null);
             catch(Exception e)
                System.out.println(e);
       private Image getThumbnail(BufferedImage buffImage)
          int newHeight = 0;
          int newWidth = 0;
          int remain = 0;
          if (buffImage.getHeight() > HEIGHT)
             remain = buffImage.getHeight() - HEIGHT;
             remain = (int)((remain / (double)(buffImage.getHeight())) * 100);
             newHeight = HEIGHT;
             newWidth = (int)(buffImage.getWidth() * ((100 - (double)remain) / 100));
          if (newWidth > WIDTH)
             remain = newWidth - WIDTH;
             remain = (int)((remain / (double)newWidth) * 100);
             newWidth = WIDTH;
             newHeight = (int)(newHeight * ((100 - (double)remain) / 100));
          return buffImage.getScaledInstance(newWidth, newHeight, BufferedImage.SCALE_SMOOTH);
       public static int WIDTH = 100;
       public static int HEIGHT = 100;
       private String fileName;
       public String getFileName()
          return fileName;
       public void setFileName(String fileName)
          this.fileName = fileName;
          update(getGraphics());
    }

    Hmmz, didn't know a JLabel could be used to display an image... until now. Thanks for your advice camickr, this solutions gives a good result.
    import javax.swing.JFrame;
    import javax.swing.BoxLayout;
    public class FrmMain extends JFrame
       public FrmMain()
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.X_AXIS));
          setBounds(0,0,600,400);
       public static void main(String[] args)
          FrmMain formMain = new FrmMain();
          Thumbnail one = new Thumbnail(".\\test01.jpg", 10);
          Thumbnail two = new Thumbnail(".\\test02.jpg", 10);
          Thumbnail three = new Thumbnail(".\\test03.jpg", 10);
          Thumbnail four = new Thumbnail(".\\test04.gif", 10);
          formMain.getContentPane().add(one);
          formMain.getContentPane().add(two);
          formMain.getContentPane().add(three);
          formMain.getContentPane().add(four);
          formMain.setVisible(true);
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Dimension;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import javax.imageio.ImageIO;
    import javax.swing.BorderFactory;
    import javax.swing.JLabel;
    import javax.swing.ImageIcon;
    public class Thumbnail extends JLabel
       public Thumbnail(String fileName, int borderSpace)
          this.fileName = fileName;
          setOpaque(true);
          setBorder(BorderFactory.createEmptyBorder(borderSpace, borderSpace, borderSpace, borderSpace));
          thumbnail = getThumbnail();
          setIcon(new ImageIcon(thumbnail));
       private Image getThumbnail()
          int newHeight = 0;
          int newWidth = 0;
          int remain = 0;
          File file = new File(fileName);
          BufferedImage buffImage = null;
          BufferedImage result = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_BGR);
          Image tempImg = null;
          Graphics2D g2d = (Graphics2D)result.getGraphics();
          g2d.setColor(Color.BLACK);
          g2d.fillRect(0,0,WIDTH,HEIGHT);
          if(file.exists())
             try
                buffImage = ImageIO.read(file);
             catch(Exception e)
                System.out.println(e);
                return null;
             if (buffImage.getHeight() > HEIGHT)
                remain = buffImage.getHeight() - HEIGHT;
                remain = (int)((remain / (double)(buffImage.getHeight())) * 100);
                newHeight = HEIGHT;
                newWidth = (int)(buffImage.getWidth() * ((100 - (double)remain) / 100));
             if (newWidth > WIDTH)
                remain = newWidth - WIDTH;
                remain = (int)((remain / (double)newWidth) * 100);
                newWidth = WIDTH;
                newHeight = (int)(newHeight * ((100 - (double)remain) / 100));
          tempImg = buffImage.getScaledInstance(newWidth, newHeight, BufferedImage.SCALE_SMOOTH);
          g2d.drawImage(tempImg, (WIDTH - tempImg.getWidth(null)) / 2, (WIDTH - tempImg.getHeight(null)) / 2, null); 
          return (Image)result;
       public static int WIDTH = 100;
       public static int HEIGHT = 100;
       private String fileName;
       public String getFileName()
          return fileName;
       public void setFileName(String fileName)
          this.fileName = fileName;
          thumbnail = getThumbnail();
          setIcon(new ImageIcon(thumbnail));
       private Image thumbnail;
    }

  • Problem with S-raw from 1Ds mark III and Lightroom 2.5 (ACR 5.5)

    Hello,
    We develop over 100000 Raws per day using Lightroom 2.5 and a Canon 1 ds mark III. For the past six months we have been using the S-raw format for compatibility with our program Workflow. We’ve been having stability problems linked to luminosity, particularly differences in yellows, reds, oranges, and beiges.
    This artefact lightens the whole of the image, which gives us several light densities within the same image series.
    We’ve done several tests with photos shot in S-raw and JPEG simultaneously. The problem does not appear in the JPEGs, or in JPEGs generated by the S-raw format.
    This is why we have concluded that the problem comes from Lightroom’s calculation algorithm for S-raw. This hypothesis is confirmed as the problem is only in Lightroom 2.5 (we’ve tested 5 competing programmes and have not had the same problem).
    Ciao.

    Problems with Lightroom should be posted in the Lightroom forum.
    If you are having similar problems with some version of ACR, check the FAQ (http://forums.adobe.com/thread/311515?tstart=0) and provide more details, samples, etc... in a later post.

Maybe you are looking for