Synchronization on awt component

I was facing some deadlock issues on the awt component and trying to resolve the problems. I have searched using google and also in this forum but not much information that i can found. Anyone have some good article on sychonization on awt component ?
By the way, I have some question on the synchronization issues on awt component. Questions as below :
1. we should only synchronize out component by synchronized on getTreeLock() ? From what i know is that anything to do which layout and changing the structure of tree of awt component should synchronize the tree lock. Am i correct on this ?
2. since paint() method only being execute by AWT-Thread (correct ?), the paint() method shouldn't be synchonized ? If I was refering to a lot of informations in my paint method when doing painting, how i can make sure those informations/data was synchronized ?
3. It was recommended that any layout process of component should be done by AWT-Thread (Event Dispatching Thread) ? Currently my product have to compatible with jre 1.1. which invokeLater() only introduced in java 1.2. How can I layout my component in AWT-Thread ?

Hi!
Sorry to read that. Unfortunately, Firefox Sync is not a back up service and the information is stored in the servers only temporarily so the rest of your devices can get the information.

Similar Messages

  • Foreground Color of a Disabled AWT Component

    How do you change the foreground color of a disabled AWT component?

    You would have to write your own renderer that checkes to see if the component is enabled or disabled. Your renderer would then draw the component as you like in both of those states.

  • How to remove the border from an AWT Component (specifically a ScrollPane)

    I've been trying to remove the border from an AWT ScrollPane, but having no luck.
    I've tried setting the bounds on the ScrollPane to get rid of the border:
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setBounds(-2, -2, getSize().width+4, getSize().height+4);
    I've also tried overwriting the paint method of the ScrollPane but it didn't draw anything:
    private class CustomScrollPane extends ScrollPane
         public void paint(Graphics p_g)
              super.paint(p_g);
              Graphics2D g2 = (Graphics2D)p_g.create();
              g2.setColor(Color.MAGENTA);     //tried magenta so I could easily see it
              g2.drawLine(0, 0, 0, getSize().width);
    Is there anything else I should try? (I wish AWT components had a setBorder method)

    Is there anything else I should try? (I wish AWT components had a setBorder method)Actually this probably isn't possible. One of the main drawbacks of AWT was that since everything is connected to peers, you can't actually draw over or customize the view of your AWT component.
    The only recommendation I might make would be that you could try creating Canvases around your ScrollPanel that draw over the border

  • JMenu with AWT component

    dear friends;
    i have added menu bar in Jframe which is containes menues.
    AWT component is added the the same frame .
    problem is:
    menues are overlapping with awt component while i clicked the menu bar.
    dear friends help me immediately.
    thank u

    dear friends help me immediately.It's your own fault or combining Swing and AWT widgets. You're not supposed to do that, as it can lead to strange effects. Like this one.

  • An Awt Component Identifying Its display Status

    I am writing a custom Component (one extending java.awt.Component) for a game which would be running under Applet. Is it possible for a Component to identify if the Applet window (the browser) is put into the background, minimised or hidden? The Component.isShowing() call seems to return true regardless of the status of the browser window. I don't want to rely on Applet.start()/Applet.stop() and want each Component to be able to do this. Is it possible?
    Edited by: alec_lee_yl on Jan 28, 2010 5:39 PM

    If you use a fixed-width font then you will be able to pad the strings with the right number of blanks and get your columns to line up.

  • How to return the hWND of a JDialog or AWT component?

    can anyone help me try and return the handle for a JDialog or a AWT component? I just don't seem to be able to get anything to work, and any references to code all come from 2002 and i'm not sure if it works in Java 1.5
    I'm trying to return the handle of a JDialog, could anyone help me do this?
    Thank you :)

    can anyone help me try and return the handle for a
    JDialog or a AWT component? I just don't seem to be
    able to get anything to work, and any references to
    code all come from 2002 and i'm not sure if it works
    in Java 1.5
    I'm trying to return the handle of a JDialog, could
    anyone help me do this?
    Thank you :)Do not know what a hWND is. By handle do you mean reference? if that's what you mean just pass the Object. As to the code working in v1.5 ... try it and see.

  • The Font of awt component  and g.drawString(...) why not the same size??

    hi,all
    In my applet, there are many awt component,such as Button,Choice,and many string draw by paint() method.in windows platform,the awt component and the draw string has the same default font size,
    but in Mac os x, the awt Compoment's font size is bigger than the draw string's font size,so the user interface is very ugly,
    because of large amount of applets,set ervery component or draw string's font size is very difficult.
    is there any way to solute this question? someoen has tell me to modified the jvm's parameter of Max os x,
    but i cound not find where to setting the font parameter?
    please help me! thanks.

    Call g.setFont(myFont) before DrawString.
    You could try to call getFont() on one of your awt components, or code this table:String os=System.getProperty("os.name");
    os.indexOf()  Font(name)
    Macintosh     Charcoal
    Unix          (Dont know)
    Windows       MS Sans SerifgetFont is preferred.

  • Add a AWT component to a SWT widget

    Hello,
    is it possible to add a AWT component to a SWT widget?
    I have a Java3D canvas witch exetends from java.awt.component and i want to display it in my application witch uses SWT, but i can't find a way :-(
    Can you help me?
    Stev

    If it only takes other SWT components, then no. If it takes any AWT Component, then yes. But I can't find the API docs to look it up. So if you are using it, presumably you have the API docs and should thus look there for the answer... or try it, as it would've taken less time waiting for this ignorant answer.

  • JSplitPane with AWT component

    Hi all,
    I have a problem with JSplitPane, I use it with JPanel as right component and an AWT component as left Component, so when I move The Divider of the JSplitPane it hides under the AWT component not on the top of it.
    I know that result from problem of heavy weight component and light weight component .. but my question is there any work arround I can do to make the Divider appear on the top of the AWT component??
    Thanks,

    You've been given an idea: DO NOT MIX AWT and SWING Components.
    Why do you need to mix them? What is the AWT component?
    If it's something you wrote yourself, then you can change it. If it's not, decompile it and change it. Anyone who can't provide a Swing version of their stuff at this point is out of business and shouldn't care what you do with it.
    If it's some Canvas subclass, you can make it a Swing component by changing 2 lines: extends JPanel instead of Canvas and change paint() to paintComponent().
    is there any work arround I can do to make the Divider appear on the
    top of the AWT component??definitely not, unless you make the divider a heavyweight component somehow.

  • Changing custom AWT component to Swing component

    I created my own AWT component. I'd like to change it to Swing component.
    Does anyone know how to change or create a custom Swing component?
    Please also provide some framework to develop a custom Swing component.

    First try to know the difference between SWING & AWT. You can either adopt to SWING or AWT but be specific of what you want to do !
    If you like to migrate from AWT to SWING ,then make the necessary changes in your coding.(ie, re frame things like , Frame to JFrame , Button to JButton ,JTextField to JTextField etc..)
    For creating custom components ,say a component called MyLabel and you should design a class which extends JLabel and do whatever you like...
    eg import javax.swing.*;
    public class MyLabel extends JLabel
      MyLabel(String title)
         this.setTitle(title);
         this.setBackground(Color.white);
         this.setForeground(Color.blue);
    }For more details go to java tutorials.

  • Create New Awt Component

    Is it possible, and if it is, how can I create completely new gui component using awt?

    Sure. Just extend Component and override the paint method to draw it the way you want. Add a mouse listener to capture clicks or drags and do whatever you want with those, etc. I create new Swing components with special behavior all the time. (I don't think I've ever done one in pure AWT, but the principle is the same.) My variations tend to be trivial, like labels with text that wraps to the available space instead of a single line, not stuff that is going to set the computer world on fire. Depening on how complex the new component you want to invent is, this might be far from a trivial task. But it's certainly do-able.

  • Repaint in AWT Component

    Could anybody tell me, haw can i do so, that when one component is overlapped by another one, and after that the first component will be visible again, i do not need to repaint (a part of) the first component?

    CardLayout can unfortunaly display only one card at the same time. I m talking about my derived classes from JPanel. But i need all my objects be displayd at same time, may be overlapped(they are all dragable). And it were super, if paint(Graphics) would not be called each time, as "closed" object is visible again. Can i do so, that ovelapped area leaves in memory and dont need to be paint again. Or not?
    P.S. I am making a Drawing-like Tool, where PDF-rendering is needed. I could render only a PDF-area, that is currently needed. So i can zoom so much as i want without loss of quality. But unfortunaly this is to slaw and i need to optimize that.

  • Error while opening a component in ACC

    I am getting error while trying to open component in ACC. I can the component is running, but when tried to open it (either thro Open component or by double clicking on it) am getting the following error.
    Any idea on the cause of this error?
    Server exception:
    java.lang.ClassNotFoundException: com.package.MyComponent
    at atg.nucleus.SimpleComponentState.readObject(SimpleComponentState.java:593)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
    at atg.rmi.context.ContextualSkeletonImpl_Stub.invoke(Unknown Source)
    at atg.rmi.context.ContextualStub.invokeSkeleton(ContextualStub.java:121)
    at atg.security.proxy.UserSessionProxy$SessionStubHandler.invoke(UserSessionProxy.java:180)
    at atg.rmi.context.ContextualStub.invoke(ContextualStub.java:95)
    at $Proxy2.getConfigInfo(Unknown Source)
    at atg.ui.component.model.ComponentClientImpl.getConfigInfo(ComponentClientImpl.java:352)
    at atg.ui.component.ComponentEditor.showComponentEditor(ComponentEditor.java:214)
    at atg.ui.component.ComponentEditor.showComponentEditor(ComponentEditor.java:198)
    at atg.ui.component.ComponentBrowser.editSelectedComponent(ComponentBrowser.java:748)
    at atg.ui.component.ComponentBrowser$EditAction.actionPerformed(ComponentBrowser.java:735)
    at atg.ui.common.DevTree$MousePopupAdapter.applyDefaultAction(DevTree.java:266)
    at atg.ui.common.DevTree$MousePopupAdapter.mouseClicked(DevTree.java:289)
    at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
    at java.awt.Component.processMouseEvent(Component.java:6266)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Client exception:
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: com.package.MyComponent
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:178)
    at atg.rmi.context.ContextualSkeletonImpl_Stub.invoke(Unknown Source)
    at atg.rmi.context.ContextualStub.invokeSkeleton(ContextualStub.java:121)
    at atg.security.proxy.UserSessionProxy$SessionStubHandler.invoke(UserSessionProxy.java:180)
    at atg.rmi.context.ContextualStub.invoke(ContextualStub.java:95)
    at $Proxy2.getConfigInfo(Unknown Source)
    at atg.ui.component.model.ComponentClientImpl.getConfigInfo(ComponentClientImpl.java:352)
    at atg.ui.component.ComponentEditor.showComponentEditor(ComponentEditor.java:214)
    at atg.ui.component.ComponentEditor.showComponentEditor(ComponentEditor.java:198)
    at atg.ui.component.ComponentBrowser.editSelectedComponent(ComponentBrowser.java:748)
    at atg.ui.component.ComponentBrowser$EditAction.actionPerformed(ComponentBrowser.java:735)
    at atg.ui.common.DevTree$MousePopupAdapter.applyDefaultAction(DevTree.java:266)
    at atg.ui.common.DevTree$MousePopupAdapter.mouseClicked(DevTree.java:289)
    at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
    at java.awt.Component.processMouseEvent(Component.java:6266)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.lang.ClassNotFoundException: com.package.MyComponent
    at atg.nucleus.SimpleComponentState.readObject(SimpleComponentState.java:593)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
    ... 33 more
    Edited by: Gopinath Ramasamy on Sep 3, 2012 1:32 PM

    If you have everything else in place then you may also try to check RMI specific java system property "java.rmi.server.codebase". Try adding the JAR containing your classes into the server's RMI codebase system property as "-Djava.rmi.server.codebase=http://myapp/classes.jar" in the java options of your server startup script. But you should first check what is the existing codebase value and then can specify additional JARs if you feel they should be made available for download to client. Refer http://docs.oracle.com/javase/1.5.0/docs/guide/rmi/codebase.html
    You also mentioned about accessing component through REST call. Can you elaborate a little more on the whole environment and scenario that how/where exactly you are using ACC to view that component?

  • The method add() in java.awt.Container made me in confuse

    Here is my two java code file:
    //MyContainer.java
    package sam.gui;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import javax.swing.JApplet;
    import javax.swing.JFrame;
    public class MyContainer extends JApplet {
         private MyButton[] myButton = new MyButton[2];
         private static int counter = 0;
         public MyContainer() {
              myButton[0] = new MyButton(5, 5, 200, 30);
              myButton[1] = new MyButton(5, 40, 200, 30);
              for (int i = 0; i < myButton.length; i++) {
                   add(myButton);
         public void paint(Graphics g) {
              for (int i = 0; i < myButton.length; i++) {
                   System.out.println("MyButton : " + (i+1));
                   myButton[i].draw(g);
         public static void main(String[] args) {
              MyContainer container = new MyContainer();
              JFrame f = new JFrame();
              f.getContentPane().add(container);
              f.pack();
              f.setSize(new Dimension(300, 200));
              f.show();
    //MyButton.java
    package sam.gui;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    public class MyButton extends Component {
         private Color m_rectColor = new Color(128, 73, 0);
         public MyButton(int x, int y, int width, int height) {
              setBounds(x, y, width, height);     
         public void draw(Graphics g) {
              Graphics2D g2 = (Graphics2D)g;
              g.setColor(m_rectColor);
              g.fillRect(0, 0,
                        getBounds().width, getBounds().height);
              System.out.println("x = " + getBounds().x);
              System.out.println("y = " + getBounds().y);
              System.out.println("width = " + getBounds().width);
              System.out.println("height = " + getBounds().height);          
    I thinked the runned result should be below:
    MyButton : 1
    x = 5
    y = 5
    width = 200
    height = 30
    MyButton : 2
    x = 5
    y = 40
    width = 200
    height = 30But in fact, its result is here:
    MyButton : 1
    x = 5
    y = 5
    width = 200
    height = 30
    MyButton : 2
    x = 0
    y = 0
    width = 292
    height = 173I don't know why the result would like this? I have used add(...) method to add two component MyButton to the container MyContainer, But the bounds of the second component is not I want.
    So this problem made me go into confuse.

    You need to learn how layout managers work. The default layout manager of a JApplet and JFrame is BorderLayout .
    /Kaj

  • OutOfMemory error in java.awt.image.DataBufferInt. init

    We have an applet application that performs Print Preview of the images in the canvas. The images are like a network of entities (it has pictures of the entities involve (let's say Person) and how it links to other entities). We are using IE to launch the applet.
    We set min heap space to 128MB, JVM max heap space to 256MB, java plugin max heap space to 256MB using the Control Panel > Java.
    When the canvas width is about 54860 and height is 1644 and perform Print Preview, it thows an OutOfMemoryError in java.awt.image.DataBufferInt.<int>, hence, the Print Preview page is not shown. The complete stack trace (and logs) is as follows:
    Width: 54860 H: 1644
    Max heap: 254 # using Runtime.getRuntime().maxMemory()
    javaplugin.maxHeapSize: 256M # using System.getProperties("javaplugin.maxHeapSize")
    n page x n page : 1x1
    Exception in thread "AWT-EventQueue-2" java.lang.OutOfMemoryError: Java heap space
         at java.awt.image.DataBufferInt.<init>(Unknown Source)
         at java.awt.image.Raster.createPackedRaster(Unknown Source)
         at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
         at java.awt.image.BufferedImage.<init>(Unknown Source)
         at com.azeus.gdi.chart.GDIChart.preparePreview(GDIChart.java:731)
         at com.azeus.gdi.chart.GDIChart.getPreview(GDIChart.java:893)
         at com.azeus.gdi.ui.GDIUserInterface.printPreviewOp(GDIUserInterface.java:1526)
         at com.azeus.gdi.ui.GDIUserInterface$21.actionPerformed(GDIUserInterface.java:1438)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.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.Component.dispatchEvent(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)
    Drilling down the cause of the problem. The OutOfMemory occurred in the constructor of DataBufferInt when it tried to create an int array:
    public DataBufferInt(int size) {
    super(STABLE, TYPE_INT, size);
    data = new int[size]; # this part produce out of memory error when size = width X height
    bankdata = new int[1][];
    bankdata[0] = data;
    The OutOfMemory error occurred when size is width * height (54860 X 1644) which is 90,189,840 bytes (~86MB).
    I can replicate the OutOfMemory error when initiating an int array using a test class when it uses the default max heap space but if I increase the heap space to 256MB, it cannot be replicated in the test class.
    Using a smaller width and height with product not exceeding 64MB, the applet can perform Print Preview successfully.
    Given this, I think the java applet is not using the value assigned in javaplugin.maxHeapSize to set the max heap space, hence, it still uses the default max heap size and throws OutOfMemory in int array when size exceeds the default max heap space which is 64MB.
    For additional information, below is some of the java properties (when press S in java applet console):
    browser = sun.plugin
    browser.vendor = Sun Microsystems, Inc.
    browser.version = 1.1
    java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob = sun.awt.windows.WPrinterJob
    java.class.path = C:\PROGRA~1\Java\jre6\classes
    java.class.version = 50.0
    java.class.version.applet = true
    java.runtime.name = Java(TM) SE Runtime Environment
    java.runtime.version = 1.6.0_17-b04
    java.specification.version = 1.6
    java.vendor.applet = true
    java.version = 1.6.0_17
    java.version.applet = true
    javaplugin.maxHeapSpace = 256M
    javaplugin.nodotversion = 160_17
    javaplugin.version = 1.6.0_17
    javaplugin.vm.options = -Xms128M -Djavaplugin.maxHeapSpace=256M -Xmx256m -Xms128M
    javawebstart.version = javaws-1.6.0_17
    Kindly advise if this is a bug in JRE or wrong setting. If wrong setting, please advise on the proper way to set the heap space to prevent OutOfMemory in initializing int array.
    Thanks a lot.
    Edited by: rei_xanther on Jun 28, 2010 12:01 AM
    Edited by: rei_xanther on Jun 28, 2010 12:37 AM

    rei_xanther wrote:
    ..But the maximum value of the int data type is 2,147,483,647. That is the maximum positive integer value that can be stored in (the 4 bytes of) a signed int, but..
    ..The value that I passed in the int array size is only 90,189,840...its only connection with RAM is that each int requires 4 bytes of memory to hold it.
    new int[size] -- size is 90,189,840Sure. So the number of bytes required to hold those 90,189,840 ints is 360,759,360.
    I assumed that one element in the int array is 1 byte. ..Your assumption is wrong. How could it be possible to store 32 bits (4 bytes) in 8 bits (1 byte)? (a)
    a) Short of some clever compression algorithm applied to the data.

Maybe you are looking for

  • Dynamic Header for a website.    DOUBLE POINTS FOR ANSWER!!

    I don't even know where to start with this one, let me try explain this: I am looking for ideas on how to create some sort of dynamic header for an affiliate website, we have launched a new affiliate program for http://www.africancures.com/ the affil

  • Is this a project for WBuilder?

    Hi people, I just got this new project assigned and i am looking for some suggestions about this. We want to load various of log files (Apache,IIS,..) into our database. For the moment we use a Java stored procedure that reads the logfile line by lin

  • Using journalized data in an interface with aggragate function

    Hi I am trying to use the journalized data of a source table in one of my interfaces in ODI. The trouble is that one of the mappings on the target columns involves a aggregate function(sum). When I run the interface i get an error saying "not a group

  • Hidden Columns in JTable

    I wont to hide a elected column in JTable. how it to do

  • Iphoto photos to LR5

    is there an easy way to convert iphoto photos to LR5