jFrame Fullscreen

i want to create fullscreen application using jframe and jpanel

but the taskbar still showing...
how to fullscreen the application?

package test_progs;
 
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsEnvironment;
import javax.swing.JFrame;
import javax.swing.JPanel;
 
 
/**
 *
 * @author tys
 */
public class test_fullscreen extends JFrame{
    public test_fullscreen(){                                
        tys_panel panel = new tys_panel();               
        add(panel);        
 
        setUndecorated(true);
        setBackground(Color.WHITE);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        setSize(ge.getMaximumWindowBounds().width,ge.getMaximumWindowBounds().height);
        setVisible(true);
        setTitle("test fullscreen");
    }
 
    public static void main(String[] args){
        new test_fullscreen();
    }//Main   
}
 
class tys_panel extends JPanel{        
    public tys_panel(){
 
    }
 
    protected void paintComponent(Graphics g){
        super.paintComponent(g);        
        Graphics2D g2 = (Graphics2D)g;  
        g2.drawOval(50, 50, 200, 50);
        //g2.drawImage(icon.getImage(), 0, 0, null);              
    }
}

Open in new window

iphoneAsked:
Who is Participating?
 
javaexpertoConnect With a Mentor Commented:
in order to maximize(full screen) your JFrame try this:


setExtendedState(JFrame.MAXIMIZED_BOTH);

Open in new window

0
 
TrigunaCommented:
setZOrder(0);
0
 
TrigunaCommented:
set your frame Always on Top. So that you can make sure that your application is on top of everything. Hope this helps.
0
 
TrigunaCommented:
ZOrder is an vb method. setAlwaysOnTop(true) is the Java method.
0
 
CPColinSenior Java ArchitectCommented:
Sun's website has a good tutorial on this, including a few tips to keep in mind:

http://java.sun.com/docs/books/tutorial/extra/fullscreen/exclusivemode.html

This page shows you other things you can do when in full-screen mode:

http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.