?
Solved

jFrame Fullscreen

Posted on 2008-11-06
5
Medium Priority
?
2,337 Views
Last Modified: 2012-05-05
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

0
Comment
Question by:iphone
  • 3
5 Comments
 
LVL 5

Expert Comment

by:Triguna
ID: 22893519
setZOrder(0);
0
 
LVL 5

Expert Comment

by:Triguna
ID: 22893528
set your frame Always on Top. So that you can make sure that your application is on top of everything. Hope this helps.
0
 
LVL 5

Expert Comment

by:Triguna
ID: 22893565
ZOrder is an vb method. setAlwaysOnTop(true) is the Java method.
0
 
LVL 14

Expert Comment

by:CPColin
ID: 22897318
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
 
LVL 6

Accepted Solution

by:
javaexperto earned 1500 total points
ID: 22912501
in order to maximize(full screen) your JFrame try this:


setExtendedState(JFrame.MAXIMIZED_BOTH);

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month16 days, 12 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question