M
Mehmet Metan
hello to all.
Exception In thread "SyntheticImageGenerator"
java.lang.OutOfMemoryError: Java heap space
I ve two classes. and I am getting the above error.
Neccessary code is below:
public class MainEngineeringToolFrame extends JFrame implements
ActionListener.
{
//Some Code...
public MainEngineeringToolFrame
{
super("HELP PLS");
System.out.println("**super passed");
setBounds(120,300,1024,428);
setResizable(false);
System.out.println("**next code: Set Visible true");
setVisible(true);
}
//Some Code...
public static void main(String[] args)
{
System.out.println("***Main function loaded.");
MainEngineeringToolFrame frame = new MainEngineeringToolFrame();
System.out.println("***Object created.");
// frame.setTitle
// frame.setResizable
// getContentPane
// add(....
setVisible(true);
}
}
This is my fiirst class.
I created another class for the panel. where painting will occur in it.
necessary code is below:
public class DrawingPanel extends JPanel implements MouseListener,
MouseMotionListener
{
MainEngineeringToolFrame obj = new MainEngineeringToolFrame();
public DrawingPanel()
{
super();
addMouseListener(this);
addMouseMotionListener(this);
setLayout(null);
}
//paint func.
//implemented methods.
}
At the System Line it only prints:
***Main function loaded.
What means it can't create an object from itself in the main class.
than program tries to build itself some time.
And gives an error message like:
I thought increasing the heap space in ecliopse from VM arguments in
run properties window in arguments tag. where under Java Application
(Im thinking u r familliar with eclipse.)
Why does it happpen? I thought this kind of exception may occur in an
infiniteloop where infinite objects are created. Well I dont even have
a loop or Im not creating infinite number of objects..
Any helps appriciated
best regards
metan
Exception In thread "SyntheticImageGenerator"
java.lang.OutOfMemoryError: Java heap space
I ve two classes. and I am getting the above error.
Neccessary code is below:
public class MainEngineeringToolFrame extends JFrame implements
ActionListener.
{
//Some Code...
public MainEngineeringToolFrame
{
super("HELP PLS");
System.out.println("**super passed");
setBounds(120,300,1024,428);
setResizable(false);
System.out.println("**next code: Set Visible true");
setVisible(true);
}
//Some Code...
public static void main(String[] args)
{
System.out.println("***Main function loaded.");
MainEngineeringToolFrame frame = new MainEngineeringToolFrame();
System.out.println("***Object created.");
// frame.setTitle
// frame.setResizable
// getContentPane
// add(....
setVisible(true);
}
}
This is my fiirst class.
I created another class for the panel. where painting will occur in it.
necessary code is below:
public class DrawingPanel extends JPanel implements MouseListener,
MouseMotionListener
{
MainEngineeringToolFrame obj = new MainEngineeringToolFrame();
public DrawingPanel()
{
super();
addMouseListener(this);
addMouseMotionListener(this);
setLayout(null);
}
//paint func.
//implemented methods.
}
At the System Line it only prints:
***Main function loaded.
What means it can't create an object from itself in the main class.
than program tries to build itself some time.
And gives an error message like:
I thought increasing the heap space in ecliopse from VM arguments in
run properties window in arguments tag. where under Java Application
(Im thinking u r familliar with eclipse.)
Why does it happpen? I thought this kind of exception may occur in an
infiniteloop where infinite objects are created. Well I dont even have
a loop or Im not creating infinite number of objects..
Any helps appriciated
best regards
metan