FullScreen Mode i komponenty

0

Witam,
mam problem z fullscreen mode i zamieszczanymi komponentami.

Przykład:

public class Engine2Component {
    static GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    static GraphicsDevice gs = ge.getDefaultScreenDevice();

    static JFrame frame=null;
    static JWindow win=null;

    public Engine2Component(){
        frame = new JFrame(gs.getDefaultConfiguration());
        frame.setVisible(true);
        win = new JWindow(frame);
        frame.setLayout(new BorderLayout());
        frame.getContentPane().add(new JButton("ABC"),BorderLayout.NORTH);
        frame.getContentPane().add(new JButton("ABC"),BorderLayout.SOUTH);
        frame.getContentPane().add(new JButton("ABC"),BorderLayout.EAST);
        frame.getContentPane().add(new JButton("ABC"),BorderLayout.WEST);
        frame.getContentPane().add(new JButton("XYZ"),BorderLayout.CENTER);

        win.addMouseListener(new MouseAdapter(){
            public void mouseReleased(MouseEvent e){}
        });
        frame.addKeyListener(new KeyAdapter(){
            public void keyReleased(KeyEvent e) {
                if (e.getKeyCode() == e.VK_ESCAPE) {
                    // Return to normal windowed mode
                    gs.setFullScreenWindow(null);
                    System.exit(0);
                }
            }
        });

        gs.setFullScreenWindow(win);
        win.validate();
        win.requestFocus();
        //frame.setAlwaysOnTop();
    }

    public static void main(String args[]){
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception exception) {
            exception.printStackTrace();
        }

        new Engine2Component();
    }
}

Tworze okno na pełny ekran z 5 przyciskami, jednak nie moge po nich klikać.

W czym jest problem?

0

Do przycisków nie dodałeś listenerów.

0

Ale mi chodzi o to że przyciski nie zmieniaja wyglądu (tj. bordera z Raised na Lowered) tak jakbym nie mogl po nich klikac

1 użytkowników online, w tym zalogowanych: 0, gości: 1