Mysterious null pointers during Applet.paint(g)

I'm working with the paint function of my applet, which uses double buffering, and I occassionally get an odd null pointer exception, which does not halt its excution, but I believe may be linked to some other unusual behavior regarding components not being painted correctly.
I've been staring at this thing for a while now and I am completely out of ideas.
For debugging purposes, I've expressly checked each object invovled in the painting to ensure that it isn't null, but the exception is still being thrown and java is telling me that the exception is being trown on line numbers that have only a closing brace (see code)
Any help is much appreciated
Here's the code... state is an extension of Container and loading is just a label to display when I'm changing different containers in and out of state
       public void paint(Graphics g) {
          if(offscreen == null) offscreen = createImage(500, 480);
          else {
                  Graphics g1 = offscreen.getGraphics();
                  if(!dontPaint) {
                    if(loading != null && loading.isVisible()) loading.setVisible(false);
                    if(state!=null) state.paint(g1);
               else {
                    if(g1 != null) {
                         g1.setColor(Color.black);
                         g1.fillRect(0, 0, 500, 480);
                    if(!loading.isVisible() && loading!=null) loading.setVisible(true);
                  if(g != null) g.drawImage(offscreen, 0, 0, null);
        }here's an example of the errors:
java.lang.NullPointerException
        at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:48)
        at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:715)
        at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:147)
        at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2782)
        at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2772)
        at StarDart.paint(StarDart.java:113)
        at StarDart.update(StarDart.java:96)
        at sun.awt.RepaintArea.paint(RepaintArea.java:172)
        at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
        at java.awt.Component.dispatchEventImpl(Component.java:3586)
        at java.awt.Container.dispatchEventImpl(Container.java:1437)
        at java.awt.Component.dispatchEvent(Component.java:3367)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:190)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:144)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

I do have a thread which is always running; I use the Runnable interface. Here is my run() function:
     public void run() {
          while(!stopRunning) {
               for(; sessionInput(); state.handleInput(inBuf));
                       repaint();
                    try {
                               Thread.sleep(100L);
                    } catch(InterruptedException interruptedexception) { System.out.println(interruptedexception); }
          }The for loop manages my networking code. Should I be putting the call to repaint() in a try block?
Does this have something to do with synchronization?

Similar Messages

  • Applet paint over-writing...

    Hello,
    Im new to applet programming, I have done quite a bit of java - console based. Anyway my problem is:
    I have an applet which has some buttons and some drawing things on it. I want inside this applet some like sub interfaces - my first thing that comes to mind is either a panel or canvas. How can this panel or canvas to re-paint by itself without overwritting the main applet paint method

    create a thread, that is the best way and gives you lots of design flexibility. But be careful about thread handling...all the best

  • SetBounds method is not working - settings change after Applet paint()

    Hello,
    I'm creating an applet with a scrollbar on it. I'm using Scrollbar.setBounds to set its position and dimension. These values are correct at the end of the init() method, but when the paint() method starts executing, these values have changed!
    Here's my code :
    import java.awt.Graphics;
    import java.awt.Scrollbar;
    public class testSetBounds extends java.applet.Applet {
      Scrollbar sb;
      public void init(){
        sb = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 270);
        sb.setBounds(10, 200,300,10) ;
        this.add(sb);
        System.out.println("sb.getWidth() " + sb.getWidth() );
        System.out.println("sb.getBounds().x " + sb.getBounds().x  ) ;
      public void paint(Graphics g){
        System.out.println("paint...") ;
        System.out.println("sb.getWidth (at start of paint()) " + sb.getWidth() );
        System.out.println("sb.getBounds().x " + sb.getBounds().x  ) ;
        System.out.println("sb.getMaximum() " + sb.getMaximum()) ;
    <html>
    <body>
    <applet code="testSetBounds" codebase="classes" width="300" height="350">
    </applet>
    </body>
    </html>
    The output I get on the Java Console is:
    sb.getWidth() 300
    sb.getBounds().x 10
    paint...
    sb.getWidth (at start of paint()) 50
    sb.getBounds().x 125
    Can anyone tell me what's going on?
    How to make my scrollbar remain in the position and with the dimensions I specified?
    Thank you very much.

    The layout manager is setting the bounds. If fo some obscure reason you want to do all the layout yourself then -
    Hello,
    I'm creating an applet with a scrollbar on it. I'm
    using Scrollbar.setBounds to set its position and
    dimension. These values are correct at the end of the
    init() method, but when the paint() method starts
    executing, these values have changed!
    Here's my code :
    import java.awt.Graphics;
    import java.awt.Scrollbar;
    public class testSetBounds extends java.applet.Applet
    Scrollbar sb;
    public void init(){
    sb = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0,
    , 0, 270);
    sb.setBounds(10, 200,300,10) ;this.setLayout(null);
    this.add(sb);
    System.out.println("sb.getWidth() " +
    " + sb.getWidth() );
    System.out.println("sb.getBounds().x " +
    " + sb.getBounds().x ) ;
    public void paint(Graphics g){
    System.out.println("paint...") ;
    System.out.println("sb.getWidth (at start of
    t of paint()) " + sb.getWidth() );
    System.out.println("sb.getBounds().x " +
    " + sb.getBounds().x ) ;
    System.out.println("sb.getMaximum() " +
    " + sb.getMaximum()) ;
    <html>
    <body>
    <applet code="testSetBounds" codebase="classes"
    width="300" height="350">
    </applet>
    </body>
    </html>
    The output I get on the Java Console is:
    sb.getWidth() 300
    sb.getBounds().x 10
    paint...
    sb.getWidth (at start of paint()) 50
    sb.getBounds().x 125
    Can anyone tell me what's going on?
    How to make my scrollbar remain in the position and
    with the dimensions I specified?
    Thank you very much.

  • Java Applet painting outside it's borders?!

    Hello all, I have a java applet that is painting outside of it's bordors in Firefox and IE, only when scrolling does this occur. I have been searching around and found a bug which was submitted in 2006 for the same issue but cannot see any resolution or further issues. I imagine there must be a workaround as this would be quite a major issue if it was always the case. It only happens when scrolling and the applet is being repainted. Any ideas?
    Thanks
    Dori

    here we go!
    package main;
    import javax.swing.JApplet;
    public class Test extends JApplet
         private GamePanel gamePanel;
        public Test()
        public void init()
        public void start()
            //create a new GamePanel
             gamePanel = new GamePanel();
             //add the panel to the contentPane
             this.getContentPane().add(gamePanel);
        }//EOM
        public void stop()
             gamePanel.stopTimer();
        public void destroy()
            System.out.println("preparing for unloading...");
    }and
    package main;
    import java.awt.Dimension;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.util.Timer;
    import java.util.TimerTask;
    import javax.swing.JPanel;
    public class GamePanel extends JPanel{
         private static final int PWIDTH = 400;
         private static final int PHEIGHT = 400;
         private StringBuffer buffer;
         private int clickCounter = 0;
         private static final int FONTSIZE = 100;
         //timer period in ms
         private static final int PERIOD = 100;
         //game length (seconds)
         private static final int GAME_LENGTH = 5;
         //for the timer
         private long startTime;
         //image for Double buffering
         private Image dbImage = null;
         //timer
         Timer t = null;
         private boolean debug = true;
         private boolean gameRunning = false;
         public GamePanel(){
              setBackground(Color.gray);
              setSize( new Dimension(PWIDTH, PHEIGHT));
              setFocusable(true); //to receive key events
             requestFocus();
             addMouseListener( new MouseAdapter() {
                public void mousePressed(MouseEvent e)
                { doMouseAction(); }
             setUpNewGame();
         }//EOC
         public void setUpNewGame(){
             //set gameRunning to true, affects click actions
             gameRunning = true;
             //set counter to 0
             clickCounter = 0;
            MyTimerTask task = new MyTimerTask();
            t = new Timer();
            t.scheduleAtFixedRate(task,0,PERIOD);
            //for the timer
            startTime = System.currentTimeMillis();
        }//EOM
          private void doMouseAction(){
             if(gameRunning == true){
                  incrementCounter();
             else if(gameRunning == false){
                  setUpNewGame();
         }//EOM
          public void stopTimer(){
               t.cancel();
              System.out.println("Timer stopped!");
          public void timesUp(){
             //stop the timer
             stopTimer();
             //set game running to false
             gameRunning = false;
             //show gameover message
             //overwrite dbimage with score
            Graphics dbg = dbImage.getGraphics();
             //clear the image
             dbg.setColor(Color.gray);
             dbg.fillRect(0, 0, getWidth(), getHeight());
             //write the score
             dbg.setColor(Color.white);
             dbg.drawString("Your score was "+clickCounter+" clicks in "+GAME_LENGTH+" secs", 10, 40);
             //draw this to screen
             repaint();
         public void paintComponent(Graphics g)
            super.paintComponent(g);
             g.drawImage(dbImage, 0, 0, null);
        //draw to dbImage
        public void renderImage(){
             //for debug only
            long startRenderTime = System.nanoTime();
             //this will be removed, on init it should take the attributes from the html
             //and create the dbimage only once with these params
            //out(""+dbImage);
             dbImage = createImage(getWidth(), getHeight());
             out(dbImage+","+getWidth()+","+getHeight());
             Graphics dbg = dbImage.getGraphics();
             //this code should be here
             dbg.setColor(Color.gray);
             dbg.fillRect(0,0, getWidth(), getHeight());
             dbg.setColor(Color.white);
            dbg.setFont(new Font("ARIAL BOLD",Font.PLAIN,FONTSIZE));
            dbg.drawString(""+clickCounter,(getWidth()/2),(getHeight()/2));
            //draw timer
            dbg.setFont(new Font("ARIAL",Font.PLAIN,15));
            //calc time
            long currentTime = System.currentTimeMillis() - startTime;
            //for display in secs
            float floatTime = (float)((int)(currentTime/100f))/10f;
            dbg.drawString(""+floatTime, 10, getHeight()-10);
            //dbg.dispose();//test
            if(false){ //test for game over here
                 //draw game over stuff here
            if(debug){
                 //in ms
                 long totalRenderTime = (System.nanoTime() - startRenderTime)/1000000L;
                 System.out.println("Total Render Time = "+totalRenderTime+" ms, allowed "+PERIOD+"ms");
        }//EOM
        public void incrementCounter(){
             clickCounter++;
         private class MyTimerTask extends TimerTask{     
             public void run(){
                  renderImage();
                  repaint();
                  if(System.currentTimeMillis()-startTime >= GAME_LENGTH*1000){
                       //stop the game
                       timesUp();
        }//End of inner class
          * Debugging method
          * @param out
         private void out(String out){
              System.out.println(out);
    }//End of class

  • [OWB 11.1.0.7.0]: Null Pointer during the creation of a table object

    Hello,
    I have a very serious problem during our migration to Oracle 11.
    After installing the database, creating the owb repository schema and starting the owb client, I tried to create a simple table and got a null pointer exception (see below). I also imported some data from our productive enviroment with Oracle 10, just to have some tables in the owb enviroment. Unfortunatley the same exception is thrown when I am trying to open the editor window for the data object.
    The system is:
    - Microsoft Windows Server 2008
    - Oracle Database / OWB Repository Client and Server 11.1.0.7.0
    A complete reinstallation of the database software did not help, the error is reproduceable.
    Unfortunately metalink could not help us eather, no one seems to have this problem so far. Currently there are two occurances of the error API5072:
    API5072 When Attempting to Open Control Center Manager
    API5072 Error When Deploying Process Flow to Two Different Workflow Schema Installed On The Same Database Instance
    The problem I have is independent of the workflow schema (it happens with and without a workflow schema) and is independent of the locale.
    There seems to be no patch and I am running out of ideas. Can anyone thinks of anything I can try to get the system running?
    Tank you!
    Markus Schneider
    StackTrace:
    java.lang.RuntimeException: Cannot invoke method handleTableInspector in class oracle.wh.ui.enterprise.schemaeditor.EditViewMenuEventHandler
         at oracle.wh.ui.editor.listener.ReflectListener.invokeMethod(ReflectListener.java:43)
         at oracle.wh.ui.editor.listener.ReflectItemListener.itemStateChanged(ReflectItemListener.java:33)
         at javax.swing.AbstractButton.fireItemStateChanged(AbstractButton.java:1877)
         at javax.swing.AbstractButton$Handler.itemStateChanged(AbstractButton.java:2176)
         at javax.swing.DefaultButtonModel.fireItemStateChanged(DefaultButtonModel.java:477)
         at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:233)
         at javax.swing.AbstractButton.setSelected(AbstractButton.java:274)
         at oracle.wh.ui.editor.Editor.addDockablePanel(Editor.java:175)
         at oracle.wh.ui.editor.Editor.addDockablePanel(Editor.java:167)
         at oracle.wh.ui.enterprise.schemaeditor.schemaEditor.displayInitialPanels(schemaEditor.java:1094)
         at oracle.wh.ui.enterprise.schemaeditor.schemaEditor._init(schemaEditor.java:435)
         at oracle.wh.ui.editor.Editor.init(Editor.java:1115)
         at oracle.wh.ui.editor.Editor.showEditor(Editor.java:1431)
         at oracle.wh.ui.enterprise.schemaeditor.schemaEditor.showEditor(schemaEditor.java:389)
         at oracle.wh.ui.owbcommon.IdeUtils._tryLaunchEditorByClass(IdeUtils.java:1437)
         at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1350)
         at oracle.wh.ui.owbcommon.IdeUtils.showEditor(IdeUtils.java:720)
         at oracle.wh.ui.console.commands.CreateByEditorCmd.showUI(CreateByEditorCmd.java:48)
         at oracle.wh.ui.console.commands.CreateCmd.performAction(CreateCmd.java:79)
         at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Caused by: java.lang.NoSuchMethodError: oracle.wh.ui.owbcommon.WhSpreadTable.setAutoResize(Z)V
         at oracle.wh.ui.owbcommon.WhSpreadTable.init(WhSpreadTable.java:381)
         at oracle.wh.ui.owbcommon.WhSpreadTable.<init>(WhSpreadTable.java:103)
         at oracle.wh.ui.owbcommon.WhSpreadTable.<init>(WhSpreadTable.java:96)
         at oracle.wh.ui.owbcommon.WhSpreadTablePanel.jbInit(WhSpreadTablePanel.java:65)
         at oracle.wh.ui.owbcommon.WhSpreadTablePanel.<init>(WhSpreadTablePanel.java:48)
         at oracle.wh.ui.owbcommon.WhSpreadTablePanel.<init>(WhSpreadTablePanel.java:35)
         at oracle.wh.ui.enterprise.schemaeditor.propertyPanelBase.<init>(propertyPanelBase.java:1488)
         at oracle.wh.ui.enterprise.schemaeditor.TablePropertyPanel.<init>(TablePropertyPanel.java:26)
         at oracle.wh.ui.enterprise.schemaeditor.RelationalPropertyPanel.<init>(RelationalPropertyPanel.java:38)
         at oracle.wh.ui.enterprise.schemaeditor.EditViewMenuEventHandler.initDetailPanel(EditViewMenuEventHandler.java:472)
         at oracle.wh.ui.enterprise.schemaeditor.EditViewMenuEventHandler.enableDisableTableInspector(EditViewMenuEventHandler.java:498)
         at oracle.wh.ui.enterprise.schemaeditor.EditViewMenuEventHandler.handleTableInspector(EditViewMenuEventHandler.java:461)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.wh.ui.editor.listener.ReflectListener.invokeMethod(ReflectListener.java:41)
         ... 26 more
    java.lang.NullPointerException
         at oracle.wh.ui.owbcommon.IdeUtils._tryLaunchEditorOldWay(IdeUtils.java:1507)
         at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1352)
         at oracle.wh.ui.owbcommon.IdeUtils.showEditor(IdeUtils.java:720)
         at oracle.wh.ui.console.commands.CreateByEditorCmd.showUI(CreateByEditorCmd.java:48)
         at oracle.wh.ui.console.commands.CreateCmd.performAction(CreateCmd.java:79)
         at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    oracle.wh.util.Assert: API5072: Internal Error: Null message for exception. Please contact Oracle Support with the stack trace and details on how to reproduce it.
         at oracle.wh.util.Assert.owbAssert(Assert.java:51)
         at oracle.wh.ui.jcommon.OutputConfigure.showMsg(OutputConfigure.java:216)
         at oracle.wh.ui.common.CommonUtils.error(CommonUtils.java:371)
         at oracle.wh.ui.console.commands.TreeMenuHandler.error(TreeMenuHandler.java:132)
         at oracle.wh.ui.console.commands.TreeMenuHandler.error(TreeMenuHandler.java:121)
         at oracle.wh.ui.console.commands.CreateCmd.performAction(CreateCmd.java:86)
         at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Hi
    Connect in SQLPLUS as the repository owner and use the OWB_HOME/owb/rtp/sql/service_doctor.sql script to check the status of the Control Center Service.
    If still does not work .
    Try to restart the database.
    that is the last option.

  • Loading icons during applet class init

    I load a bunch of icons thusly:
        ImageIcon[] typeIcons = {
            null,
            createImageIcon("context_icon", "Context"),
            createImageIcon("featureset_icon", "featureset"),
            createImageIcon("format_icon", "format"),
            createImageIcon("raster_icon", "grid"),
            createImageIcon("projection_icon", "projection")
        static ImageIcon createImageIcon(String name, String alt) {
            URL url = FeatureEditor.class.getResource(name + ".png");
            if(url == null)
                throw new IllegalArgumentException("No such image as " + name);
            return new ImageIcon(url, alt);
        }And display them as table cells.
    That works ok, but why does it go screwy on me if I make the typeIcons array static? (The TableCellRenderer complains that the objects are of the wrong type).
    I can't see why icon loading can't be initiated during class initialisation rather than in object initialisation.

    Where the method is defined in the source code won't help- it will get called during the initialisation of the array just as before. Is there really no other class object available that you can use instead for the base of your resources? If there's nothing else in your package, then use Object.class and give the full path, rather than a relative one (assuming you're using the default class loader).
    Pete

  • Firefox freezes when clicking away during applet load

    I have an applet that, upon startup, reads in a large amount of initial data. While this startup read usually only takes about 10 seconds, if a user clicks on a regular HTML link on the page during this initial loading of the java applet then Firefox will freeze.
    I've tried adding some focus/component listeners to see if an event gets fired when the page is navigated away from and thus shut down all the data readers, but to no avail. I would assume that no such event occurs.
    Is this just a Firefox bug or is there a workaround?
    Many thanks
    Si

    slyadams wrote:
    I have an applet that, upon startup, reads in a large amount of initial data. While this startup read usually only takes about 10 seconds, if a user clicks on a regular HTML link on the page during this initial loading of the java applet then Firefox will freeze.
    Is there a workaround?Can you not do micro-initialisation - launch another thread to do the donkey work for the next 10 seconds (or more) - but have all your listeners and stuff up and running, or will that not make a difference?

  • Java Applet painting broken in IE11 and Windows 8.1

    When running a Java applet in Internet Explorer 11 window on Windows 8.1, JRE fails to repaint the viewport correctly when the web browser window is resized or scrolled. (assuming the Java Applet has display dimensions larger than the window, necessitating the need to resize or scroll host IE window). Webpage is displaying the java applet using any of OBJECT or EMBED tags. 
    This JRE behavior prevents the user from interacting successfully with the Java Applet (typically input data fields or click buttons in applet) should user need to resize or scroll the window.
    This bug only occurs on IE11 on Windows 8.1 with JRE 7 and JRE 8 (include 8u31)
    This bug does not occur on  IE11 on Windows 7,  IE10 on Windows 7 / 8 ,  Firefox on Windows  7 / 8 / 8.1 ,  Google Chrome on Windows  7 / 8 / 8.1
    This bug has also been posted to the IE Feedback website since 2013 as we do not know if this is to be resolved by Oracle or Microsoft.
    With the upcoming removal of Java Plugin support in Google Chrome, and, with this JRE bug (or incompatibility?) in IE11 Windows 8.1, this leaves only Firefox as the only usable web browser for Java Applets on Windows 8.1.  Our customer base on Windows 8.1 is only using IE11 or Chrome.  

    I am seeing a minor issue with the timesheet grid after users are upgraded from IE8 to IE11.
    We are using Project Server 2010 with SP1 and Oct 2013 CU.
    When some users (using IE11) switches between filters or views in the Timesheet page, the grid shrinks making to content un readable.  The only way to get it back is to refresh the page. After a refresh, the grid returns to normal size, but the pane
    divider is too far to the left and always must be dragged to the right in order to see the task names in the left grid. 

  • Applet Painting and Repainting

    I have two issues that I think to be related and hope that someone may be able to shed some light on this. I have a problem with an applet that is running within a JSP page. At initial loading, the applet randomly displays with a blank page. If I reload the jsp page from the browser the applet will recover and display appropriately. This happens on both Internet Exploder and Firefox browsers.
    I also have a problem with Components within the applet that, I hope, are related. I have a JTable component that, when I make changes to it, it manages to refresh, but not completely. Some of the data that has changed doesn't refresh but the rest of it does. Again, if I refresh the applet pane the value restore to what is expected.
    I have a repaint call in place at each instance, but that is not working. Are there any suggestions or maybe something else I can try to get this to work as expected. I am fairly inexperienced with applets so any advise and detail would be greatly appreciated.

    You probably can't do this with threads. Rule #1 of threading is that you cannot determine the order of execution, and you basically have no control over this. If you need the images and sound to be displayed sequentially, then by all means download them or load them with separate threads. But you must display them in the same thread to get them displayed sequentially.
    Alan

  • Sqldeveloper capturing null DB during Migration Sysbase 15 to Oracle 11g.

    I am doing offline migration from Sybase to Oracle using SQLdeveloper 3.0.02 . I have performed below steps:
    1) Create a user (without CREATE ROLE, CREATE USER, DROP ANY SEQUENCE, DROP ANY TABLE, DROP ANY TRIGGER, DROP USER, DROP ANY ROLE, GRANT ANY ROLE privileges due to security reasons I can't have these privileges. This user have all other privileges suggest as per Oracle docs)
    2) Create a migration repository
    3) Made a connection and associate the migration repository to it.
    4) Generate the offline Sybase capture files using sqldeveloper and generate the dat files having Sybase structure.
    5) Tool -> migration -> migrate -> following the wizard instructions I start the migration.
    Now the message window showing me 1) capturing connections 2) capturing catalogs and then directly migration is successful. Finally there is no error message.
    I have checked the migration project navigation window and found that sql developer has captured the null database.
    I checked the migration repository tables and found that only MD_CONNECTIONS, MD_CATALOGS and MD_DERIVATIVE tables are populated.
    Could you please suggest me why SQL developer captured the null database. ( No Sybase database objects are captured from Sybase15.ocp file)
    ASAP reply would be appreciated.
    Regards
    Abdul
    Edited by: Abdul Nazar Ali on Apr 9, 2013 9:28 AM
    Edited by: Abdul Nazar Ali on Apr 9, 2013 9:28 AM

    Hi,
    At that time SQL developer was not able to capture the connection details. The error msg was "Capturing connection failed". So we downloaded the sybase jtds driver and recaptured ocp files from sybase and run the migration again...this time capture connection is successful and capturing of cataloge is successful and after that sql developer can't able to capture any sybase db objects from sybase15.ocp
    We going to upgrade sql developer to latest version and will try it again.
    Regds,
    Abdul
    Edited by: Abdul Nazar Ali on Apr 9, 2013 2:22 PM

  • ClassNotFound error during applet inititalization

    I have developed an applet that uses HTTP tunneling to read a list of report entries in a form of a Java Collection. This applet is initiated in a browser window via the <applet> tag. The servlet runs under Tomcat.
    When both the servlet container and the browser are running on my machine, then the applet initializes correctly and reads the list of entries properly. However, when I attempt to load the page from a browser that is running on a different machine, then I get the following error:
    ClassNotFoundError: Collection not found in java.util.
    I have been able to succesfully load other applets that don't utilize the Collection class. What is so special about the Collection class? How can I go about debugging this issue?
    Thanks,
    Fotis

    As you all pointed out the problem was with the JRE. It was using an old version.
    I decided to follow the suggestion and switch to the Object tag so that the latest jre is installed on the browser machine. However, now I'm having problems initializing and rendering the applet with the Object tag.
    Below are the pre and post conversion files.
    ------------------------->> PRE Conversion <<------------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">
    <HTML>
    <TITLE>Dashboard reporting</TITLE>
    <script src="login.jsp"></script>
    <script language="JavaScript">
    checkCookie();
    </script>
    </HEAD>
    <%
    String requestId = request.getParameter("requestId");
    String requestName = request.getParameter("requestName");
    %>
    <BODY bgcolor="#FDF5E6">
    <p><br>
    <center>
    <applet code=panel.CampaignPanel
         archive="panel.jar, com.objectplanet.gui.TabbedPanel.jar, com.objectplanet.gui.Table.jar"
         width=975 height=450>
         <param name="requestId" value="<%=requestId%>" >
         <param name="requestName" value="<%=requestName%>" >
    </applet>
    </center>
    </BODY>
    </HTML>
    -------------------------->> POST Conversion <<----------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">
    <HTML>
    <TITLE>Dashboard reporting</TITLE>
    <script src="login.jsp"></script>
    <script language="JavaScript">
    checkCookie();
    </script>
    </HEAD>
    <%
    String requestId = request.getParameter("requestId");
    String requestName = request.getParameter("requestName");
    %>
    <BODY bgcolor="#FDF5E6">
    <p><br>
    <center>
    <!--"CONVERTED_APPLET"-->
    <!-- HTML CONVERTER -->
    <OBJECT classid="clsid:E19F9331-3110-11d4-991C-005004D3B3DB"
    WIDTH = 975 HEIGHT = 450 codebase="http://javaweb.eng/plugin/jre-1_4-win.exe#Version=1,4,0,0">
    <PARAM NAME = CODE VALUE = panel.CampaignPanel >
    <PARAM NAME = ARCHIVE VALUE = "panel.jar, com.objectplanet.gui.TabbedPanel.jar, com.objectplanet.gui.Table.jar" >
    <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.0_02">
    <PARAM NAME="scriptable" VALUE="false">
    <PARAM NAME = "requestId" VALUE ="<%=requestId%>" >
    <PARAM NAME = "requestName" VALUE ="<%=requestName%>" >
    </OBJECT>
    <!--
    <APPLET CODE = panel.CampaignPanel ARCHIVE = "panel.jar, com.objectplanet.gui.TabbedPanel.jar, com.objectplanet.gui.Table.jar" WIDTH = 975 HEIGHT = 450>
    <PARAM NAME = "requestId" VALUE ="<%=requestId%>" >
    <PARAM NAME = "requestName" VALUE ="<%=requestName%>" >
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->
    </center>
    </BODY>
    </HTML>
    The PRE-Conversion .jsp succesfully loads the applet. The POST-Conversion file though displays an empty frame.
    Any thoughts?
    Thanks,
    Fotis

  • EOF exception during applet - servlet communication

    I am developing a system for the US Gov't. This system currently
              utilizes several applets which access corresponding servlets on
              WebLogic. Seemingly, things went wrong for no apparent reason this
              morning. When, trying to run our applets, WebLogic throws an exception:
              "Caught EOFException in the stream header" These exceptions occur
              everytime the servlet would open the input stream from the applet. What
              makes things mind-boggling is that these applets/servlets were working
              this morning, and suddenly now give these exceptions. The code for both
              the applets and servlets has not been touched in weeks. Furthermore, i
              tested even further by running WebLogic locally and running the applets
              in our IDE (as applications) and the same results occur. I am running
              WebLogic 5.1 SP6 on both the remote and local system and am utilizing
              JDK 1.3 on both as well. The server is running on WinNT SP6 and locally
              is Win2000 Pro SP1. These applets are critical to the entire system and
              i am just totally baffled as to why something that was working fine one
              day ago should all of the sudden spit up errors and exceptions.
              If anyone can give me some insight as to what is going on, please let me
              know.
              Thank you,
              Randy Strobel
              [email protected]
              

    Randy,
              I don't know of any particular reasons why WebLogic would suddenly affect an
              application in the manner that you describe. Start by figuring out where
              the message comes from:
              > "Caught EOFException in the stream header"
              I assume that is in WebLogic's code, not yours? Figure out as close as
              possible who is detecting this error condition. If it is in WebLogic's
              code, you can ask support at BEA to tell you what it is complaining about
              (i.e. what it is expecting to read).
              You will have to post the exception trace here and it would help to see the
              code that is causing the exception.
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Randy Strobel" <[email protected]> wrote in message
              news:[email protected]...
              > I am developing a system for the US Gov't. This system currently
              > utilizes several applets which access corresponding servlets on
              > WebLogic. Seemingly, things went wrong for no apparent reason this
              > morning. When, trying to run our applets, WebLogic throws an exception:
              > "Caught EOFException in the stream header" These exceptions occur
              > everytime the servlet would open the input stream from the applet. What
              > makes things mind-boggling is that these applets/servlets were working
              > this morning, and suddenly now give these exceptions. The code for both
              > the applets and servlets has not been touched in weeks. Furthermore, i
              > tested even further by running WebLogic locally and running the applets
              > in our IDE (as applications) and the same results occur. I am running
              > WebLogic 5.1 SP6 on both the remote and local system and am utilizing
              > JDK 1.3 on both as well. The server is running on WinNT SP6 and locally
              > is Win2000 Pro SP1. These applets are critical to the entire system and
              > i am just totally baffled as to why something that was working fine one
              > day ago should all of the sudden spit up errors and exceptions.
              >
              > If anyone can give me some insight as to what is going on, please let me
              > know.
              > Thank you,
              > Randy Strobel
              > [email protected]
              >
              >
              

  • Why delete [appserverdomain]/null folder during the Livecycle Es4 configuration

    Deploying LiveCycle EARs
    This operation may take several minutes to complete. When the deployment has completed successfully, click
     Next.
    Note:  After this step, ensure that you stop the managed server, node manager, and admin server, and then start them in the reverse order. Ensure that a directory named adobe is created in [appserverdomain] after the restart. This is required so that the [appserverdomain]/null directory does not get created, which can lead to the run time issues. Delete the [appserverdomain]/null directory if it gets created.
    ❖ On the Deploy LiveCycle ES4 EARs screen, select the EAR files to deploy and then click Deploy 
    Why is that folder created if we just delete it and why do we delete it?  The null folder has an abobe folder in it that looks identicle to the [appserverdomain]/adobe.

    This issue does not occur when deploy the EARs manually.
    It occurs intermittently when deploying the EARs using LCM and it is specific to Weblogic only. Reason behind this is Weblogic (as opposed to JBoss and Websphere) does not guarantee a particular start-up order of WARs within an EAR.
    The initialization does rely on a particular start-up order.
    Thus the null folder gets created sometimes.
    Hence it is always suggested to restart the server in a particular order to ensure that intialization happens properly. In case the [appserverdomain]/null directory gets created earlier, remove it.
    Hope this answers your question.
    ~ Varun Nohria

  • Applet throws null pointer...

    I have weired problem... it was working fine. I have applet which connects to chat server from anywhere from the the browser but my own server computer. Whenever i try to load from my local machine it either throws null pointer or applet load failed error. neither it works from appletviewer.
    Remember , it works fine from anywhere else.. so all .class files etc. etc. are valid...
    Thanks

    Just in addition to above,
    actually it throws java.secrity.AccessControlException:access denied (java.net.SocketPermission "My Ip":9991 conect resolve..
    But weired thing ... from same computer when i run appletviewer from Net Beans IDE ... it connects fine to my sockets...

  • Cant get rid of text drawn with drawString, drawString only wrking in paint

    Sorry for coming back to ask for more help, but I just caught a snag that I can't get around.
    As you can see, "Press Space to start..." is drawn during the paint method. When the user presses space, the other KeyEvents are enabled, but filling a black rectangle where the text is does not hide it. If I put the clearText call before the started = false, then the other KeyEvents aren't enabled.
    Also, when I try to draw another string in win method, it doesn't show up.
    You can check out the complete applet at http://users.adelphia.net/~uberugh/Race.html
    This code compiles with no errors but requires Car.java.
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class Race extends Applet implements KeyListener {
         private Car car1;
         private Car car2;
         boolean started = false;
         private Image dbImage;
         private Graphics dbg;
         private Graphics txt;
         private Graphics g2;
         Font f = new Font("Arial", Font.PLAIN, 36);
         Font f2 = new Font("Arial", Font.PLAIN, 12);
         public void init() {
              setBackground(Color.black);
              car1 = new Car(10, 146, Color.green);
              car2 = new Car(10, 246, Color.blue);
              addKeyListener(this);
         public void paint(Graphics g) {
              g.setColor(Color.darkGray);
              g.fillRect(0, 0, 600, 100);
              g.fillRect(0, 300, 600, 100);
              g.drawLine(0, 200, 600, 200);
              g.setColor(Color.yellow);
              g.drawLine(550, 100, 550, 300);
              g.setColor(Color.red);
              g.setFont(f2);
              g.drawString("Press Space to start...", 250, 180);
              car1.drawCar(g);
              car2.drawCar(g);
         public void update(Graphics g) {
              if (dbImage == null) {
                   dbImage = createImage(this.getSize().width, this.getSize().height);
                   dbg = dbImage.getGraphics();
              dbg.setColor(getBackground ());
              dbg.fillRect(0, 0, this.getSize().width, this.getSize().height);
              dbg.setColor(getForeground());
              paint(dbg);
              g.drawImage(dbImage, 0, 0, this);
         public void keyTyped(KeyEvent e) {}
         public void keyReleased(KeyEvent e) {}
        public void keyPressed(KeyEvent e) {
              int k = e.getKeyCode();
              if (k == KeyEvent.VK_SPACE) {
                   started = true;
                   clearText(249, 159, 100, 30);
              if (started) {
                  if (k == KeyEvent.VK_G) {
                       car1.move();
                       repaint();
                       if (car1.winner) {
                            win(1, txt);
                  } else if (k == KeyEvent.VK_RIGHT) {
                       car2.move();
                       repaint();
                       if (car2.winner) {
                            win(2, txt);
         public void win(int x, Graphics g) {
              removeKeyListener(this);
              g.setColor(Color.red);
              g.setFont(f);
              g.drawString(String.valueOf("Player " + x + "wins!") , 200, 218);
              repaint();
         public void clearText(int x, int y, int width, int height) {
              g2.setColor(Color.black);
              g2.fillRect(x, y, width, height);
    }

    That's because you're trying to paint to a null, non-existent Graphics object.
    Your approach is wrong. Don't try to draw when you get the key event, because there may be nothing to draw then anyway (the GUI thread isn't in the act of drawing). Use your event handlers to set internal state of your game object (Race, or other objects as necessary like Car). Then when you draw, use that state. So use your boolean field "started". In your paint method, do this:
    if (!started)
         g.drawString("Press Space to start...", 250, 180);Then just get rid of your cleartext method.

Maybe you are looking for

  • Issue in PLD of Out going Payment

    Hi All,         I have a pld on out going payment where when we select the Account, we also get field to add description. Now when i try to caputre this detail in PLD, the system shows an error message, "The requested action is not supported for this

  • Table fields in script

    how to dispaly the table fields in script. it is like normal report form .. can we? Regards, pandu.

  • Connection Problem to EDS : Error 500

    Hello, i have a problem to connect to essbase via an EDS server. Http Error 500 occur if i try to connect to EDS in EAS console or if i try to connect to essbase with Excel add-in. version of product: essbase 7.1.3 eds 7.1.3 Thanks for your help Pier

  • How to pass command line parameters During server start up

    Hi,   I am trying to use Net Beans profiling tool.On the server side i required to pass a command line option to enable remote profiling. Regards, Kiran.

  • Settlement of service orders

    Hi Gurus, Can anyone explain me the process of service order settlement with step by step configuration. Regards, partha [email protected]