BorderLayout focusmovement

Hello

I've set up a BorderLayoutManager, but I have problems of application of the focus-movement.

I watched "Advanced managers Implement howto" in the resources of the developer, but I saw that it's even there that the application is not as I want.

I managed to implement the movement between the different cells of the BorderLayout, but when I add a Manager to one of the fields of the BorderLayout, I can't move the focus to that Manager.

For example, suppose that I have added a VerticalFieldManager to the center of the BorderLayout and a focusable LabelField to the South. If I move down, the focus goes immediately from the Manager in the Center to the labelfield in the South (instead of going into the second field in my verticalfieldmanager)

Can someone explain how I can do the above?

I'll post my code BorderLayoutManager as soon as I have this problem of fixed focus!

Thank you!

Thanks for the help!

Here is my code BorderLayoutManager. There are a few restrictions (East and West aren't focusable, 1 only one field per location), but the implementation is perfect for what I need to. Do not hesitate to extend the functionality!

PS: Utils.max calculates the max of 3 values.

Code:

Import net.rim.device.api.ui.Field;
Import net.rim.device.api.ui.Manager;

/**
* Manager app in the BorderLayout Swing. This implementation has some restrictions:
East and West components are not focusable, a single component can be added by constraint.
* @author Johannes of dash
*/
SerializableAttribute public class BorderLayoutManager extends Manager {}

The 5 areas of the Manager of
private [fields];
The index fields in the Manager 'super. '
private int [] fieldIndexes;
The counter that keeps track of the index in the "super Manager".
private int addCounter;
Location constraint values
public static final int CENTER = 0;
public static final int NORTH = 1;
public static final int IS = 2;
public static final int SOUTH = 3;
public static final int WEST = 4;

/**
* The constructor.
*/
public BorderLayoutManager() {}
Super (NON_FOCUSABLE);
fields = new field [5];
fieldIndexes = new int [5];
addCounter = 0;
for (int i = 0; i)< 5;="" i++)="">
fieldIndexes [i] = - 1;
}
}

/**
* Adds a field to this Manager. Add a field without constraint adds the field
* in the CENTER of this Manager.
@param field to add.
*/
public void add (field) {}
Add (CENTER field);
}

/**
* Adds a field to this Manager at the specified location.
@param forced the constraint of location where the field will be added.
@param f field to add.
*/
public void add (int constraint, field f) {}
If (constraint < 0="" ||="" constraint=""> 4) {}
throw new IllegalArgumentException ("BorderLayoutManager.add called with an invalid constraint:" + forced + ".");
}
If (fields [constraint]! = null) {}
Replace (fields [constraint], f);
} else {}
Super.Add (f);
fieldIndexes [constraint] = addCounter ++;
}
fields [constraint] = f;
Invalidate();
}

/**
* @inheritDoc
*/
protected int nextFocus (int direction, boolean alt) {}
Return nextFocusIndex (direction, getFieldWithFocus());
}

/**
* @inheritDoc
*/
protected int nextFocus (int direction, int axis) {}
Return nextFocusIndex (direction, getFieldWithFocus());
}

calculates the following focus field index.
private int nextFocusIndex (int direction, field f) {}
int URL = newFocusLocation (getLocationFromField (f), direction);
return fieldIndexes [url];
}

This determines the location of the field f.
private int getLocationFromField (field f) {}
If (f == null) {}
Returns - 1;
}
for (int i = 0; i)< 5;="" i++)="">
If (f.equals (fields [i])) {}
Return i;
}
}
field not found
Returns - 1;
}

calculates the next position which needs to focus
private int newFocusLocation (int previousLocation, int direction) {}
int newFocusLocation = previousLocation;
If (previousLocation == CENTER) {}
If (branch > 0) {}
newFocusLocation = SOUTH;
} ElseIf (direction< 0)="">
newFocusLocation = NORTH;
}
} ElseIf (previousLocation == NORTH) {}
If (branch > 0) {}
newFocusLocation = CENTER;
}
} ElseIf (previousLocation == SOUTH) {}
If (branch< 0)="">
newFocusLocation = CENTER;
}
} ElseIf (previousLocation == EAST) {}
East is not active
} ElseIf (previousLocation == WEST) {}
West is not active
}
If (fields [newFocusLocation] == null) {}
newFocusLocation = previousLocation;
}
Return newFocusLocation;
}

/**
* @inheritDoc
*/
protected void sublayout (int width, int height) {}
calculate the position of each field, then call
setPositionChild() and layoutChild() for each field
int left_w = 0, right_w = 0, top_h = 0, bottom_h = 0;
If (fields [NORTH]! = null) {}
top_h = Math.max (10, fields [NORTH] .getPreferredHeight ());
}
If (fields [IS]! = null) {}
right_w = Math.max (10, fields [EAST] .getPreferredWidth ());
}
If (fields [SOUTH]! = null) {}
bottom_h = Math.max (10, fields [SOUTH] .getPreferredHeight ());
}
If (fields [WEST]! = null) {}
left_w = Math.max (10, fields [WEST] .getPreferredWidth ());
}

NORTH
If (fields [NORTH]! = null) {}
layoutChild (fields [NORTH], width, top_h);
setPositionChild (fields [NORTH], 0, 0);
}
SOUTH
If (fields [SOUTH]! = null) {}
layoutChild (fields [SOUTH], width, bottom_h);
setPositionChild (fields, [SOUTH], 0, height - bottom_h);
}
EAST
If (fields [IS]! = null) {}
layoutChild (fields [IS], right_w, height - top_h - bottom_h);
setPositionChild (fields [IS], width - right_w, top_h);
}
WEST
If (fields [WEST]! = null) {}
layoutChild (fields [WEST], left_w, height - top_h - bottom_h);
setPositionChild (fields [WEST], 0, top_h);
}
CENTER
If (fields [CENTER]! = null) {}
layoutChild (fields [CENTER], width - right_w - left_w, height - top_h - bottom_h);
setPositionChild (fields [Online], left_w, top_h);
}

setExtent (width, height);
}

/**
* @inheritDoc
*/
public int getPreferredWidth() {}
return of max (top, in the middle + left + right, down)
Return Utils.max)
getPreferredWidth (NORTH),
getPreferredWidth (EAST) + getPreferredWidth (CENTER) + getPreferredWidth (WEST),
getPreferredWidth (SOUTH));
}

calculates the preferredWidth of the field at the specified location.
private int getPreferredWidth (int location) {}
If (fields [location]! = null) {}
Return fields [location] .getPreferredWidth ();
}
return 0;
}

/**
* @inheritDoc
*/
public int getPreferredHeight() {}
return sum (high, low, max (left, right, Center))
return getPreferredHeight (NORTH)
+ Utils.max (getPreferredHeight (EAST), getPreferredHeight (CENTER), getPreferredHeight (WEST))
+ getPreferredHeight (SOUTH);
}

calculates the preferredHeight of the field at the specified location.
private int getPreferredHeight (int location) {}
If (fields [location]! = null) {}
Return fields [location] .getPreferredHeight ();
}
return 0;
}
}

Tags: BlackBerry Developers

Similar Questions

  • Confusing behavior of get with BorderLayout

    Hello, I have a borderlayout with sort of a footer at the bottom which displays useful information on what is going, im just to add a step by step tutorial widgety thing there, its going to be a JScrollPanel with all different JLabels and an icon of a tick or cross etc etc.

    My problem is with the get, when all signs in her 'fit' on the chassis, then the scrollpane PADD out height with enough space for a scroll bar (but there isn't one, so its shared out above and below the panels) However, when space is insufficient and the get show his bar along the bottom He does not eat in this 'extra' space, the space is removed, he eats in the panels (I think that he has in fact reduced space panels have in any case) that I find confusing, I expected little to eat in space Panel (as it normally does), but it actually reduces space more that she should and adds some unnecessarily when its not need!

    its kind of hard to explain, but this example shows exactly my problem, it is a footer, I just want that it extend upward a bit when the scroll bar is displayed instead of ruin! :
    import java.awt.*;
    import javax.swing.*;
    
    public class Test extends JFrame
    {
    
         public static void main(String[] args)
         {
              Test Test = new Test();
              Test.setSize(new Dimension(600,500));
              Test.setVisible(true);
         }
         
         public Test()
         {
              Container c = this.getContentPane();
              c.add(new JLabel("resize me smaller"),BorderLayout.PAGE_START);
              JPanel myPanel = new JPanel();
              myPanel.setBorder(BorderFactory.createLineBorder(Color.pink));
              myPanel.add(new JLabel("A nice label, oh wait its too long! (actually its too short, hence why i am adding this)"));
              c.add(new JScrollPane(myPanel, JScrollPane.VERTICAL_SCROLLBAR_NEVER,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.SOUTH);
         }
    }
    Curiously, his only ever the right size just before he needs of the horizontal scroll bar

    I hope someone can help

    Joe

    The text of the label "resize me more small" must really say ++ 'resize the width of the frame smaller. "+" This will make the problem more obvious.

    If you change the code to:

    //Test7.setSize(new Dimension(600,500));
    Test7.pack();
    

    Then the label is initially displayed at its default size.

    I don't know why the height of the label continues to change as overtemperature/increase in the width of the frame. I'd wait the height remains the same.

    The only solution I have is a brute force solution:

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    public class Test7 extends JFrame
    {
    
         public static void main(String[] args)
         {
              Test7 Test7 = new Test7();
    //          Test7.setSize(new Dimension(600,500));
              Test7.pack();
              Test7.setVisible(true);
         }
    
         public Test7()
         {
              Container c = this.getContentPane();
              c.add(new JLabel("resize me smaller"),BorderLayout.PAGE_START);
              JPanel myPanel = new JPanel();
    //          myPanel.setBorder(BorderFactory.createLineBorder(Color.pink));
              JLabel label = new JLabel("A nice label, oh wait its too long! (actually its too short, hence why i am adding this)");
              myPanel.add(label);
            JScrollPane scrollPane = new JScrollPane(myPanel, JScrollPane.VERTICAL_SCROLLBAR_NEVER,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
              c.add(scrollPane, BorderLayout.SOUTH);
    
              JScrollBar sb = scrollPane.getHorizontalScrollBar();
              sb.addComponentListener( new ComponentAdapter()
              {
                   @Override
                   public void componentShown(ComponentEvent e)
                   {
                        JScrollBar scrollBar = (JScrollBar)e.getComponent();
                        JScrollPane scrollPane = (JScrollPane)scrollBar.getParent();
                        JViewport viewport = scrollPane.getViewport();
                        Component c = viewport.getView();
                        Dimension d = scrollPane.getSize();
                        d.height = c.getPreferredSize().height + scrollBar.getPreferredSize().height;
                        scrollPane.setPreferredSize( d );
                        scrollPane.revalidate();
                        scrollPane.repaint();
                   }
    
                   @Override
                   public void componentHidden(ComponentEvent e)
                   {
                        JScrollBar scrollBar = (JScrollBar)e.getComponent();
                        JScrollPane scrollPane = (JScrollPane)scrollBar.getParent();
                        JViewport viewport = scrollPane.getViewport();
                        Component c = viewport.getView();
                        Dimension d = scrollPane.getSize();
                        d.height = c.getPreferredSize().height;
                        scrollPane.setPreferredSize( d );
                        scrollPane.revalidate();
                        scrollPane.repaint();
                   }
              });
         }
    }
    

    The other option is to always display the horizontal scroll bar.

  • BorderLayout help

    Hi all. I was wondering if you could help me to answer this question. I'm doing a JFrame using BorderLayout. In this JFrame, I try to add two JButtons in the North and South stations. Also, I try to add a JPanel that also uses the BorderLayout and place it in a central position of the JFrame. In the JPanel, I try to add the same as those of the two JButtons in the JFrame to the North and the South in the BorderLayout of the JPanel. I tried to explain that as best I could, but here's a concept further photo http://i1104.photobucket.com/albums/h324/wildbill1009/conceptart/jpanel.jpg. I'm certainly not achieve the expected results. So I guess the real question I need to answer is what I am doing wrong? Below the source code. Thank you.
    public class jframeproj extends JFrame
    {
         public JButton buttonSouth;
         public JButton buttonNorth;
         public JPanel panel;
         
         public BorderLayout layout = new BorderLayout();
         
         public jframeproj()
         {
              super("hello");
              setSize(500,500);
              setLayout(layout);
              
              buttonSouth = new JButton("SOUTH");
              buttonNorth = new JButton("NORTH");
              
              panel = new JPanel(layout);
              panel.setSize(300,300);
              panel.add(buttonNorth, BorderLayout.NORTH);
              panel.add(buttonSouth, BorderLayout.SOUTH);
              
              add(panel, BorderLayout.CENTER);
              add(buttonSouth, BorderLayout.SOUTH);
              add(buttonNorth, BorderLayout.NORTH);
         }
         
         public static void main( String[] args )
         {
              jframeproj frame = new jframeproj();
              frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
              frame.setVisible(true);
         }
    }
    Published by: Beatrice94 on November 12, 2010 19:55

    Beatrice94 wrote:
    In the JPanel, I try to add the same as those of the two JButtons in the JFrame to the North and the South in the BorderLayout of the JPanel.
    So I guess the real question I need to answer is what I am doing wrong?

    A component can have only one parent. Adding a component to a container removes any container in which it was previously added.

    If you need separate JButtons, with the same functionality, consider building with the same Action. An Action can be shared between several s element.

    DB

  • How to show VerticalFieldManager at the bottom of the screen?

    Hello everyone

    I have three VerticalFieldManager as TitleManager, MainManager

    and BottomManager.

    I want to organize these vertically by ensuring that the BottomManager will

    always at the bottom of the screen and is only MainManager

    Functionality of SCROLLING VERTICAL so that the entire screen will not get scrolls.

    This is possible with the BorderLayout, which is not present in the Blackberry development environment

    What could be the best possible solution for this task?

    A lot of useful things, like this, explained here:

    http://supportforums.BlackBerry.com/T5/Java-development/MainScreen-explained/Ta-p/606644

  • Overlap two images, ordinary java works, and not in BlackBerry JDE 5

    I have an application for swing of simple java that takes two images and overlaps the other. While trying to this port in JDE5, I got out there is no class BufferedImage in the api of BB, but a similar class of the Bitmap. It's brought to BB mixing function is unable to produce an image that overlap. It shows a blank white screen.

    Here's the plain java function

    public BufferedImage blend( BufferedImage bi1, BufferedImage bi2,            double weight )   {     if (bi1 == null)          throw new NullPointerException("bi1 is null");
    
          if (bi2 == null)          throw new NullPointerException("bi2 is null");
    
          int width = bi1.getWidth();       if (width != bi2.getWidth())          throw new IllegalArgumentException("widths not equal");
    
         int height = bi1.getHeight();     if (height != bi2.getHeight())
    
              throw new IllegalArgumentException("heights not equal");
    
            BufferedImage bi3 = new BufferedImage(width, height,              BufferedImage.TYPE_INT_RGB);      int[] rgbim1 = new int[width];        int[] rgbim2 = new int[width];        int[] rgbim3 = new int[width];
    
          for (int row = 0; row < height; row++)     {         bi1.getRGB(0, row, width, 1, rgbim1, 0, width);           bi2.getRGB(0, row, width, 1, rgbim2, 0, width);
    
             for (int col = 0; col < width; col++)          {             int rgb1 = rgbim1[col];               int r1 = (rgb1 >> 16) & 255;                int g1 = (rgb1 >> 8) & 255;             int b1 = rgb1 & 255;
    
                    int rgb2 = rgbim2[col];               int r2 = (rgb2 >> 16) & 255;                int g2 = (rgb2 >> 8) & 255;             int b2 = rgb2 & 255;
    
                    int r3 = (int) (r1 * weight + r2 * (1.0 - weight));               int g3 = (int) (g1 * weight + g2 * (1.0 - weight));               int b3 = (int) (b1 * weight + b2 * (1.0 - weight));               rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;            }
    
               bi3.setRGB(0, row, width, 1, rgbim3, 0, width);       }
    
           return bi3;   } 
    

    Here's the java function of BB

      public Bitmap blend( Bitmap bi1, Bitmap  bi2,                      double weight )        {
    
                  if (bi1 == null)                       throw new NullPointerException("bi1 is null");
    
                    if (bi2 == null)                       throw new NullPointerException("bi2 is null");
    
                    int width = bi1.getWidth();            if (width != bi2.getWidth())                   throw new IllegalArgumentException("widths not equal");
    
                   int height = bi1.getHeight();          if (height != bi2.getHeight())
    
                            throw new IllegalArgumentException("heights not equal");
    
             Bitmap bi3 = new Bitmap(width, height);         int[] rgbim1 = new int[width];         int[] rgbim2 = new int[width];         int[] rgbim3 = new int[width];
    
                    for (int row = 0; row < height; row++)         {
    
                           bi1.getARGB(rgbim1,0,width,0,row, width,1);                       bi2.getARGB(rgbim2,0,width,0,row, width,1); 
    
                           for (int col = 0; col < width; col++)                  {                              int rgb1 = rgbim1[col];                                int r1 = (rgb1 >> 16) & 255;                           int g1 = (rgb1 >> 8) & 255;                            int b1 = rgb1 & 255;
    
                              int rgb2 = rgbim2[col];                                int r2 = (rgb2 >> 16) & 255;                           int g2 = (rgb2 >> 8) & 255;                            int b2 = rgb2 & 255;
    
                              int r3 = (int) (r1 * weight + r2 * (1.0 - weight));                            int g3 = (int) (g1 * weight + g2 * (1.0 - weight));                            int b3 = (int) (b1 * weight + b2 * (1.0 - weight));                            rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;                     }
    
                         bi3.setARGB(rgbim3, 0, width, 0,  row,width, 1);
    
                    }
    
                 return bi3;    }
    

    The weight of the arg is a value from 1 to 100.

    For reference, the full plain java source

    /* * To change this template, choose Tools | Templates * and open the template in the editor. */
    
    package imagetest;
    
    /** * * @author COMPUTER */// Blender1.java
    
    import java.awt.*;import java.awt.image.*;
    
    import javax.swing.*;import javax.swing.event.*;
    
    /** * This class describes and contains the entry point to an application that * demonstrates the blending transition. */
    
    public class Blender1 extends JFrame{  /**    *     */   private static final long serialVersionUID = 1L;
    
        /**    * Construct Blender1 GUI.     */
    
     public Blender1() {     super("Blender #1");      setDefaultCloseOperation(EXIT_ON_CLOSE);
    
            // Load first image from JAR file and draw image into a buffered image.
    
         ImageIcon ii1 = new ImageIcon(getClass().getResource("x.png"));       final BufferedImage bi1;      bi1 = new BufferedImage(ii1.getIconWidth(), ii1.getIconHeight(),              BufferedImage.TYPE_INT_RGB);      Graphics2D g2d = bi1.createGraphics();        int h = ii1.getImage().getHeight(null);       System.out.println("Blender1.Blender1()--------> height :" + h);       g2d.drawImage(ii1.getImage(), 0, 0, null);        g2d.dispose();
    
          // Load second image from JAR file and draw image into a buffered image.
    
            ImageIcon ii2 = new ImageIcon(getClass().getResource("y.png"));       final BufferedImage bi2;      bi2 = new BufferedImage(ii2.getIconWidth(), ii2.getIconHeight(),              BufferedImage.TYPE_INT_RGB);      g2d = bi2.createGraphics();       int h2 = ii2.getImage().getHeight(null);      System.out.println("Blender1.Blender1()--------> height :" + h2);      g2d.drawImage(ii2.getImage(), 0, 0, null);        g2d.dispose();
    
          // Create an image panel capable of displaying entire image. The widths       // of both images and the heights of both images must be identical.
    
         final ImagePanel ip = new ImagePanel();       ip.setPreferredSize(new Dimension(ii1.getIconWidth(), ii1             .getIconHeight()));       getContentPane().add(ip, BorderLayout.NORTH);
    
           // Create a slider for selecting the blending percentage: 100% means      // show all of first image; 0% means show all of second image.
    
          final JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 100);      slider.setMinorTickSpacing(5);        slider.setMajorTickSpacing(10);       slider.setPaintTicks(true);       slider.setPaintLabels(true);      slider.setLabelTable(slider.createStandardLabels(10));        slider.setInverted(true);     ChangeListener cl;        cl = new ChangeListener()     {         public void stateChanged( ChangeEvent e )         {             // Each time the user adjusts the slider, obtain the new              // blend percentage value and use it to blend the images.
    
                   int value = slider.getValue();                ip.setImage(blend(bi1, bi2, value / 100.0));          }     };        slider.addChangeListener(cl);     getContentPane().add(slider, BorderLayout.SOUTH);
    
           // Display the first image, which corresponds to a 100% blend     // percentage.
    
          ip.setImage(bi1);
    
           pack();       setVisible(true); }
    
       /**    * Blend the contents of two BufferedImages according to a specified weight.   *     * @param bi1  *            first BufferedImage  * @param bi2  *            second BufferedImage     * @param weight   *            the fractional percentage of the first image to keep     *     * @return new BufferedImage containing blended contents of BufferedImage  *         arguments   */
    
     public BufferedImage blend( BufferedImage bi1, BufferedImage bi2,         double weight )   {     if (bi1 == null)          throw new NullPointerException("bi1 is null");
    
          if (bi2 == null)          throw new NullPointerException("bi2 is null");
    
          int width = bi1.getWidth();       if (width != bi2.getWidth())          throw new IllegalArgumentException("widths not equal");
    
         int height = bi1.getHeight();     if (height != bi2.getHeight())
    
              throw new IllegalArgumentException("heights not equal");
    
            BufferedImage bi3 = new BufferedImage(width, height,              BufferedImage.TYPE_INT_RGB);      int[] rgbim1 = new int[width];        int[] rgbim2 = new int[width];        int[] rgbim3 = new int[width];
    
          for (int row = 0; row < height; row++)     {         bi1.getRGB(0, row, width, 1, rgbim1, 0, width);           bi2.getRGB(0, row, width, 1, rgbim2, 0, width);
    
             for (int col = 0; col < width; col++)          {             int rgb1 = rgbim1[col];               int r1 = (rgb1 >> 16) & 255;                int g1 = (rgb1 >> 8) & 255;             int b1 = rgb1 & 255;
    
                    int rgb2 = rgbim2[col];               int r2 = (rgb2 >> 16) & 255;                int g2 = (rgb2 >> 8) & 255;             int b2 = rgb2 & 255;
    
                    int r3 = (int) (r1 * weight + r2 * (1.0 - weight));               int g3 = (int) (g1 * weight + g2 * (1.0 - weight));               int b3 = (int) (b1 * weight + b2 * (1.0 - weight));               rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;            }
    
               bi3.setRGB(0, row, width, 1, rgbim3, 0, width);       }
    
           return bi3;   }
    
       /**    * Application entry point.    *     * @param args     *            array of command-line arguments  */
    
     public static void main( String[] args )  {     Runnable r = new Runnable()       {         public void run()         {             // Create Blender1's GUI on the event-dispatching             // thread.
    
                  new Blender1();           }     };        EventQueue.invokeLater(r);    }}
    
    /** * This class describes a panel that displays a BufferedImage's contents. */
    
    class ImagePanel extends JPanel{ /**    *     */   private static final long serialVersionUID = 4977990666209629996L;    private BufferedImage bi;
    
       /**    * Specify and paint a new BufferedImage.  *     * @param bi   *            BufferedImage whose contents are to be painted   */
    
     void setImage( BufferedImage bi ) {     this.bi = bi;     repaint();    }
    
       /**    * Paint the image panel.  *     * @param g    *            graphics context used to paint the contents of the current   *            BufferedImage    */
    
     public void paintComponent( Graphics g )  {     if (bi != null)       {         Graphics2D g2d = (Graphics2D) g;          g2d.drawImage(bi, null, 0, 0);        } }}
    

    Full java BB source

    /* * ImageScreen.java * * © ,  * Confidential and proprietary. */
    
    package src;
    
    /** *  */
    
    import java.io.OutputStream;import javax.microedition.io.Connector;import javax.microedition.io.file.FileConnection;import net.rim.device.api.system.Bitmap;import net.rim.device.api.ui.Field;import net.rim.device.api.ui.FieldChangeListener;import net.rim.device.api.ui.UiApplication;import net.rim.device.api.ui.component.BitmapField;import net.rim.device.api.ui.component.ButtonField;import net.rim.device.api.ui.component.Dialog;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.container.HorizontalFieldManager;import net.rim.device.api.ui.container.MainScreen;import net.rim.device.api.ui.component.GaugeField;/** * The main screen to display an image taken from the camera demo. */public final class ImageScreen extends MainScreen{    /** The down-scaling ratio applied to the snapshot Bitmap */    private static final int IMAGE_SCALING = 7;
    
        /** The base file name used to store pictures */    private static final String FILE_NAME = System.getProperty("fileconn.dir.photos") + "IMAGE";
    
        /** The extension of the pictures to be saved */    private static final String EXTENSION = ".bmp";
    
        /** A counter for the number of snapshots taken */    private static int _counter;    Bitmap image1,image2; BitmapField imageField;     /** A reference to the current screen for listeners */    private ImageScreen _imageScreen;
    
       /**    * Constructor    * @param raw A byte array representing an image    */    public ImageScreen( final byte[] raw1,final byte[] raw2 )    {        // A reference to this object, to be used in listeners        _imageScreen = this;
    
            setTitle("Blend and Save");
    
            // Convert the byte array to a Bitmap image        image1 = Bitmap.createBitmapFromBytes( raw1, 0, -1, 1 );        image2 = Bitmap.createBitmapFromBytes( raw2, 0, -1, 1 );        // Create two field managers to center the screen's contents        HorizontalFieldManager hfm1 = new HorizontalFieldManager( Field.FIELD_HCENTER );        HorizontalFieldManager hfm2 = new HorizontalFieldManager( Field.FIELD_HCENTER );        HorizontalFieldManager hfm3 = new HorizontalFieldManager( Field.FIELD_HCENTER );        // Create the field that contains the image//blend(image1, image2, 50/ 100.0)        imageField = new BitmapField(blend(image1, image2, 50/ 100.0) ){
    
               public int getPreferredWidth(){ return 250;}           public int getPreferredHeight(){ return 150;}
    
             };
    
            hfm1.add( imageField ); 
    
            GaugeField scroller = new GaugeField("Adjust (alt + < >)",0,100,50,Field.EDITABLE | Field.FOCUSABLE);        //scroller.setBackground( net.rim.device.api.ui.decor.BackgroundFactory.createSolidBackground(0x00000000));          scroller.setChangeListener( new GaugeFieldListener() );         hfm2.add(scroller);         // Create the SAVE button which returns the user to the main camera        // screen and saves the picture as a file.        ButtonField photoButton = new ButtonField( "Save" );        photoButton.setChangeListener( new SaveListener(raw1,raw2) );        hfm3.add(photoButton);
    
            // Create the CANCEL button which returns the user to the main camera        // screen without saving the picture.        ButtonField cancelButton = new ButtonField( "Cancel" );        cancelButton.setChangeListener( new CancelListener() );        hfm3.add(cancelButton);
    
            // Add the field managers to the screen        add( hfm1 );        add( hfm2 );        add( hfm3 );scroller.setFocus();//scroller.setValue(50);    }    public Bitmap blend( Bitmap bi1, Bitmap  bi2,                      double weight )        {
    
                  if (bi1 == null)                       throw new NullPointerException("bi1 is null");
    
                    if (bi2 == null)                       throw new NullPointerException("bi2 is null");
    
                    int width = bi1.getWidth();            if (width != bi2.getWidth())                   throw new IllegalArgumentException("widths not equal");
    
                   int height = bi1.getHeight();          if (height != bi2.getHeight())
    
                            throw new IllegalArgumentException("heights not equal");
    
             Bitmap bi3 = new Bitmap(width, height);         int[] rgbim1 = new int[width];         int[] rgbim2 = new int[width];         int[] rgbim3 = new int[width];
    
                    for (int row = 0; row < height; row++)         {            // bi -> int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize) 
    
                 // bit - > int[] argbData, int offset, int scanLength, int x, int y, int width, int height) 
    
                           bi1.getARGB(rgbim1,0,width,0,row, width,1);//  row, width, 1, , 0, width);                       bi2.getARGB(rgbim2,0,width,0,row, width,1); 
    
                           //bi1.getRGB(0, row, width, 1, rgbim1, 0, width);                       //bi2.getRGB(0, row, width, 1, rgbim2, 0, width);
    
                           for (int col = 0; col < width; col++)                  {                              int rgb1 = rgbim1[col];                                int r1 = (rgb1 >> 16) & 255;                           int g1 = (rgb1 >> 8) & 255;                            int b1 = rgb1 & 255;
    
                              int rgb2 = rgbim2[col];                                int r2 = (rgb2 >> 16) & 255;                           int g2 = (rgb2 >> 8) & 255;                            int b2 = rgb2 & 255;
    
                              int r3 = (int) (r1 * weight + r2 * (1.0 - weight));                            int g3 = (int) (g1 * weight + g2 * (1.0 - weight));                            int b3 = (int) (b1 * weight + b2 * (1.0 - weight));                            rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;                     }                    //bi -> int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)                     //bit -> (int[] data, int offset, int scanLength, int left, int top, int width, int height)                      bi3.setARGB(rgbim3, 0, width, 0,  row,width, 1);
    
                        // bi3.setRGB(0, row, width, 1, rgbim3, 0, width);                }
    
                 return bi3;    }
    
       /**    * Handles trackball click events    * @see net.rim.device.api.ui.Screen#invokeAction(int)    */       protected boolean invokeAction(int action)    {        boolean handled = super.invokeAction(action); 
    
            if(!handled)        {            switch(action)            {                case ACTION_INVOKE: // Trackball click.                {                                 return true;                }            }        }                return handled;              }
    
     /**    * A listener used for the "Save" button    */    private class GaugeFieldListener implements FieldChangeListener    {        public void fieldChanged(Field field, int context)        {          int value =  ((GaugeField)field).getValue(); if (value==0){return;}          imageField.setBitmap( blend(image1, image2, value/ 100.0) );          ((GaugeField)field).setLabel("Adjust (alt + < >)"+value);        }    }   /**    * A listener used for the "Save" button    */    private class SaveListener implements FieldChangeListener    {        /** A byte array representing an image */        private byte[] _raw1,_raw2;
    
           /**        * Constructor.        * @param raw A byte array representing an image        */        SaveListener(byte[] raw1,byte[] raw2)        {            _raw1 = raw1;            _raw2 = raw2;        }
    
           /**        * Saves the image as a file in the BlackBerry filesystem        */        public void fieldChanged(Field field, int context)        {            try            {                       // Create the connection to a file that may or                // may not exist.                FileConnection file = (FileConnection)Connector.open( FILE_NAME + _counter + EXTENSION );
    
                    // If the file exists, increment the counter until we find                // one that hasn't been created yet.                while( file.exists() )                {                    file.close();                    ++_counter;                    file = (FileConnection)Connector.open( FILE_NAME + _counter + EXTENSION );                }
    
                    // We know the file doesn't exist yet, so create it                file.create();
    
                    // Write the image to the file                OutputStream out = file.openOutputStream();                out.write(_raw1);
    
                    // Close the connections                out.close();                file.close();            }            catch(Exception e)            {                Dialog.alert( "ERROR " + e.getClass() + ":  " + e.getMessage() );            }
    
                // Inform the user where the file has been saved            Dialog.inform( "Saved to " + FILE_NAME + _counter + EXTENSION );
    
                // Increment the image counter            ++_counter;
    
                // Return to the main camera screen            UiApplication.getUiApplication().popScreen( _imageScreen );        }    }
    
       /**    * A listener used for the "Cancel" button    */    private class CancelListener implements FieldChangeListener    {       /**        * Return to the main camera screen        */        public void fieldChanged(Field field, int context)        {            UiApplication.getUiApplication().popScreen( _imageScreen );        }    }}
    

    Yes, your original code:

    for (int col = 0; col < width; col++){int rgb1 = rgbim1[col];int r1 = (rgb1 >> 16) & 255;int g1 = (rgb1 >> 8) & 255;int b1 = rgb1 & 255;
    
    int rgb2 = rgbim2[col];int r2 = (rgb2 >> 16) & 255;int g2 = (rgb2 >> 8) & 255;int b2 = rgb2 & 255;
    
    int r3 = (int) (r1 * weight + r2 * (1.0 - weight));int g3 = (int) (g1 * weight + g2 * (1.0 - weight));int b3 = (int) (b1 * weight + b2 * (1.0 - weight));rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;}
    

    Labour Code:

    for (int col = 0; col < width; col++)
    {
    int rgb1 = rgbim1[col];
    int a1 = (rgb1 >> 24) & 255;
    int r1 = (rgb1 >> 16) & 255;
    int g1 = (rgb1 >> 8) & 255;
    int b1 = rgb1 & 255;
    
    int rgb2 = rgbim2[col];
    int a2 = (rgb2 >> 24) & 255;
    int r2 = (rgb2 >> 16) & 255;
    int g2 = (rgb2 >> 8) & 255;
    int b2 = rgb2 & 255;
    
    int a3 = (int) (a1 * weight + a2 * (1.0 - weight));
    int r3 = (int) (r1 * weight + r2 * (1.0 - weight));
    int g3 = (int) (g1 * weight + g2 * (1.0 - weight));
    int b3 = (int) (b1 * weight + b2 * (1.0 - weight));
    rgbim3[col] = (a3 << 24) | (r3 << 16) | (g3 << 8) | b3;
    }
    
  • Filling the space

    Hello

    I need a screen that displays text at the top of the screen and text on the bottom of the screen.

    Swing you can do with a BorderLayout, but y at - it an easy way to achieve this goal with the BB API?

    Thank you

    easy way would be to use setTitle and setStatus class screen, they offer built-in managers at the top and bottom of the screen. You can also use the absolute layout to position your fields or add a NullField with a given height (override getPreferredHeight)

  • Kifani - only two instances of bean - dispatchCustomEvent fails

    11.1.2.1 forms

    I have a bean with the implementation defined in CardReader.CardReaderWrapper class.  When the form starts up you can see the init() method is called.  This action creates an instance - see red Objct1.  When I push the button and do the fbean.invoke method, it creates another instance, see red objct2, and the dispatchcustomevent() method fails.  Looks like I should have only one instance of the kifani not two?  It is a failure in the last line of code before the call to forms - dispatchCustomEvent (this);  IM so close...

    The console log

    init1 *.
    1: m_handler = oracle.forms.handler.JavaContainer@171e233
    Init2 *.
    CardReaderWrapper Objct1 = CardReader.CardReaderWrapper [CardReaderWrapper1, 0, 0, 0 x 0, invalid, layout = java.awt.BorderLayout]

    ... <-snipped

    CardReader.CardReaderWrapper parameter to ALL debugMode

    ... <-snipped

    CardReader.CardReaderWrapper setting mGetATR to 0
    Invoking getATR CardReader.CardReaderWrapper
    9
    CardReaderWrapper Objct2 = CardReader.CardReaderWrapper [CardReaderWrapper2, 2, 2, 373 x 79, layout = java.awt.BorderLayout]
    dispatchMessage1 *.
    2: m_handler = oracle.forms.handler.JavaContainer@171e233
    dispatchMessage2 *.
    dispatchMessage3 *.
    java.lang.NullPointerException
    at oracle.forms.ui.BeanManager.dispatchCustomEvent (unknown Source)
    at oracle.forms.ui.VBean.dispatchCustomEvent (unknown Source)
    at CardReader.CardReaderWrapper.dispatchMessage (CardReaderWrapper.java:73)
    at CardReader.CardReaderWrapper.getATR (CardReaderWrapper.java:138)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (unknown Source)
    at java.lang.reflect.Method.invoke (unknown Source)
    at oracle.forms.beans.MethodHelperPM.invokeMethod (unknown Source)
    at oracle.forms.beans.MethodPM.setProperty (unknown Source)
    at oracle.forms.ui.VBean.setBeanProperty (unknown Source)
    at oracle.forms.ui.VBean.setProperty (unknown Source)
    at oracle.forms.handler.ComponentItem.setCustomProperty (unknown Source)
    at oracle.forms.handler.ComponentItem.onUpdate (unknown Source)
    at oracle.forms.handler.JavaContainer.onUpdate (unknown Source)
    at oracle.forms.handler.UICommon.onUpdate (unknown Source)
    at oracle.forms.engine.Runform.onUpdateHandler (unknown Source)
    at oracle.forms.engine.Runform.processMessage (unknown Source)
    at oracle.forms.engine.Runform.processSet (unknown Source)
    at oracle.forms.engine.Runform.onMessageReal (unknown Source)
    at oracle.forms.engine.Runform.onMessage (unknown Source)
    at oracle.forms.engine.Runform.processEventEnd (unknown Source)
    at oracle.ewt.lwAWT.LWComponent.redispatchEvent (unknown Source)
    at oracle.ewt.lwAWT.LWComponent.processEvent (unknown Source)
    at java.awt.Component.dispatchEventImpl (unknown Source)
    at java.awt.Container.dispatchEventImpl (unknown Source)
    at java.awt.Component.dispatchEvent (unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent (unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent (unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent (unknown Source)
    at java.awt.Container.dispatchEventImpl (unknown Source)
    at java.awt.Window.dispatchEventImpl (unknown Source)
    at java.awt.Component.dispatchEvent (unknown Source)
    at java.awt.EventQueue.dispatchEventImpl (unknown Source)
    at java.awt.EventQueue.access$ 500 (unknown Source)
    in java.awt.EventQueue$ 3.run (unknown Source)
    in java.awt.EventQueue$ 3.run (unknown Source)
    at java.security.AccessController.doPrivileged (Native Method)
    in java.security.ProtectionDomain$ JavaSecurityAccessImpl.doIntersectionPrivilege (unknown Source)
    in java.security.ProtectionDomain$ JavaSecurityAccessImpl.doIntersectionPrivilege (unknown Source)
    in java.awt.EventQueue$ 4.run (unknown Source)
    in java.awt.EventQueue$ 4.run (unknown Source)
    at java.security.AccessController.doPrivileged (Native Method)
    in java.security.ProtectionDomain$ JavaSecurityAccessImpl.doIntersectionPrivilege (unknown Source)
    at java.awt.EventQueue.dispatchEvent (unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters (unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter (unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy (unknown Source)
    at java.awt.EventDispatchThread.pumpEvents (unknown Source)
    at java.awt.EventDispatchThread.pumpEvents (unknown Source)
    at java.awt.EventDispatchThread.run (unknown Source)

    a time new form instance

    FBean.Register_Bean('TEST.) CARD_READER_BEAN_AREA', 1, 'CardReader.CardReaderWrapper');

    FBean.set_logging_mode('TEST.) CARD_READER_BEAN_AREA', 1, FBEAN. LOG_ALL);

    When button pressed

    fbean. Invoke('TEST.) CARD_READER_BEAN_AREA', 1, 'getATR');

    When-custom-point-event

    DECLARE
    eventName varchar2 (30): =: system.custom_item_event;
    eventValues ParamList;
    number of eventValueType;
    tempString varchar2 (100);
    BEGIN
    message ('Hello1'); take a break;
    IF (eventName = "CARDINFO_EVENT") THEN
    eventValues: = get_parameter_list(:system.custom_item_event_parameters);
    get_parameter_attr (eventValues, 'CARDINFO_DATA', eventValueType tempString);
    END IF;
    message ("Hello2: ' |") tempString); take a break;

    - Then do something with tempString...
    -for example
    -message ("payload has been: ' |") tempString);
    : test. ATR: = tempString;
    END;

    package, card reader;

    import java.util.List;

    Javax.smartcardio import. *;

    Import oracle.forms.ui.VBean;
    Import oracle.forms.properties.ID;
    Import oracle.forms.handler.IHandler;
    Import oracle.forms.ui.CustomEvent;

    SerializableAttribute public class CardReaderWrapper extends kifani {

    Property registered under the name of the custom event
    Call it what you want...
    public static final ID CARDINFO_EVENT = ID.registerProperty ("CARDINFO_EVENT");

    Property to set the name of the parameter that contains the payload
    the event - for example your data
    public static final ID CARDINFO_DATA = ID.registerProperty ("CARDINFO_DATA");

    A reference to the Forms Manager associated with this component.
    It is used to send custom form events
    Private Shared IHandler m_handler;

    public static String strOut = null; used in part of the code ATR

    public CardReaderWrapper() {}
    Super();
    }

    /**
    * Method of the oracle.forms.ui.IView class and substitute of the kifani
    * base class.  This life cycle method is called one time what forms creates a
    the instance of the JavaBean.
    *
    < B > @param Manager < /b > a reference to the handler for the JavaBean class.
    */
    {} public void init (Manager IHandler)
    System.out.println ("* init1 *");
    Super.init (Handler);
    Manager = m_handler;
    If (m_handler == null) {}
    System.out.println ("1: m_handler is null"); }
    else {}
    System.out.println ("1: m_handler =" + m_handler) ;}
    System.out.println ("* init2 *");
    System.out.println ("CardReaderWrapper Objct1 =" + this);

    }

    /**
    * Function to dispatch an event and the data payload
    * Return to forms
    * In this case, we use the pre-defined event and the IDs payload
    *
    @param payload < b > < /b > to return to the event data.
    */
    Private Sub dispatchMessage (String payload) {}
    try {}
    System.out.println ("CardReaderWrapper Objct2 =" + this);
    System.out.println ("* dispatchMessage1 *");

    If (m_handler == null) {}
    System.out.println ("2: m_handler is null"); }
    else {}
    System.out.println ("2: m_handler =" + m_handler) ;}

    The CustomEvent = new CustomEvent (m_handler, CARDINFO_EVENT);
    System.out.println ("* dispatchMessage2 *");
    m_handler. SetProperty (CARDINFO_DATA, payload);
    System.out.println ("* dispatchMessage3 *");
    dispatchCustomEvent (this);
    System.out.println ("* dispatchMessage4 *");
    } catch (Exception e) {}
    e.printStackTrace ();
    }
    }

    Public Shared Sub main (String [] args) {}

    CRW CardReaderWrapper = new CardReaderWrapper();
    crw.getATR ();
    }

    the rest of your bean code follows
    and calls the dispatchMethod() method, which precedes
    to contact forms

    public void getATR() {}

    Plant of TerminalFactory = TerminalFactory.getDefault ();

    CardTerminals cardTerminals = factory.terminals ();
    The list < CardTerminal > cardTerminalList;

    try {}

    cardTerminalList = cardTerminals.list ();

    for (CardTerminal cardTerminal: cardTerminalList) {}

    If (cardTerminal.isCardPresent ()) {}
    Card card;

    try {}

    map = cardTerminal.connect ("T = 0");

    card.beginExclusive ();
    } catch (CardException e) {}
    strOut = ("8"); This card but with card error
    System.out.println (strOut);
    dispatchMessage (strOut);
    continue;
    }
    ATR atr = card.getATR ();

    Byte [] atrBytes = atr.getBytes ();
    strOut = '0' + javax.xml.bind.DatatypeConverter.printHexBinary (atrBytes);
    System.out.println (strOut);
    System.out.println ("* main1 *");
    card.endExclusive ();
    System.out.println ("* main2 *");
    Card.Disconnect (true);
    System.out.println ("* main3 *");
    dispatchMessage (strOut);
    }
    }

    } catch (CardException e) {}
    System.out.println("7"); no card reader not connected? ») ;
    dispatchMessage("7");

    }
    If (strOut == null) {}
    System.out.println("9");
    dispatchMessage("9");
    }
    }
    }

    		   
  • 1.8.0_40 - B25: anyone another error: "internal error CharacterEncoder.encode?

    I've just updated for Java version 1.8.0_40 - b25.

    When I try to load an applet , who worked with the 1.8.0_31 version, I get the error popup following dialog box (internal error CharacterEncoder.encode):

    CharEncod.gif

    I'm Tournai on the level '5' debugging in my Java console and get this stack trace:

    Java plug-in 11.40.2.25

    With the help of 1.8.0_40 - b25 version JRE Java hotspot Client VM

    Home Directory user = C:\Users\bjal1

    ----------------------------------------------------

    c: clear console window

    f: finalize objects on the finalization queue

    g: garbage collection

    h: display this help message

    l: dump classloader list

    m: print memory usage

    o: trigger logging

    q: Hide console

    r: reload the policy configuration

    s: dump system and deployment properties

    t: dump thread list

    v: dump thread stack

    x: delete the cache of class loaders

    0-5: set the level of trace to < n >

    ----------------------------------------------------

    Trace level set to 5: all the... completed.network: connection Http://Good.Company.LAN:8080 / product/servlets/ABCD0100 with proxy = LIVE

    network: connection http://good.company.lan:8080 / with proxy = LIVE

    network: connection Http://Good.Company.LAN:8080 / product/servlets/ABCD0100 with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    cache: cleaning of the queue of reference: http://good.company.LAN:8080/product/xyzSignOnApplet.jar

    cache: deregisterReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@6c67c581: 6

    cache: cleaning of the queue of reference: http://good.company.LAN:8080/product/xyzSignOnApplet.jar

    cache: deregisterReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@6c67c581: 5

    cache: cleaning of the queue of reference: http://good.company.LAN:8080/product/xyzSignOnApplet.jar

    cache: deregisterReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@6c67c581: 4

    cache: cleaning of the queue of reference: http://good.company.LAN:8080/product/xyzSignOnApplet.jar

    cache: deregisterReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@6c67c581: 3

    cache: cleaning of the queue of reference: http://good.company.LAN:8080/product/xyzSignOnApplet.jar

    cache: deregisterReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@6c67c581: 2

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482396331 & Action = UPDATEUSEROPTIONS & N = removeAll & eop eop = with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482396331 & Action = UPDATEUSEROPTIONS & N = removeAll & eop eop = with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482396832 & Action = LOG_USER_ENV_PROPERTIES & eop = eop with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482396832 & Action = LOG_USER_ENV_PROPERTIES & eop = eop with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482396906 & Action = GET_SESSION_ID & eop = eop with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482396906 & Action = GET_SESSION_ID & eop = eop with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    Base: from dismantling of the applet

    Preloader: delivery: ApplicationExitEvent

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@1c47b9

    Base: finished the disassembly of the applet

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1d4eb

    Base: PluginMain.unregisterApplet: 1 sun.plugin2.applet.Applet2Manager@100d6b1 mananger

    Preloader: start progressCheck thread

    Preloader: Stop progressCheck wire queue.size () = 0

    UI: plugin2manager.parentwindowDispose

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@1096dae

    Preloader: installation of true progress monitor

    Security: expected main URL: http://good.company.LAN:8080/product/SystemOverviewApplet.jar

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@d818d1

    Base: error: internal error CharacterEncoder.encode.

    Preloader: using default preloader

    Preloader: use the preloader class: null

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    Preloader: ignored all the front of download events (0) null

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame1, 0, 0, 178 x 476, layout = java.awt.BorderLayout, title =, resizable, normal]

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    at java.lang.Thread.run (unknown Source)

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@adf9a9

    Security: Reset deny the session certificate store

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1096dae

    Preloader: start progressCheck thread

    Preloader: Preloader stop after ErrorEvent

    Preloader: Stop progressCheck wire queue.size () = 0

    user interface: see the default error Panel

    Security: Reset deny the session certificate store

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@1d0784f

    Preloader: installation of true progress monitor

    Security: expected main URL: http://good.company.LAN:8080/product/xyzmenu.jar

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@177e70c

    Preloader: installation of true progress monitor

    Security: expected main URL: http://good.company.LAN:8080/product/AlertNotificationApplet.jar

    Base: error: internal error CharacterEncoder.encode.

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@6451e

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    Preloader: using default preloader

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    Preloader: use the preloader class: null

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    at java.lang.Thread.run (unknown Source)

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@1494225

    Base: error: internal error CharacterEncoder.encode.

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    Preloader: using default preloader

    Preloader: use the preloader class: null

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    preloader: adding waiting for event 1: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    Security: Reset deny the session certificate store

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1d0784f

    at java.lang.Thread.run (unknown Source)

    preloader: adding waiting for event 1: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame2, 0, 0, 818 x 28, layout = java.awt.BorderLayout, title =, resizable, normal]

    Security: Reset deny the session certificate store

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@177e70c

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame3, 0, 0, 180 x 47, layout = java.awt.BorderLayout, title =, resizable, normal]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@c10330

    Preloader: ignored all the front of download events (0) null

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@1800f2d

    Preloader: ignored all the front of download events (0) null

    Preloader: start progressCheck thread

    Preloader: start progressCheck thread

    Preloader: Preloader stop after ErrorEvent

    Preloader: Stop progressCheck wire queue.size () = 0

    Preloader: Preloader stop after ErrorEvent

    Preloader: Stop progressCheck wire queue.size () = 0

    user interface: see the default error Panel

    user interface: see the default error Panel

    Security: Reset deny the session certificate store

    Security: Reset deny the session certificate store

    Here is another track of the stack with slightly different content:

    Java plug-in 11.40.2.25

    With the help of 1.8.0_40 - b25 version JRE Java hotspot Client VM

    Home Directory user = C:\Users\bjal1

    ----------------------------------------------------

    c: clear console window

    f: finalize objects on the finalization queue

    g: garbage collection

    h: display this help message

    l: dump classloader list

    m: print memory usage

    o: trigger logging

    q: Hide console

    r: reload the policy configuration

    s: dump system and deployment properties

    t: dump thread list

    v: dump thread stack

    x: delete the cache of class loaders

    0-5: set the level of trace to < n >

    ----------------------------------------------------

    Trace level set to 5: all the... completed.network: connection Http://Good.Company.LAN:8080 / product/servlets/ABCD0100 with proxy = LIVE

    network: connection http://good.company.lan:8080 / with proxy = LIVE

    network: connection Http://Good.Company.LAN:8080 / product/servlets/ABCD0100 with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; JSESSIONID = 2EBB8F86EA2C02359E2D6A667803D64F; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482742225 & Action = UPDATEUSEROPTIONS & N = removeAll & eop eop = with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482742225 & Action = UPDATEUSEROPTIONS & N = removeAll & eop eop = with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; JSESSIONID = 2EBB8F86EA2C02359E2D6A667803D64F; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482742724 & Action = LOG_USER_ENV_PROPERTIES & eop = eop with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482742724 & Action = LOG_USER_ENV_PROPERTIES & eop = eop with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; JSESSIONID = 2EBB8F86EA2C02359E2D6A667803D64F; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482742767 & Action = GET_SESSION_ID & eop = eop with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425482742767 & Action = GET_SESSION_ID & eop = eop with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; JSESSIONID = 2EBB8F86EA2C02359E2D6A667803D64F; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    Base: from dismantling of the applet

    Preloader: delivery: ApplicationExitEvent

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@79799b

    Base: finished the disassembly of the applet

    Base: PluginMain.unregisterApplet: 5 sun.plugin2.applet.Applet2Manager@166e5bd mananger

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@c3e87e

    Preloader: start progressCheck thread

    Preloader: Stop progressCheck wire queue.size () = 0

    UI: plugin2manager.parentwindowDispose

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@230375

    Preloader: installation of true progress monitor

    Security: expected main URL: http://good.company.LAN:8080/product/SystemOverviewApplet.jar

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@586a9a

    Preloader: using default preloader

    Preloader: use the preloader class: null

    Base: error: internal error CharacterEncoder.encode.

    Preloader: ignored all the front of download events (0) null

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame5, 0, 0, 178 x 476, layout = java.awt.BorderLayout, title =, resizable, normal]

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    at java.lang.Thread.run (unknown Source)

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@1897d1f

    Security: Reset deny the session certificate store

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@230375

    Preloader: start progressCheck thread

    Preloader: Preloader stop after ErrorEvent

    Preloader: Stop progressCheck wire queue.size () = 0

    user interface: see the default error Panel

    Security: Reset deny the session certificate store

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@17aabe5

    Preloader: installation of true progress monitor

    Security: expected main URL: http://good.company.LAN:8080/product/xyzmenu.jar

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@447f91

    Preloader: installation of true progress monitor

    Security: expected main URL: http://good.company.LAN:8080/product/AlertNotificationApplet.jar

    Base: error: internal error CharacterEncoder.encode.

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@1dc3e88

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    Preloader: using default preloader

    Preloader: use the preloader class: null

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    at java.lang.Thread.run (unknown Source)

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@d4004b

    Base: error: internal error CharacterEncoder.encode.

    Preloader: using default preloader

    Preloader: use the preloader class: null

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    at java.lang.Thread.run (unknown Source)

    preloader: adding waiting for event 1: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Security: Reset deny the session certificate store

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@17aabe5

    preloader: adding waiting for event 1: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Security: Reset deny the session certificate store

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@447f91

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame6, 0, 0, 818 x 28, layout = java.awt.BorderLayout, title =, resizable, normal]

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@1ef3398

    Preloader: ignored all the front of download events (0) null

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame7, 0, 0, 180 x 47, layout = java.awt.BorderLayout, title =, resizable, normal]

    Preloader: start progressCheck thread

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@275de

    Preloader: ignored all the front of download events (0) null

    Preloader: start progressCheck thread

    Preloader: Preloader stop after ErrorEvent

    user interface: see the default error Panel

    Preloader: Stop progressCheck wire queue.size () = 0

    Preloader: Preloader stop after ErrorEvent

    Preloader: Stop progressCheck wire queue.size () = 0

    user interface: see the default error Panel

    Security: Reset deny the session certificate store

    Security: Reset deny the session certificate store

    And here's yet a third variation of trace stack:

    Java plug-in 11.40.2.25

    With the help of 1.8.0_40 - b25 version JRE Java hotspot Client VM

    Home Directory user = C:\Users\bjal1

    ----------------------------------------------------

    c: clear console window

    f: finalize objects on the finalization queue

    g: garbage collection

    h: display this help message

    l: dump classloader list

    m: print memory usage

    o: trigger logging

    q: Hide console

    r: reload the policy configuration

    s: dump system and deployment properties

    t: dump thread list

    v: dump thread stack

    x: delete the cache of class loaders

    0-5: set the level of trace to < n >

    ----------------------------------------------------

    Trace level set to 5: all the... completed.network: connection Http://Good.Company.LAN:8080 / product/servlets/ABCD0100 with proxy = LIVE

    network: connection Http://Good.Company.LAN:8080 / product/servlets/ABCD0100 with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425483648182 & Action = UPDATEUSEROPTIONS & N = removeAll & eop eop = with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425483648182 & Action = UPDATEUSEROPTIONS & N = removeAll & eop eop = with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425483648681 & Action = LOG_USER_ENV_PROPERTIES & eop = eop with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425483648681 & Action = LOG_USER_ENV_PROPERTIES & eop = eop with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425483648731 & Action = GET_SESSION_ID & eop = eop with proxy = LIVE

    network: connection http://good.company.lan:8080 / product/servlet/CommonServlet? c = 1425483648731 & Action = GET_SESSION_ID & eop = eop with cookie "is com.company.xyz.K1 = HH9hfy8IPMUgjQUNG8tViA; com.company.xyz.A1 = fjMODFn52jiEHK1xaceT + g is; JSESSIONID = 13C350EB9496C3C7E5CB91F658A8548B; productheight = 146; productheighttable = 181; xyzHelpWindow = hIeWarn = 1, hTabWarn = 1, hWestPx = 160, hX = 0, hY = 21, hW = 1008, hH = 706, hDigX is 200, hDigY = 200, hDigW = 200 hDigH = 200, parmsUserOK = true | ; sdsvsurls=http%3A//good.company.LAN%3A8080/product/|| ; com.company.xyz.ABCD0100 = 13C350EB9496C3C7E5CB91F658A8548B'

    Base: from dismantling of the applet

    Preloader: delivery: ApplicationExitEvent

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@6a8d55

    Base: finished the disassembly of the applet

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@a3a71c

    Preloader: Stop progressCheck wire queue.size () = 1

    Base: PluginMain.unregisterApplet: 1 sun.plugin2.applet.Applet2Manager@1fc625e mananger

    UI: plugin2manager.parentwindowDispose

    Preloader: start progressCheck thread

    Preloader: Stop progressCheck wire queue.size () = 0

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: Construct delegate preloader

    Preloader: Construct delegated preloader adapter = class com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@c2c36

    Preloader: installation of true progress monitor

    Security: expected main URL: http://good.company.LAN:8080/product/SystemOverviewApplet.jar

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@199bd52

    Preloader: using default preloader

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Preloader: use the preloader class: null

    Base: error: internal error CharacterEncoder.encode.

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@1021c30

    Preloader: installation of true progress monitor

    Preloader: setting default preloader and monitor progress for applets not JNLP

    Security: expected main URL: http://good.company.LAN:8080/product/AlertNotificationApplet.jar

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    at java.lang.Thread.run (unknown Source)

    Base: error: internal error CharacterEncoder.encode.

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    at java.lang.Thread.run (unknown Source)

    Basic: additional progress listener: sun.plugin.util.ProgressMonitorAdapter@158598b

    Preloader: installation of true progress monitor

    Security: expected main URL: http://good.company.LAN:8080/product/xyzmenu.jar

    Preloader: ignored all the front of download events (0) null

    Base: error: internal error CharacterEncoder.encode.

    java.lang.Error: internal error CharacterEncoder.encode

    at sun.misc.CharacterEncoder.encode (unknown Source)

    at com.sun.deploy.util.SystemUtils.encodeString (unknown Source)

    preloader: adding waiting for event 1: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    at sun.plugin2.applet.Applet2Manager.getParametersString (unknown Source)

    Security: Reset deny the session certificate store

    at sun.plugin2.applet.Applet2Manager.getAppInfo (unknown Source)

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1021c30

    to sun.plugin2.applet.Plugin2Manager$ AppletExecutionRunnable.run (unknown Source)

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@71f4dd

    at java.lang.Thread.run (unknown Source)

    preloader: adding waiting for event 1: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Security: Reset deny the session certificate store

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@158598b

    Preloader: using the preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@1023edb

    Preloader: using default preloader

    Preloader: use the preloader class: null

    Preloader: start progressCheck thread

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame1, 0, 0, 178 x 476, layout = java.awt.BorderLayout, title =, resizable, normal]

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@f44746

    Security: Reset deny the session certificate store

    Base: removed progress listener: sun.plugin.util.ProgressMonitorAdapter@c2c36

    Preloader: using default preloader

    Preloader: use the preloader class: null

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame2, 0, 0, 180 x 47, layout = java.awt.BorderLayout, title =, resizable, normal]

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@19c1700

    Preloader: ignored all the front of download events (0) null

    Preloader: start progressCheck thread

    Preloader: GrayBox: parent = sun.plugin2.main.client.PluginEmbeddedFrame [frame3, 0, 0, 818 x 28, layout = java.awt.BorderLayout, title =, resizable, normal]

    Preloader: start progressCheck thread

    preloader: delivery: ErrorEvent [url = label = CharacterEncoder.encode internal error cause = CharacterEncoder.encode internal error ]

    Preloader: queue: com.sun.javaws.progress.PreloaderDelegate$4@bbdc7b

    Preloader: ignored all the front of download events (0) null

    Preloader: Preloader stop after ErrorEvent

    user interface: see the default error Panel

    Preloader: Preloader stop after ErrorEvent

    Preloader: Stop progressCheck wire queue.size () = 0

    Preloader: Stop progressCheck wire queue.size () = 0

    user interface: see the default error Panel

    Preloader: Preloader stop after ErrorEvent

    Preloader: Stop progressCheck wire queue.size () = 0

    user interface: see the default error Panel

    Security: Reset deny the session certificate store

    Security: Reset deny the session certificate store

    Security: Reset deny the session certificate store

    This page contains three applets.  When I just a cmdlet, it seems to work without error.

    Interestingly, when I go to the page with three applets, it will load occasionally.  So it seems that if I load the page with three applets on it of in the applet in the page simple applet, three applets fails.  If I load the page with three applets on it directly, it loads OK.

    Thank you.

    With the help of first class at Oracle, this problem was identified and resolved.

    It was not a problem of Java, but the error to the user.

    Our web application connects to Java Plug - in System Properties (i.e., System.getProperties ();) to a server log at sign to help diagnose problems with plugin java browser.  The applet sign - we send them down to the server.  Before sending them down, it was a copy of the system properties and then removing two of the properties: "line.separator" and "line.separator.applet".  Why do we remove them?  Simply to avoid an unwanted line break appear in the server log file.

    Well, what was supposed to be a copy of the system properties was actually a reference to the system properties.  Then when we removed these two properties, the CharacterEncoder has failed because it relies on the property system being present and pure "line.separator".

    To make a long story short, we were pulling the rug under the JVM itself, rewriting of the vital system property values.

    Our sign on the applet has done this for years.  Somehow we got away with it until version 1.8.0_40 - b25.

  • Problem with efficiency

    Hi all

    I developed a JavaFx 2.0 application. JavaFx 2.0 works fine and I get an impressive appearance for my GUI. The GUI is created with FXML and CSS files.

    My application works in combination with the NASA WorldWind (which only works with swing). The two applications (jfx and worldwind) communicates via java Sockets because I found no way to do natively (I needed to swing inside jfx).

    Both applications consume a Web services created in Visual Studio and running on IIS . The web service provided little data. The application isn't a web application use this solution to solve a problem.

    The JFX application use timers (to access webservices data) every second and send and receive messages via the plug regularly.

    Well, now my problem...

    Sometimes my GUI created by JFX2.0 locks and this is not necessarily in a specific time, but rather the action.

    I'll appreciate any help.

    Javier V

    p.d. sorry for my English

    EDT is the short name for the "Event Dispatch Thread" which is the event thread and redraw used in Swing.

    EDIT - I see, WorldWind uses JOGL. Currently, a direct insertion in a JavaFX UI of JOGL, using SwingNode content is not possible (easily). There are however some efforts of the community to allow JOGL and JavaFX working together (ie: https://github.com/AqD/JOGL-FX) so it is perhaps possible to change WorldWindowGLCanvas of WorldWind of the GLCanvas of JOGL original than that can be incorporated within JavaFX.

    EDIT 2 - http://forum.worldwindcentral.com/showthread.php?36896-WorldWind-for-JavaFX , it is possible to integrate WorldWind directly in JavaFX using the component WorldWindGLJPanel instead of WorldWindowGLCanvas.

    The following code works well:

    public class Main extends Application {
    
        @Override
        public void start(Stage primaryStage) {
            final SwingNode swingNode = new SwingNode();
            final StackPane root = new StackPane();
            root.getChildren().add(swingNode);
            Scene scene = new Scene(root, 300, 250);
            primaryStage.setTitle("Test WorldWind");
            primaryStage.setScene(scene);
            primaryStage.show();
            SwingUtilities.invokeLater(() -> initializeWorldWind(swingNode));
        }
    
        private void initializeWorldWind(final SwingNode swingNode) {
    //        final WorldWindowGLCanvas wwd = new WorldWindowGLCanvas();
            final WorldWindowGLJPanel wwd = new WorldWindowGLJPanel();
            wwd.setPreferredSize(new java.awt.Dimension(300, 250));
            final JPanel panel = new JPanel();
            panel.add(wwd, java.awt.BorderLayout.CENTER);
            wwd.setModel(new BasicModel());
            swingNode.setContent(panel);
        }
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            launch(args);
        }
    }
    

    This test works well for me.

  • Please need help with my application manifest signed Comodo to get rid of the Oracle security warning

    Dear members. I need your help please

    I have a game I'm hosting at www.hiredforoneday.com

    I signed the code with Comodo M/s. I wrote the manifest file (and changed so many times) but I still get the Oracle security warning:

    "This application will run with unrestricted access, which can put your computer and personal information at risk.

    Run this application if you trust the place and the editor above.

    I'm must admit am bat / do not understand what I do.

    Please I need your help on how to write the code manifest, how correctly put it in the jar and how to reference the html code

    The game can be played online from www.hiredforone Day

    I need the system clock of the client and also I used getResources() to read images in the jar file

    on the site, I have a (Play) button. During a call to the play button, the index page connects to the file play.html which is located in the folder pots.
    The file play.html calls the HiredForOneDay.jar file that is located in the folder of the pots. Files such as launch.jnlp, launch.html are all in the jarsfolder.

    My game using Cardlayout (CardLayOutClass) in the Applets init() the

    cardLayoutClass.showCongratulationsPanel (); which shows the Congraculations class

    then setJMenuBar (helpTopicSelector.getBar ()); HelpTopicSelector is also another class

    Here is the code

    [code]

    package hiredforoneday;

    /**
    * @(#) HiredForADayApplet.java
    *

    * @author Ruth Bugembe
    * @author John Bannick
    * @version December 23, 2012
    */
    @SuppressWarnings ("serial")
    SerializableAttribute public class HiredForADayApplet extends javax.swing.JApplet {}

    public static CardLayoutClass cardLayoutClass;
    HelpTopicSelector helpTopicSelector;
    @Override
    @SuppressWarnings("static-access")
    public void init() {}

    cardLayoutClass = new CardLayoutClass();
    helpTopicSelector = new HelpTopicSelector (this);

    Add (cardLayoutClass.getMainPanel (), BorderLayout.CENTER);
    cardLayoutClass.showCongratulationsPanel ();

    setJMenuBar (helpTopicSelector.getBar ());

    }

    } [/ code]

    I didn't send in the manifest code because I did so many versions and now am confused

    Thanks again for your time

    Ruth

    I don't think it's possible to prevent the warning message from appearing at least once. There could be an option 'do not show this again' on the dialog box warning that users can check to prevent it from appearing again. Codezone-the only thing I can think is to eliminate the dependency on the system clock client side so that the attribute in the manifest file permissions can be set to 'sandbox' rather than 'all rights '. You don't know if he read images from the same signed jar file still qualified under 'sandbox' - try it and see.

    It is worth noting that other publishers Java RIA as the Knowledge Base for the Skillsoft Support are also facing the same issue, and they document simply as a relatively mild warning message.

  • Display JList holding JLabel with icons of different heights screwed up

    I started to create a wrapper for unix 'make', that filter for binary files created and display their names and potentially an icon for those in a JList.

    But sometimes the display of icons is screwed. It is cut to the size of a pure text (JLabel) line in the JList.

    Below you can find the test program.

    You have to put two image of different size of the files binary1.jpg and binary2.jpg in the execution of the generation of java directory (I use eclipse)

    and create a test like this input file:

    > cat input
    binary1
    binary2
    binary3
    binary4
    binary5
    binary6
    binary7
    binary8
    binary9
    
    

    The build run directory TEST_DIR environment variable value.

    Finally start the java class as follows:

    > bash -c 'while read line; do echo $line; sleep 1; done' < input| (cd $TEST_DIR; java -classpath $TEST_DIR myTest.MyTest)
    
    

    Then you should see the question.

    (Doesn't bother me on the JAVA code in general - I know, that there is enough other questions of difficulty :-))

    -Thanks a lot!

    Best regards
    Frank

    ================================================

    package myTest;
    
    import java.io.*;
    import java.util.HashMap;
    import java.util.Map;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.Dimension;
    import javax.imageio.ImageIO;
    import javax.swing.DefaultListModel;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.ListCellRenderer;
    
    public class MyTest {
        static class MyCellRenderer extends JLabel implements
                ListCellRenderer<Object> {
            private static final long serialVersionUID = 577071018465376381L;
    
            public MyCellRenderer() {
                setOpaque(true);
            }
    
            public Component getListCellRendererComponent(JList<?> list,
                    Object value, int index, boolean isSelected,
                    boolean cellHasFocus) {
                if (value.getClass().equals(JLabel.class)) {
                    JLabel label = JLabel.class.cast(value);
                    setText(label.getText());
                    setIcon(label.getIcon());
                    setBackground(label.getBackground());
                    setForeground(label.getForeground());
                } else {
                    setText(value.toString());
                    setBackground(Color.WHITE);
                    setForeground(Color.BLACK);
                }
                return this;
            }
        }
    
        static final Map<String, String> fileToPicture = new HashMap<String, String>() {
            private static final long serialVersionUID = 1L;
            {
                put("binary1", "binary1.jpg");
                put("binary2", "binary2.jpg");
            }
        };
        static boolean endProcess;
        static boolean guiStarted;
        static DefaultListModel<Object> listModel;
        static JList<Object> list;
    
        static public void startGui() {
            JFrame frame = new JFrame("Building...");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setLayout(new BorderLayout());
            listModel = new DefaultListModel<Object>();
            list = new JList<Object>(listModel);
            list.setCellRenderer(new MyCellRenderer());
            list.setLayoutOrientation(JList.VERTICAL);
            list.setFixedCellHeight(-1);
            JScrollPane scrollPane = new JScrollPane(list);
            scrollPane.setPreferredSize(new Dimension(300, 500));
            frame.getContentPane().add(scrollPane, BorderLayout.NORTH);
            JButton ok = new JButton("CLOSE");
            ok.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    endProcess = true;
                };
            });
            frame.getContentPane().add(ok, BorderLayout.SOUTH);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
            guiStarted = true;
        }
    
        static private void addElem(String string, Color color) {
            String fileName = fileToPicture.get(string);
            ImageIcon icon = null;
            if (null != fileName) {
                File file = new File(new File(".").getAbsolutePath() + "/"
                        + fileName);
                try {
                    icon = new ImageIcon(ImageIO.read(file));
                } catch (IOException e) {
                    System.err
                            .println("Exception: IOException for trying to read file '"
                                    + file + "'");
                    e.printStackTrace();
                }
            }
            JLabel label = new JLabel(string);
            Color darker = color.darker();
            label.setForeground(darker);
            label.setBackground(Color.WHITE);
            label.setIcon(icon);
            listModel.addElement(label);
            list.ensureIndexIsVisible(list.getModel().getSize() - 1);
        }
    
        public static void main(String[] args) {
            endProcess = false;
            guiStarted = false;
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    startGui();
                }
            });
            while (!guiStarted) {
                try {
                    Thread.sleep(200);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String line = null;
            try {
                while (!endProcess) {
                    line = br.readLine();
                    if (line == null) {
                        break;
                    }
                    addElem(line, Color.BLACK);
                    System.out.println(line);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (!endProcess) {
                addElem("...DONE", Color.RED);
                while (!endProcess) {
                    try {
                        Thread.sleep(200);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
            System.exit(0);
        }
    }
    

    I discovered, that the problem is caused by trying to use the automatic scrolling via the #100 line:

    list.ensureIndexIsVisible(list.getModel().getSize() - 1);
    

    This helped to solve:

    Java - ensureIndexIsVisible (int) does not work - Stack Overflow

    The result is:

    if (autoScroll.isSelected()) {
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
             list.ensureIndexIsVisible(list.getModel().getSize() - 1);
      }
      });
    }
    

    Rgds,
    Frank

  • Strange behavior on the web page of preloading in WebView

    I have the following problem: in my Swing application, I want to display a web page. To do this, I use a JFXPanel that contains a WebView. The web page must be loaded in the background, and only if the loading process is totally finished I want to make the JFXPanel visible. I use thegetLoadWorker().workDoneProperty() method of the corresponding WebEngine to determine if the page is totally loaded.

    The problem is, now that the JFXPanel gets visible, I see initially a totally empty Board, and after a short period, the web page in Web view is visible. I made a simple Application demo that reproduces this behavior. If the page is loaded, a button is enabled and clicking on this button adds the WebView Panel below. In addition the link following points to an animated gif that shows the behavior: http://tinypic.com/view.php?pic=oh66bl & s = 5 #. Ujv2IhddWKl

    Here is the code of the demo application:

    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javafx.application.Platform;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.embed.swing.JFXPanel;
    import javafx.scene.Scene;
    import javafx.scene.web.WebEngine;
    import javafx.scene.web.WebView;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    public class WebViewTest extends javax.swing.JPanel {
    
       private static JFXPanel browserFxPanel;
       private WebView webView;
       private WebEngine eng;
    
       /**
      * Creates new form WebViewTest
      */
       public WebViewTest() {
      initComponents();
       Platform.setImplicitExit(false);
      browserFxPanel = new JFXPanel();
       Platform.runLater(new Runnable() {
       public void run() {
      webView = createBrowser();
       Scene scene = new Scene(webView);
      scene.setFill(null);
      browserFxPanel.setScene(
      scene);
       }
       });
       }
    
       /**
      * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
      * content of this method is always regenerated by the Form Editor.
      */
       @SuppressWarnings("unchecked")
       // <editor-fold defaultstate="collapsed" desc="Generated Code">  
       private void initComponents() {
      java.awt.GridBagConstraints gridBagConstraints;
    
      pnlMain = new javax.swing.JPanel();
      showWebpageButton = new javax.swing.JButton();
    
      setLayout(new java.awt.GridBagLayout());
    
      pnlMain.setLayout(new java.awt.BorderLayout());
      gridBagConstraints = new java.awt.GridBagConstraints();
      gridBagConstraints.gridx = 0;
      gridBagConstraints.gridy = 1;
      gridBagConstraints.gridwidth = 3;
      gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints.weightx = 1.0;
      gridBagConstraints.weighty = 1.0;
      add(pnlMain, gridBagConstraints);
    
      showWebpageButton.setText("show web page");
      showWebpageButton.setEnabled(false);
      showWebpageButton.addActionListener(new java.awt.event.ActionListener() {
       public void actionPerformed(java.awt.event.ActionEvent evt) {
      showWebpageButtonActionPerformed(evt);
       }
       });
      gridBagConstraints = new java.awt.GridBagConstraints();
      gridBagConstraints.gridx = 1;
      gridBagConstraints.gridy = 0;
      gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
      add(showWebpageButton, gridBagConstraints);
       }// </editor-fold>  
    
       private void showWebpageButtonActionPerformed(java.awt.event.ActionEvent evt) {   
      pnlMain.removeAll();
      pnlMain.add(browserFxPanel, BorderLayout.CENTER);
       WebViewTest.this.invalidate();
       WebViewTest.this.revalidate();
       }   
       // Variables declaration - do not modify  
       private javax.swing.JPanel pnlMain;
       private javax.swing.JButton showWebpageButton;
       // End of variables declaration  
    
       private WebView createBrowser() {
       Double widthDouble = pnlMain.getSize().getWidth();
       Double heightDouble = pnlMain.getSize().getHeight();
       final WebView view = new WebView();
      view.setMinSize(widthDouble, heightDouble);
      view.setPrefSize(widthDouble, heightDouble);
      eng = view.getEngine();
      eng.load("http://todomvc.com/architecture-examples/angularjs/#/");
      eng.getLoadWorker().workDoneProperty().addListener(new ChangeListener<Number>() {
       public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
       final double workDone = eng.getLoadWorker().getWorkDone();
       final double totalWork = eng.getLoadWorker().getTotalWork();
       if (workDone == totalWork) {
      showWebpageButton.setEnabled(true);
       }
       }
       });
       return view;
       }
    
       public static void main(String[] args) {
       SwingUtilities.invokeLater(new Runnable() {
       public void run() {
       final JFrame f = new JFrame("Navigator Dummy");
      f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      f.setSize(new Dimension(1024, 800));
       final WebViewTest navDummy = new WebViewTest();
      f.getContentPane().add(navDummy);
      f.setVisible(true);
       }
       });
       }
    }
    
    
    

    I don "t understand this behavior, in fact the page has already been loaded. To me, it seems that the WebView starts to render the site just to the point where it becomes visible. What can I do to get the WebView already shows the web page is loaded right now that it becomes Visible (to avoid this effect of flickr)?

    I already posted this question on StackOverflow (see http://stackoverflow.com/questions/18873315/javafx-webview-loading-page-in-background ) but didn't get an answer and found this forum today.

    Thanks in advance!

    Try the updated version in this post.

    It requires a snapshot offscreen before displaying the Web mode to make sure all is rendered before the Web is displayed.

    The code is kind of ugly and the 'solution' is a bit of a hack, you would probably want to clean it up a bit before using it anywhere (for example, there is no need to create a new WebView and snapshot, web page on each load - I did it just to get a feel for the worst-case scenario and try to pinpoint where are produce slowdowns).

    A small rectangle moves back on the top of the screen so that the fluidity of the animation can be monitored.

    On the first charge, there will be a slight stutter in the animation, but the rendered web page instantly appears when click the show page"" button.

    As you say, the stuttering occurs only the first time the page is loaded, then everything is smooth.  If you use a progress bar regular instead of an animation, the initial stuttering is probably fine, because people expect to see breaks in the progress bars from time to time (more progress reported by progress bars is not a smooth linear progression).  My guess is that if you use a regular progress bar, the behavior seen with this example is probably acceptable for almost all users.

    As for the differences between the rendering between 2.2 JavaFX and JavaFX 8, there was a lot of changes to the internal architecture of JavaFX for JavaFX 8 that have improved rendering performance, as well as probably represents the delta.

    import javafx.animation.*;
    import javafx.application.Application;
    import javafx.concurrent.Worker;
    import javafx.geometry.*;
    import javafx.scene.Scene;
    import javafx.scene.control.*;
    import javafx.scene.layout.*;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.web.WebView;
    import javafx.stage.Stage;
    import javafx.util.Duration;
    
    public class WebViewJavaFXTest extends Application {
        public static final String PAGE_URL = "http://todomvc.com/architecture-examples/angularjs/#/";
        private Rectangle distractor;
    
        @Override
        public void start(Stage stage) throws Exception {
            distractor = new Rectangle(20, 20, Color.CORAL);
            TranslateTransition r = new TranslateTransition(Duration.seconds(10), distractor);
            r.setFromX(0);
            r.setToX(800);
            r.setInterpolator(Interpolator.LINEAR);
            r.setCycleCount(RotateTransition.INDEFINITE);
            r.setAutoReverse(true);
            r.play();
    
            VBox layout = initView();
            stage.setScene(new Scene(layout));
            stage.show();
        }
    
        private VBox initView() {
            final ProgressBar progress = new ProgressBar();
            final Button showWebView = new Button("Show Page");
            showWebView.setDisable(true);
            HBox controls = new HBox(
                    10,
                    progress,
                    showWebView
            );
            controls.setAlignment(Pos.CENTER_LEFT);
            Button tryAgain = new Button("Try Again");
            tryAgain.setOnAction(actionEvent ->
                    tryAgain.getScene().setRoot(
                            initView()
                    )
            );
    
            StackPane webViewHolder = new StackPane();
            webViewHolder.setPrefSize(1024, 700);
    
            final WebView webView = new WebView();
            progress.progressProperty().bind(
                    webView.getEngine().getLoadWorker().progressProperty()
            );
            webView.setPrefSize(1024, 700);
            webView.getEngine().load(PAGE_URL);
            webView.getEngine().getLoadWorker().stateProperty().addListener(
                    (o, old, state) -> {
                        if (state == Worker.State.SUCCEEDED) {
                            webView.snapshot(
                                    snapshotResult -> {
                                        showWebView.setDisable(false);
                                        return null;
                                    },
                                    null,
                                    null
                            );
                        } else {
                            showWebView.setDisable(true);
                        }
                    }
            );
    
            showWebView.setOnAction(actionEvent -> {
                controls.getChildren().setAll(
                        tryAgain
                );
                webViewHolder.getChildren().setAll(webView);
            });
            VBox layout = new VBox(
                    10,
                    distractor,
                    controls,
                    webViewHolder
            );
            layout.setPadding(new Insets(10));
    
            return layout;
        }
    
        public static void main(String[] args) {
            launch();
        }
    
    }
    
  • Bug of concurrency in example of SimpleSwingBrowser.java?

    Take a look at the demo of the Oracle of incorporation JavaFX in a Swing application:

    http://docs.Oracle.com/JavaFX/2/swing/SimpleSwingBrowser.Java.htm

    I wonder if this example is not due to lack of follow the obiter that all objects of Swing all should be created or modified only on the event Dispatching Thread (EDT). The correct way, canonical to reach this goal is:

    SwingUtilities.invokeLater (new Runnable() {}

    public void run() {}

    createAndShowGUI();

    }

    });

    However, the example of SimpleSwingBrowser.java of it this way:

    Public Shared Sub main (String [] args) {}

    SwingUtilities.invokeLater (new SimpleSwingBrowser());

    }

    SimpleSwingBrowser is an executable, but the problem is that the assessment of the 'new SimpleSwingBrowser()' expression occurs on the main thread, and among other things, it is the initialization of the Member fields that create objects of Swing. For example:

    / public class SimpleSwingBrowser implements Runnable {}

    ...

    private JFrame frame = new JFrame();

    private JPanel Panel = new JPanel (new BorderLayout());

    Private JLabel lblStatus appearing = new JLabel();

    I don't think it's kosher (although it will probably not create a problem). Am I wrong?

    Thank you.

    -David

    I don't write a lot of code Swing, so someone more with the framework would be best to confirm the problem.

    That said, your analysis seems OK for me.

    If you get all the other answers, you can connect to a bug report:

    https://JavaFX-JIRA.Kenai.com/

  • Tests of JDesktopPane

    Well, im trying to learn how to use the JDesktopPane and I found some examples on the web, and I can't make it work "properly".

    This example is just a menu with a menu of the element that adds an internal frame, the internal frame adds a Textfield itself and this is the part that I don't understand, for some reason, the TextField is not visible.

    If I run debug, I see in a snapshot of MISTLETOE, the framework is actually created but I can't. Here's the code.



    -----
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package src;
    
    /**
     *
     * @author pato
     */
    
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JDesktopPane;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    
    public class Main extends JFrame {
      public Main() {
        JMenuBar bar = new JMenuBar();
        JMenu addMenu;
            addMenu = new JMenu("Add");
        JMenuItem newFrame;
            newFrame = new JMenuItem("Internal Frame");
        addMenu.add(newFrame);
        bar.add(addMenu);
        setJMenuBar(bar);
    
        final JDesktopPane theDesktop = new JDesktopPane();
        getContentPane().add(theDesktop);
    
        newFrame.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            JInternalFrame frame;
                frame = new JInternalFrame("Internal Frame", true, true, true, true);
    
            Container c = frame.getContentPane();
            MyJPanel panel = new MyJPanel();
    
            c.add(panel, BorderLayout.CENTER);
            frame.setSize(200,200);
            frame.setOpaque(true);
           
            theDesktop.add(frame);
          }
        });
    
        setSize(500, 400);
        setVisible(true);
      }
    
      public static void main(String args[]) {
        Main app = new Main();
      }
    }
    
    class MyJPanel extends JPanel {
      public MyJPanel() {
        JTextField label=new JTextField("Hello World");
        label.setEditable(true);
        label.setBackground(Color.CYAN); //this is the same as a JLabel
        add(label);
      
      }
    
    }
    THX in advance

    The JInternalFrame is there, just not 'visible' :) (suspicion)

  • How to add the listener to use mouse to one single line

    I have a requirement. In a JTable when I double click on a particular line the cells in the row put the width which I have provided.

    The problem with my code is when I click on the fourth row of the table, the first line adjusts.

    How I need help is so

    that if I click on the first row, the first cell size line should be adjusted not when I click on the fourth line.

    If I give a few cells of the width and the height of the cells in the fourth row, then when I double click on the fourth line, the fourth should only get adjusted and not the other lines.

    Hope I explained it clearly.

    How is it possible?


    Below is my code. Everything is hardcoded. Thus, it may seem messy. Please excuse.

    Imports
    import impossible;
    import java.awt.Color;
    java.awt.Component import;
    to import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;

    to import javax.swing.JFrame;
    to import javax.swing.JPanel;
    javax.swing.JScrollPane import;
    javax.swing.JTable import;
    Import javax.swing.JTextArea;
    Import javax.swing.table.DefaultTableModel;
    javax.swing.table.TableCellRenderer import;
    Import javax.swing.table.TableColumn;

    class SimpleTableExample extends JFrame {}
    Instance attributes used in this example
    private JPanel Top;
    JTable table private;
    private get scrollPane;
    String data1 = "";
    String data2 = "123456789ABCDEFGHIJKLMNOPQRSTUVQWXYZabcdefghijklmnopqrstuvwxyzaquickbrownfoxjumpedoverthelazydog";
    int size = data2.length ();

    Main chassis constructor
    public SimpleTableExample() {}
    Define the characteristics of frame
    setTitle ("Simple Application of Table");
    setSize (400, 200);
    setBackground (Color.gray);

    Create a Panel to contain all other components
    Top = new JPanel();
    topPanel.setLayout (new BorderLayout());
    getContentPane () .add (topPanel);

    Create column names
    ColumnNames String() is {'SALT', "DESIGN DATA", "REFERENCE"};.

    Create data

    String [] [] dataValues = {{data1, data2, "67", "77"},
    {"", "43", "853"}, {"", "89.2", "109"},
    {{' ', "9033", "3092"}} ;
    Model DefaultTableModel = new DefaultTableModel (dataValues, columnNames);
    model.addColumn ("SECTION TITLE");
    model.addColumn ("SPECIAL INSTRUCTIONS").
    table = new JTable (model) {}
    ' public boolean isCellEditable (int rowIndex, int colIndex) {}
    Returns false;
    }
    };
    adjust the height of specific line
    table.setAutoResizeMode (JTable.AUTO_RESIZE_OFF);
    colInd int = 0;
    TableColumn col = table.getColumnModel () .getColumn (colInd);
    int width = 50;
    col.setPreferredWidth (width);
    int colInd2 = 1;
    TableColumn col2 = table.getColumnModel () .getColumn (colInd2);
    int width2 = 100;
    col2.setPreferredWidth (WIDTH2);
    int colInd3 = 2;
    TableColumn col3 = table.getColumnModel () .getColumn (colInd3);
    int width3 = 10;
    Col3.setPreferredWidth (width3);
    int colInd4 = 3;
    TableColumn col4 = table.getColumnModel () .getColumn (colInd4);
    width4 int = 10;
    Col4.setPreferredWidth (width4);
    int colInd5 = 4;
    TableColumn col5 = table.getColumnModel () .getColumn (colInd5);
    width5 int = 10;
    col5.setPreferredWidth (width5);

    table.addMouseListener (new MouseAdapter() {}
    {} public void mouseClicked (MouseEvent e)
    If (e.getClickCount () == 2) {}
    JTable target = e.getSource () (JTable);
    int row = target.getSelectedRow ();
    int target.getSelectedColumn () = column;

    TableColumn col1 = table.getColumnModel () .getColumn (0);
    col1.setPreferredWidth (50);
    TableColumn col2 = table.getColumnModel () .getColumn (1);
    col2.setPreferredWidth (400);
    (.setCellRenderer) table.getColumnModel () .getColumn (1)
    (new TableCellLongTextRenderer());
    table.setRowHeight (50);
    TableColumn col5 = table.getColumnModel (.getColumn) (4);
    col5.setPreferredWidth (200);
    }
    }
    });

    Create a new instance of table

    table = new JTable (dataValues, columnNames);

    Add the table to a scroll pane
    scrollPane = new get (table);
    topPanel.add (scrollPane, BorderLayout.CENTER);
    }

    Main entry point for this example
    Public Shared Sub main (String [] args) {}
    Create an instance of the test application
    MainFrame SimpleTableExample = new SimpleTableExample();
    mainFrame.setVisible (true);
    }
    }

    class TableCellLongTextRenderer extends JTextArea implements {TableCellRenderer

    public getTableCellRendererComponent (JTable, Object value, table Component
    Boolean isSelected, boolean hasFocus, int line, int column) {}
    this.setText ((String) value);
    this.setWrapStyleWord (true);
    this.setLineWrap (true);
    the width of the column in the table to the JTextArea
    setSize (table.getColumnModel () .getColumn (column) .getWidth (),
    getPreferredSize () .height);
    If (table.getRowHeight (row)! = getPreferredSize () .height) {}
    set the height of the row in the table to the calculated height of the
    JTextArea
    table.setRowHeight (rank, getPreferredSize () .height);
    }
    Back to this;
    }

    }

    Published by: 915175 on August 3, 2012 04:24

    Hello

    Try code below. Hope this will help

    import impossible;
    import java.awt.Color;
    java.awt.Component import;
    to import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;

    to import javax.swing.JFrame;
    to import javax.swing.JPanel;
    javax.swing.JScrollPane import;
    javax.swing.JTable import;
    Import javax.swing.JTextArea;
    Import javax.swing.table.DefaultTableModel;
    javax.swing.table.TableCellRenderer import;
    Import javax.swing.table.TableColumn;

    SerializableAttribute public class SimpleTableExample extends JFrame {}

    private JPanel Top;
    JTable table private;
    private get scrollPane;
    String data1 = "";
    String data2 = "123456789ABCDEFGHIJKLMNOPQRSTUVQWXYZabcdefghijklmnopqrstuvwxyzaquickbrownfoxjumpedoverthelazydog";
    int size = data2.length ();

    Main chassis constructor
    public SimpleTableExample() {}
    Define the characteristics of frame
    setTitle ("Simple Application of Table");
    setSize (400, 200);
    setBackground (Color.gray);

    Create a Panel to contain all other components
    Top = new JPanel();
    topPanel.setLayout (new BorderLayout());
    getContentPane () .add (topPanel);

    Create column names
    ColumnNames String() is {'SALT', "DESIGN DATA", "REFERENCE"};.

    Create data

    String [] [] dataValues = {{data1, data2, "67", "77"},
    {"", "43", "853"}, {"", "89.2", "109"},
    {{' ', "9033", "3092"}} ;
    Model DefaultTableModel = new DefaultTableModel (dataValues, columnNames);
    model.addColumn ("SECTION TITLE");
    model.addColumn ("SPECIAL INSTRUCTIONS").
    table = new JTable (model) {}
    ' public boolean isCellEditable (int rowIndex, int colIndex) {}
    Returns false;
    }
    };
    adjust the height of specific line
    table.setAutoResizeMode (JTable.AUTO_RESIZE_OFF);
    colInd int = 0;
    TableColumn col = table.getColumnModel () .getColumn (colInd);
    int width = 50;
    col.setPreferredWidth (width);
    int colInd2 = 1;
    TableColumn col2 = table.getColumnModel () .getColumn (colInd2);
    int width2 = 100;
    col2.setPreferredWidth (WIDTH2);
    int colInd3 = 2;
    TableColumn col3 = table.getColumnModel () .getColumn (colInd3);
    int width3 = 10;
    Col3.setPreferredWidth (width3);
    int colInd4 = 3;
    TableColumn col4 = table.getColumnModel () .getColumn (colInd4);
    width4 int = 10;
    Col4.setPreferredWidth (width4);
    int colInd5 = 4;
    TableColumn col5 = table.getColumnModel () .getColumn (colInd5);
    width5 int = 10;
    col5.setPreferredWidth (width5);

    Rendering of the cell must be applied on each column - add by Mohamed
    for (int i = 0; i)< table.getcolumnmodel().getcolumncount();="">
    table.getColumnModel () .getColumn (i) .setCellRenderer (new TableCellLongTextRenderer());
    }

    table.addMouseListener (new MouseAdapter() {}
    {} public void mouseClicked (MouseEvent e)
    If (e.getClickCount () == 2) {}
    JTable target = e.getSource () (JTable);
    int row = target.getSelectedRow ();
    int target.getSelectedColumn () = column;
    setTableCellHeight (table, row, column); Added by Mohamed
    TableColumn col1 = table.getColumnModel () .getColumn (0);
    col1.setPreferredWidth (50);
    TableColumn col2 = table.getColumnModel () .getColumn (1);
    col2.setPreferredWidth (400);
    TableColumn col5 = table.getColumnModel (.getColumn) (4);
    col5.setPreferredWidth (200);
    }
    }
    });

    Create a new instance of table

    table = new JTable (dataValues, columnNames);

    Add the table to a scroll pane
    scrollPane = new get (table);
    topPanel.add (scrollPane, BorderLayout.CENTER);
    }

    /**
    * Created by Mohamed
    *
    * This will set the cell height and width of column
    *
    @param table
    @param line
    @param column
    */
    ' Public Sub setTableCellHeight (table JTable, int line, int column) {}

    the width of the column in the table to the JTextArea
    setSize (table.getColumnModel () .getColumn (column) .getWidth (),
    getPreferredSize () .height);
    If (table.getRowHeight (row)! = getPreferredSize () .height) {}
    set the height of the row in the table to the calculated height of the
    JTextArea
    table.setRowHeight (rank, getPreferredSize () .height);
    }
    }

    Main entry point for this example
    Public Shared Sub main (String [] args) {}
    Create an instance of the test application
    MainFrame SimpleTableExample = new SimpleTableExample();
    mainFrame.setVisible (true);
    }

    }

    class TableCellLongTextRenderer extends JTextArea implements {TableCellRenderer

    public getTableCellRendererComponent (JTable, Object value, table Component
    Boolean isSelected, boolean hasFocus, int line, int column) {}
    this.setText ((String) value);
    this.setWrapStyleWord (true);
    this.setLineWrap (true);
    Back to this;
    }

    }

Maybe you are looking for

  • Blue screen during installation of Windows XP on HP touchsmart 7320

    I have a HP touchsmart 7320 with Windows 7 Professional 64-bit pre-installed. I have to install Windows XP (32 bit) next to Windows 7, so that I can run a costly professional application which meets the incompatibility issues with Windows 7. Compatib

  • need to upgrade to windows 7 (rather annoyed!)

    Hi support them I bought a HP Pavilion 2298sa G6. It's a nice phone with 1 problem, it works on windows 8 I tried to use it for about a week, but am increasingly frustrated with windows 8 (I do not understand how Microsoft let this piece of junk out

  • HP Jet 11-d010wm: HP Stream 11-d010wm

    I need help with a HP Stream 11-d010wm power on password. I don't remember the original password and after three attempts, I get a 68136517 code.  Help would be greatly appreciated.

  • Cannot download file in Adobe. Every time I try to download image manager program appears

    I try to download a presentation, but everytime I try instead of the program from adobe, or microsoft word, the photo manager program is open and I can not locate the Conference. I need to download and conpy the text, but I'm having a problem to do s

  • Screens BSOD repeated last month - never known

    I downloaded and installed the Debugging Tools for Windows to try to identify the problem - but a lot of data and not enough information (at least for me!). Can someone help me to interrogate these debugging/dumps files please? Thank you very much. T