I want to set the full screen to a java.awt.Window, but it doesn't work on Ubuntu.
The following code doesn't work:
import java.awt.*;
import javax.swing.*;
public class test
{
public static void main(String[] args)
{
Window wnd = new Window(new Frame());
wnd.setLocation(100, 100);
wnd.setSize(wnd.getToolkit().getScreenSize());
wnd.setBackground(Color.red);
wnd.setVisible(true);
}
}
I think, the problem is in the line:
wnd.setSize(wnd.getToolkit().getScreenSize());
If I change it to:
wnd.setSize(400,300)
it will work.
Can someone help me? Thanks very much!