I don't manage to get a maximized JFrame automatically. I have to do
it manually. After hours of search, I just don't find the way to do
it. Can anyone help me? Where is my fault in the code?
import java.awt.*;
import javax.swing.*;
public class Test
{
static JFrame venster=new JFrame("Testvenster");
public static void main(String[]args)
{
Toolkit tkit=venster.getToolkit();
Dimension vensterGrootte=tkit.getScreenSize();
int vensterBreedte=vensterGrootte.width;
int vensterHoogte=vensterGrootte.height;
int positieBreedte=0;
int positieHoogte=0;
venster.setBounds(positieBreedte,positieHoogte,vensterBreedte,vensterHoogte);
venster.setExtendedState(JFrame.MAXIMIZED_BOTH);
venster.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
venster.setVisible(true);
}
}
> I don't manage to get a maximized JFrame automatically. I have to do
> it manually. After hours of search, I just don't find the way to do
> it. Can anyone help me? Where is my fault in the code?
I do not quite understand you.
Move the stuff you have in main into the
constructor of 'Test' (poor name for _any_
class btw), and those things happen
'automatically' on each frame you instantiate.
Something like this..
______________
import java.awt.*;
import javax.swing.*;
public class FullScreenFrame extends JFrame
{
static int positieBreedte=0;
static int positieHoogte=0;
FullScreenFrame()
{
Toolkit tkit=getToolkit();
Dimension vensterGrootte=tkit.getScreenSize();
int vensterBreedte=vensterGrootte.width/2;
int vensterHoogte=vensterGrootte.height/2;
setBounds(positieBreedte+=10,positieHoogte+=10,
vensterBreedte,vensterHoogte);
// setExtendedState(JFrame.MAXIMIZED_BOTH);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setVisible(true);
}
public static void main(String[]args)
{
for (int ii=0; ii<20; ii++)
{
FullScreenFrame fsf1 = new FullScreenFrame();
}
}
}
_______________
If that is not what you mean, perhaps
you will need to clarify.
If it _is_ what you mean, you would
be better off using comp.lang.java.help
for the moment.

Signature
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology